limitedrun-themekit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +41 -0
  7. data/Rakefile +11 -0
  8. data/bin/limitedrun-themekit +7 -0
  9. data/lib/limitedrun-themekit.rb +10 -0
  10. data/lib/limitedrun-themekit/config.rb +23 -0
  11. data/lib/limitedrun-themekit/renderer.rb +88 -0
  12. data/lib/limitedrun-themekit/server.rb +70 -0
  13. data/lib/limitedrun-themekit/version.rb +5 -0
  14. data/lib/liquid/filters.rb +57 -0
  15. data/lib/liquid/tags/captcha.rb +20 -0
  16. data/lib/liquid/tags/contact_form.rb +16 -0
  17. data/lib/liquid/tags/lr_include.rb +143 -0
  18. data/lib/liquid/tags/paginate.rb +16 -0
  19. data/limitedrun-themekit.gemspec +29 -0
  20. data/spec/assets/skeleton-theme/README.md +11 -0
  21. data/spec/assets/skeleton-theme/configs/default.json +314 -0
  22. data/spec/assets/skeleton-theme/javascripts/default.js +0 -0
  23. data/spec/assets/skeleton-theme/layouts/default.html +150 -0
  24. data/spec/assets/skeleton-theme/store.json +101 -0
  25. data/spec/assets/skeleton-theme/stylesheets/default.css +888 -0
  26. data/spec/assets/skeleton-theme/templates/404.html +3 -0
  27. data/spec/assets/skeleton-theme/templates/category.html +37 -0
  28. data/spec/assets/skeleton-theme/templates/contact.html +62 -0
  29. data/spec/assets/skeleton-theme/templates/event.html +121 -0
  30. data/spec/assets/skeleton-theme/templates/events.html +43 -0
  31. data/spec/assets/skeleton-theme/templates/gallery.html +13 -0
  32. data/spec/assets/skeleton-theme/templates/history.html +58 -0
  33. data/spec/assets/skeleton-theme/templates/index.html +37 -0
  34. data/spec/assets/skeleton-theme/templates/maintenance.html +31 -0
  35. data/spec/assets/skeleton-theme/templates/news-item.html +27 -0
  36. data/spec/assets/skeleton-theme/templates/news.html +37 -0
  37. data/spec/assets/skeleton-theme/templates/order.html +119 -0
  38. data/spec/assets/skeleton-theme/templates/product.html +105 -0
  39. data/spec/assets/skeleton-theme/templates/roster-item.html +136 -0
  40. data/spec/assets/skeleton-theme/templates/roster.html +41 -0
  41. data/spec/assets/skeleton-theme/templates/search.html +33 -0
  42. data/spec/features/themekit_spec.rb +22 -0
  43. data/spec/spec_helper.rb +25 -0
  44. metadata +211 -0
@@ -0,0 +1,16 @@
1
+ module Liquid
2
+ module Tags
3
+ # Pass-through for now before better implementation
4
+ class Paginate < Liquid::Block
5
+ def initialize(tag_name, markup, tokens)
6
+ super
7
+ end
8
+
9
+ def render(context)
10
+ super
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ Liquid::Template.register_tag('paginate', Liquid::Tags::Paginate)
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'limitedrun-themekit/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "limitedrun-themekit"
8
+ gem.version = Limitedrun::Themekit::VERSION
9
+ gem.authors = ["Howard Wilson"]
10
+ gem.email = ["howard@watsonbox.net"]
11
+ gem.description = %q{Toolkit for developing Limited Run themes locally}
12
+ gem.summary = %q{Toolkit for developing Limited Run themes locally. Because Limited Run themes are made up of liquid templates, they can't easily be worked on offline. This gem renders the templates locally using mock data to speed up development.}
13
+ gem.homepage = ""
14
+ gem.license = "MIT"
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_development_dependency "rspec", "~> 2.14"
22
+ gem.add_development_dependency "capybara", "~> 2.4.1"
23
+ gem.add_development_dependency "rake"
24
+
25
+ gem.add_dependency "sinatra", "~> 1.4.0"
26
+ gem.add_dependency "activesupport", ">= 4.0"
27
+ gem.add_dependency "hashie", "~> 3.3.0"
28
+ gem.add_dependency "liquid", "~> 2.6.0"
29
+ end
@@ -0,0 +1,11 @@
1
+ Store
2
+ -----
3
+ [Pinna Records](http://pinna.limitedrun.com)
4
+
5
+ Theme
6
+ ------
7
+ [Copy of Skeleton](http://pinna.limitedrun.com/admin/storefront/themes/1998)
8
+
9
+ Exported
10
+ --------
11
+ 2014-09-09 10:45:21 UTC
@@ -0,0 +1,314 @@
1
+ {
2
+ "name": "Skeleton",
3
+ "description": "<p>A perfect basic theme for customizing.</p><ul class=\"features\"><li>Header Image Upload</li><li>Background Image Upload</li><li>Custom Color Pickers</li><li>Google Analytics</li><li>Product Search</li><li>Tweet &amp; Like Buttons</li><li>FancyBox Image Zooming</li><li>All Site Modules</li></ul>",
4
+ "author": {
5
+ "name": "Limited Run",
6
+ "website": "http://limitedrun.com"
7
+ },
8
+ "sort": 13,
9
+ "images": [
10
+ {
11
+ "thumbnail": "https://d2hzwnl4ytplf6.cloudfront.net/themes/skeleton-1-thumb.png",
12
+ "original": "https://d2hzwnl4ytplf6.cloudfront.net/themes/skeleton-1.png"
13
+ },
14
+ {
15
+ "thumbnail": "https://d2hzwnl4ytplf6.cloudfront.net/themes/skeleton-2-thumb.png",
16
+ "original": "https://d2hzwnl4ytplf6.cloudfront.net/themes/skeleton-2.png"
17
+ }
18
+ ],
19
+ "settings": {
20
+ "background_image_url": {
21
+ "format": "image",
22
+ "label": "Background Image URL",
23
+ "help": "Enter an image URL or choose an image file to upload.",
24
+ "placeholder": "http://",
25
+ "position": 0
26
+ },
27
+
28
+ "background_image_repeat": {
29
+ "format": "boolean",
30
+ "label": "Tile Background Image",
31
+ "default": false,
32
+ "position": 1
33
+ },
34
+
35
+ "header_image_url": {
36
+ "format": "image",
37
+ "label": "Header Image URL (950px width max)",
38
+ "help": "Enter an image URL or choose an image file to upload.",
39
+ "placeholder": "http://",
40
+ "position": 2
41
+ },
42
+
43
+ "header_image_centered": {
44
+ "format": "boolean",
45
+ "label": "Center Header Image",
46
+ "default": true,
47
+ "position": 3
48
+ },
49
+
50
+ "background_color": {
51
+ "format": "color",
52
+ "default": "#f8f8f8",
53
+ "label": "Background Color",
54
+ "position": 4
55
+ },
56
+ "background_font_color": {
57
+ "format": "color",
58
+ "default": "#333333",
59
+ "label": "Background Font Color",
60
+ "position": 5
61
+ },
62
+ "background_link_color": {
63
+ "format": "color",
64
+ "default": "#0e6aa9",
65
+ "label": "Background Link Color",
66
+ "position": 6
67
+ },
68
+ "background_link_hover_color": {
69
+ "format": "color",
70
+ "default": "#12497a",
71
+ "label": "Background Link Hover Color",
72
+ "position": 7
73
+ },
74
+
75
+ "view_cart_background_color": {
76
+ "format": "color",
77
+ "default": "#e9e9e9",
78
+ "label": "View Cart Background Color",
79
+ "position": 8
80
+ },
81
+ "view_cart_background_hover_color": {
82
+ "format": "color",
83
+ "default": "#d9d9d9",
84
+ "label": "View Cart Background Hover Color",
85
+ "position": 9
86
+ },
87
+ "view_cart_font_color": {
88
+ "format": "color",
89
+ "default": "#333333",
90
+ "label": "View Cart Font Color",
91
+ "position": 10
92
+ },
93
+ "view_cart_font_hover_color": {
94
+ "format": "color",
95
+ "default": "#000000",
96
+ "label": "View Cart Font Hover Color",
97
+ "position": 11
98
+ },
99
+
100
+ "sidebar_background_color": {
101
+ "format": "color",
102
+ "default": "#f9f9f9",
103
+ "label": "Sidebar Background Color",
104
+ "position": 12
105
+ },
106
+ "sidebar_highlight_color": {
107
+ "format": "color",
108
+ "default": "#efefef",
109
+ "label": "Sidebar Highlight Color",
110
+ "position": 13
111
+ },
112
+ "sidebar_separator_color": {
113
+ "format": "color",
114
+ "default": "#efefef",
115
+ "label": "Sidebar Separator Color",
116
+ "position": 14
117
+ },
118
+ "sidebar_font_color": {
119
+ "format": "color",
120
+ "default": "#333333",
121
+ "label": "Sidebar Font Color",
122
+ "position": 15
123
+ },
124
+ "sidebar_link_color": {
125
+ "format": "color",
126
+ "default": "#0e6aa9",
127
+ "label": "Sidebar Link Color",
128
+ "position": 16
129
+ },
130
+ "sidebar_link_hover_color": {
131
+ "format": "color",
132
+ "default": "#12497a",
133
+ "label": "Sidebar Link Hover Color",
134
+ "position": 17
135
+ },
136
+
137
+ "content_background_color": {
138
+ "format": "color",
139
+ "default": "#ffffff",
140
+ "label": "Content Background Color",
141
+ "position": 18
142
+ },
143
+ "content_outline_color": {
144
+ "format": "color",
145
+ "default": "#e5e5e5",
146
+ "label": "Content Outline Color",
147
+ "position": 19
148
+ },
149
+ "content_font_color": {
150
+ "format": "color",
151
+ "default": "#333333",
152
+ "label": "Content Font Color",
153
+ "position": 20
154
+ },
155
+ "content_link_color": {
156
+ "format": "color",
157
+ "default": "#0e6aa9",
158
+ "label": "Content Link Color",
159
+ "position": 21
160
+ },
161
+ "content_link_hover_color": {
162
+ "format": "color",
163
+ "default": "#12497a",
164
+ "label": "Content Link Hover Color",
165
+ "position": 22
166
+ },
167
+
168
+ "soundcloud_player_color": {
169
+ "format": "color",
170
+ "default": "#0e6aa9",
171
+ "label": "SoundCloud Player Color",
172
+ "position": 23
173
+ },
174
+
175
+ "sidebar_info_section_name": {
176
+ "format": "text",
177
+ "default": "Info",
178
+ "label": "Sidebar Info Section Name",
179
+ "position": 24
180
+ },
181
+ "sidebar_store_section_name": {
182
+ "format": "text",
183
+ "default": "Store",
184
+ "label": "Sidebar Store Section Name",
185
+ "position": 25
186
+ },
187
+
188
+ "google_analytics_id": {
189
+ "format": "text",
190
+ "label": "Google Analytics Tracking ID",
191
+ "placeholder": "UA-XXXXXXXX-X",
192
+ "position": 26
193
+ },
194
+
195
+ "display_sidebar_separators": {
196
+ "format": "boolean",
197
+ "default": true,
198
+ "label": "Visually Separate Sidebar Links",
199
+ "position": 27
200
+ },
201
+
202
+ "display_simplified_sidebar_headers": {
203
+ "format": "boolean",
204
+ "default": false,
205
+ "label": "Visually Simplify Sidebar Headers",
206
+ "position": 28
207
+ },
208
+
209
+ "display_sidebar_product_search": {
210
+ "format": "boolean",
211
+ "default": false,
212
+ "label": "Display Product Search Field in Sidebar",
213
+ "position": 29
214
+ },
215
+
216
+ "display_sidebar_roster_items_as_list": {
217
+ "format": "boolean",
218
+ "default": false,
219
+ "label": "Display Roster Items in Sidebar as a List",
220
+ "position": 30
221
+ },
222
+
223
+ "display_sidebar_roster_items_as_select": {
224
+ "format": "boolean",
225
+ "default": false,
226
+ "label": "Display Roster Items in Sidebar as a Drop Down",
227
+ "position": 31
228
+ },
229
+
230
+ "hide_roster_item_descriptions_on_roster_page": {
231
+ "format": "boolean",
232
+ "default": false,
233
+ "label": "Hide Roster Item Descriptions on Roster Page",
234
+ "position": 32
235
+ },
236
+
237
+ "display_product_image_borders": {
238
+ "format": "boolean",
239
+ "default": false,
240
+ "label": "Add Borders to Product Images",
241
+ "position": 33
242
+ },
243
+
244
+ "display_gallery_image_borders": {
245
+ "format": "boolean",
246
+ "default": false,
247
+ "label": "Add Borders to Gallery Images",
248
+ "position": 34
249
+ },
250
+
251
+ "display_tweet_button": {
252
+ "format": "boolean",
253
+ "default": false,
254
+ "label": "Display a Twitter Tweet Button on Product Pages",
255
+ "position": 35
256
+ },
257
+ "display_like_button": {
258
+ "format": "boolean",
259
+ "default": false,
260
+ "label": "Display a Facebook Like Button on Product Pages",
261
+ "position": 36
262
+ },
263
+
264
+ "display_news_tweet_button": {
265
+ "format": "boolean",
266
+ "default": false,
267
+ "label": "Display a Twitter Tweet Button on News Posts",
268
+ "position": 37
269
+ },
270
+ "display_news_like_button": {
271
+ "format": "boolean",
272
+ "default": false,
273
+ "label": "Display a Facebook Like Button on News Posts",
274
+ "position": 38
275
+ },
276
+
277
+ "use_fancybox_image_zooming": {
278
+ "format": "boolean",
279
+ "default": true,
280
+ "label": "Use FancyBox Image Zooming on Product Pages (Loads jQuery)",
281
+ "position": 39
282
+ },
283
+
284
+ "apply_rounded_corners_and_shadows_to_content_area": {
285
+ "format": "boolean",
286
+ "default": false,
287
+ "label": "Apply Rounded Corners & Shadows to the Content Area",
288
+ "position": 40
289
+ },
290
+
291
+ "embed_google_maps_on_event_pages": {
292
+ "format": "boolean",
293
+ "default": true,
294
+ "label": "Embed Google Maps on Event Pages (Ticket Selling Module)",
295
+ "position": 41
296
+ },
297
+
298
+ "supress_select_option": {
299
+ "format": "boolean",
300
+ "default": false,
301
+ "label": "Hide the 'Select...' option on product pages when there's only a single option.",
302
+ "position": 41
303
+ },
304
+
305
+ "favicon_image_url": {
306
+ "format": "image",
307
+ "content_type": true,
308
+ "label": "Favicon Image URL",
309
+ "help": "Enter an image URL or choose an image file to upload.",
310
+ "placeholder": "http://",
311
+ "position": 43
312
+ }
313
+ }
314
+ }
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>
6
+ {{ store.name }}
7
+ {% if product %}
8
+ - {{ product.name }}
9
+ {% elsif page %}
10
+ - {{ page.title }}
11
+ {% endif %}
12
+ </title>
13
+
14
+ {% if product %}
15
+ <meta name="description" content="{{ product.description | strip_html | escape | strip_newlines }}"/>
16
+ <meta property="og:title" content="{{ product.name | escape }}"/>
17
+ <meta property="og:description" content="{{ product.description | strip_html | escape | strip_newlines }}"/>
18
+ <meta property="og:type" content="product"/>
19
+ <meta property="og:url" content="{{ store.url }}{{ product.url }}"/>
20
+ <meta property="og:image" content="{% if product.images.size > 0 %}{{ product.images.first.v600_url }}{% endif %}"/>
21
+ <meta property="og:site_name" content="{{ store.name }}"/>
22
+ <meta property="fb:admins" content="763253266"/>
23
+ {% elsif news and item %}
24
+ <meta name="description" content="{{ item.body | strip_html | escape | strip_newlines }}"/>
25
+ <meta property="og:title" content="{{ item.title | escape }}"/>
26
+ <meta property="og:description" content="{{ item.body | strip_html | escape | strip_newlines }}"/>
27
+ <meta property="og:type" content="news"/>
28
+ <meta property="og:url" content="{{ store.url }}{{ item.url }}"/>
29
+ <meta property="og:site_name" content="{{ store.name }}"/>
30
+ <meta property="fb:admins" content="763253266"/>
31
+ {% else %}
32
+ <meta property="og:title" content="{{ store.name }}"/>
33
+ <meta property="og:type" content="website"/>
34
+ <meta property="og:url" content="{{ store.url }}"/>
35
+ <meta property="og:site_name" content="{{ store.name }}"/>
36
+ <meta property="fb:admins" content="763253266"/>
37
+ {% endif %}
38
+
39
+ {% if store.news %}
40
+ <link rel="alternate" type="application/atom+xml" title="{{ store.name }} - {{ store.news.title }} Feed" href="{{ store.url }}{{ store.news.url }}.xml"/>
41
+ {% endif %}
42
+
43
+ {{ config['favicon_image_url'] | favicon_tag }}
44
+
45
+ <link href="http://s1.limitedrun.com/fancybox/jquery.fancybox-1.3.4.css" media="screen" rel="stylesheet" type="text/css"/>
46
+ {{ 'default.css' | asset_url | stylesheet_tag: 'screen' }}
47
+
48
+ {% if config['google_analytics_id'] %}
49
+ <script type="text/javascript">
50
+ try {
51
+ var _gaq = _gaq || [];
52
+ _gaq.push(['_setAccount', '{{ config['google_analytics_id'] }}']);
53
+ _gaq.push(['_setDomainName', window.location.host]);
54
+ _gaq.push(['_trackPageview']);
55
+ (function() {
56
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
57
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
58
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
59
+ })();
60
+ } catch(e){}
61
+ </script>
62
+ {% endif %}
63
+ </head>
64
+ <body>
65
+ <a id="cart" onclick="javascript:Store.cart.show();">
66
+ View Cart
67
+ </a>
68
+
69
+ <div id="container">
70
+ <header>
71
+ {% if config['header_image_url'] %}
72
+ <div {% if config['header_image_centered'] %}class="center"{% endif %}><a href="/"><img src="{{ config['header_image_url'] }}"/></a></div>
73
+ {% else %}
74
+ <h1><a href="/">{{ store.name }}</a></h1>
75
+ {% endif %}
76
+ </header>
77
+
78
+ <div id="main">
79
+ <div id="sidebar">
80
+ {% if store.pages.size > 0 %}
81
+ <h4>{{ config['sidebar_info_section_name'] }}</h4>
82
+ <ul>
83
+ {% for page in store.pages %}
84
+ <li>{{ page | link_to_page }}</li>
85
+ {% endfor %}
86
+ </ul>
87
+ {% endif %}
88
+
89
+ {% if config['display_sidebar_roster_items_as_list'] or config['display_sidebar_roster_items_as_select'] %}
90
+ {% if store.roster %}
91
+ <h4>{{ store.roster.title }}</h4>
92
+ {% if config['display_sidebar_roster_items_as_select'] %}
93
+ <p>
94
+ <select onchange="if(this.options[this.selectedIndex].value !=''){window.top.location.href=this.options[this.selectedIndex].value}">
95
+ <option value="">Select...</option>
96
+ {% for i in store.roster.items %}
97
+ <option value="{{ i.url }}" {% if roster and item and item.url == i.url %}selected="selected"{% endif %}>{{ i.name }}</option>
98
+ {% endfor %}
99
+ </select>
100
+ </p>
101
+ {% else %}
102
+ <ul>
103
+ {% for item in store.roster.items %}
104
+ <li>{{ item | link_to_roster_item }}</li>
105
+ {% endfor %}
106
+ </ul>
107
+ {% endif %}
108
+ {% endif %}
109
+ {% endif %}
110
+
111
+ <h4>{{ config['sidebar_store_section_name'] }}</h4>
112
+ <ul>
113
+ {% for category in store.categories %}
114
+ <li>{{ category | link_to_category }}</li>
115
+ {% endfor %}
116
+ </ul>
117
+
118
+ {% if config['display_sidebar_product_search'] %}
119
+ <h4>Search</h4>
120
+ <form id="search" action="/products/search" method="get">
121
+ <input type="input" name="q" value="{{ query }}"> <a href="#" onclick="javascript:document.getElementById('search').submit();">»</a>
122
+ </form>
123
+ {% endif %}
124
+ </div>
125
+
126
+ <div id="content">
127
+ {{ content }}
128
+ </div>
129
+
130
+ <div class="clearfix"></div>
131
+ </div>
132
+
133
+ <footer>
134
+ &copy; {{ 'now' | date: "%Y" }}, {{ store.name }} - Powered by <a href="http://limitedrun.com">Limited Run</a>
135
+ </footer>
136
+ </div>
137
+
138
+ <!-- The following store.js script is required for every page. Do not remove it. -->
139
+ {{ store_script_tag }}
140
+ <!-- /store.js -->
141
+
142
+ {% if config['use_fancybox_image_zooming'] %}
143
+ <script src="http://s1.limitedrun.com/jquery-1.7.1.min.js"></script>
144
+ <script src="http://s1.limitedrun.com/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
145
+ <script type="text/javascript">
146
+ $('#product #images a, #history #images a, #gallery a, .roster-item #images a').fancybox({'overlayOpacity': 0.5});
147
+ </script>
148
+ {% endif %}
149
+ </body>
150
+ </html>