caboose-cms 0.5.53 → 0.5.54

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjRlZDU4MGQzOGJiYzIwZWFlM2ZhMjllMDEyNzMxZWYyNjI0M2U2Zg==
4
+ MzE3ZmY5M2U0OTYyOWE1YTNlOGQ2Y2VmYTk1ODQ3MTY4ODExMzYxYg==
5
5
  data.tar.gz: !binary |-
6
- YjVhYTIxMDMxNDQ1ZmQxZDM5YWRhZTUwNjNiN2RhMzA1NjEzOGQ3Yg==
6
+ MDU4ZjM3NTBlYjU0NjZlNmJmZTZmYzc1MzlmNDZhMzM3Y2ExYzE4MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGUxYWRhOTQzZjNhMWNlZDgxNzg1MTI4NDk0ZWE4NjUyZDkxNDRhMjFiMGJi
10
- NDZhMDJiZDYwOGVkODYzZjM2ZmZmY2I4YzcyMzM2NTQ3MDQxMjhiYzlkNTZl
11
- YTMyZmNlMjhjM2RkZTFmNTlkYmY1ZTUzMzFiM2U5OGIxMmU5ZjU=
9
+ ZjNiODQxOGQ1Y2Q2Y2U5MDBiMjk3ZmE3M2MyYzljYjQ4OTBiNjA4NTc2OTJj
10
+ Y2FjODQ4OTRhMjgzZDkyZTY1Njk3Yjk4ZGIwNWZkZTM1YWFkNzE4Mzk4MDNm
11
+ OGJhOThmZGVmNWIyODEyMjJhZTA4NDU2YmQwYzkxOWMzYmIxMTU=
12
12
  data.tar.gz: !binary |-
13
- ZDNkYzc2NDJhNzVjNTkwM2FmZWVjZGEwMzJiZjk3YjI3ZTZjMThmZjEzMDhh
14
- YTk5NmM2YzEyZmYzMTliNzc4YzhmYjY1ZjkwMzA2YWIyYzRhY2QyNWFkMzlj
15
- ZTJmOGRiODNkZDIzNTE0OGY1OWMzYTQ2MDhlNzk3ODAwNjYzYmM=
13
+ N2FkYTQxZGQ1ZmYwYjIwZGY5N2MwZGY0ZjljYjM2YzI1ZDNiYTYyNzY5ZmQy
14
+ ZWU3NjNkNDE4NjFiYzBjODdkMTQ5MDUzZTliODUyZmFiNzdkMzY0YWYzZmUy
15
+ ZDg1MzY4ZjY1Yjg2NjE4NzBiNTZhYTg4NGUyOGJjNWEzZDFlNDY=
@@ -7,8 +7,8 @@ module Caboose
7
7
  end
8
8
 
9
9
  module Caboose
10
- class ProductsController < Caboose::ApplicationController
11
-
10
+ class ProductsController < Caboose::ApplicationController
11
+
12
12
  # GET /products || GET /products/:id
13
13
  def index
14
14
 
@@ -22,20 +22,24 @@ module Caboose
22
22
  @reviews = Review.where(:product_id => @product.id).limit(10).order("id DESC") || nil
23
23
  @logged_in_user = logged_in_user
24
24
 
25
- render 'caboose/products/details' and return
25
+ render 'caboose/products/details' and return
26
26
  end
27
27
 
28
28
  # Filter params from url
29
29
  url_without_params = request.fullpath.split('?').first
30
30
 
31
31
  # Find the category
32
- category = Category.where(:site_id => @site.id, :url => url_without_params).first
33
-
32
+ cat = Category.where(:site_id => @site.id, :url => url_without_params).first
33
+ if cat.nil?
34
+ cat = Category.where(:site_id => @site.id, :url => '/products').first
35
+ cat = Category.create(:site_id => @site.id, :url => '/products') if cat.nil?
36
+ end
37
+
34
38
  # Set category ID
35
- params['category_id'] = category.id
39
+ params['category_id'] = cat.id
36
40
 
37
41
  # If this is the top-most category, collect all it's immediate children IDs
38
- params['category_id'] = category.children.collect { |child| child.id } if category.id == 1
42
+ params['category_id'] = cat.children.collect { |child| child.id } if cat.id == 1
39
43
 
40
44
  # Shove the original category ID into the first position if the param is an array
41
45
  params['category_id'].unshift(category.id) if params['category_id'].is_a?(Array)
@@ -90,7 +94,7 @@ module Caboose
90
94
  @products = @pager.items
91
95
  @category = if @filter['category_id'] then Category.find(@filter['category_id'].to_i) else nil end
92
96
 
93
- @pager.set_item_count
97
+ @pager.set_item_count
94
98
  end
95
99
 
96
100
  def show
@@ -212,7 +212,7 @@ class Caboose::Block < ActiveRecord::Base
212
212
  end
213
213
  return msg
214
214
  end
215
-
215
+
216
216
  def render_from_function(options)
217
217
  self.create_children
218
218
  #locals = OpenStruct.new(:block => self, :empty_text => empty_text, :editing => editing)
@@ -232,14 +232,32 @@ class Caboose::Block < ActiveRecord::Base
232
232
  options2[:block] = self
233
233
 
234
234
  view = ActionView::Base.new(ActionController::Base.view_paths)
235
+ site = options[:site]
236
+
235
237
  begin
236
- str = view.render(:partial => "caboose/blocks/#{name}", :locals => options2)
237
- rescue
238
- Caboose.log("Partial caboose/blocks/#{name} doesn't exist.")
238
+ str = view.render(:partial => "../../sites/#{site.name}/blocks/#{name}", :locals => options2)
239
+ rescue ActionView::MissingTemplate => ex
240
+ begin
241
+ str = view.render(:partial => "caboose/blocks/#{name}", :locals => options2)
242
+ rescue
243
+ Caboose.log("Partial caboose/blocks/#{name} doesn't exist.")
244
+ str = "<p class='note error'>#{self.partial_message(block, ex)}</p>"
245
+ end
239
246
  end
247
+
240
248
  return str
241
249
  end
242
250
 
251
+ def partial_message(name, ex)
252
+ msg = "Error with partial #{name}:\n"
253
+ if ex.is_a?(String)
254
+ Caboose.log("#{msg}#{ex}")
255
+ else
256
+ Caboose.log("#{msg}#{ex.message}\n#{ex.backtrace.join("\n")}")
257
+ end
258
+ return msg
259
+ end
260
+
243
261
  #def child_block_link
244
262
  # return "<div class='new_block' id='new_block_#{self.id}'>New Block</div>"
245
263
  #end
@@ -0,0 +1 @@
1
+ <p>This is a category.</p>
@@ -0,0 +1 @@
1
+ <p>Product crumbtrail.</p>
@@ -0,0 +1,2 @@
1
+ <p>This is a product.</p>
2
+
@@ -0,0 +1,10 @@
1
+ <div id='block_<%= block.id %>'>
2
+
3
+ <%= block.partial('product_crumbtrail', local_assigns) %>
4
+ <% if @product %>
5
+ <%= block.partial('product_details', local_assigns) %>
6
+ <% else %>
7
+ <%= block.partial('product_category', local_assigns) %>
8
+ <% end %>
9
+
10
+ </div>
@@ -1,438 +0,0 @@
1
- <style type='text/css'>
2
- .heads {
3
- display: none;
4
- }
5
- #easy_zoom img { min-width: 1200px; }
6
- #easy_zoom {
7
- width:550px;
8
- height:400px;
9
- border:5px solid #eee;
10
- background:#fff;
11
- color:#333;
12
- position:absolute;
13
- top:148px;
14
- left:635px;
15
- overflow:hidden;
16
- -moz-box-shadow:0 0 10px #777;
17
- -webkit-box-shadow:0 0 10px #777;
18
- box-shadow:0 0 10px #777;
19
- /* vertical and horizontal alignment used for preloader text */
20
- line-height:400px;
21
- text-align:center;
22
- }
23
- #login-btn { cursor: pointer; }
24
- .thumbnail {
25
- width: 60px !important;
26
- height: 60px !important;
27
- overflow: hidden !important;
28
- padding: 1px !important;
29
- background-color: #ccc !important;
30
- }
31
- #itemsingle .carousel-indicators li:nth-child(3n) {
32
- margin-right: 13px !important;
33
- }
34
- a.zoom-image {
35
- position: relative;
36
- display: block;
37
- }
38
- a.zoom-image .fullsize-loading {
39
- position:absolute;
40
- z-index:150;
41
- }
42
- div.product_thumb_image {
43
- overflow: hidden;
44
- }
45
- div.product_thumb_image img {
46
- margin: 0 auto;
47
- }
48
- ol.carousel-indicators li.thumbnail {
49
- width: 100px;
50
- height: 100px;
51
- }
52
- .product-review {
53
- list-style:none;
54
- margin-left:0;
55
- padding:15px;
56
- }
57
- .product-review:nth-child(odd) {
58
- background-color: rgb(240, 240, 240);
59
- }
60
- </style>
61
- <% p = @product %>
62
-
63
- <div class="page-content">
64
- <div class="container">
65
- <div class="row-fluid">
66
- <div class="span12">
67
- <ul class="breadcrumb">
68
- <li><a href="/">Home</a>
69
- <% if p.categories[1] %>
70
- <span class="divider">/</span></li>
71
- <% p.categories[1].ancestry.each do |c| %>
72
- <% if c != p.categories[1] %>
73
- <li><a href="<%= c.url %>"><%= c.name %></a> <span class="divider">/</span></li>
74
- <% else %>
75
- <li><a href="<%= c.url %>"><%= c.name %></a></li>
76
- <% end %>
77
- <% end %>
78
- <% else %>
79
- </li>
80
- <% end %>
81
- </ul>
82
- </div>
83
- </div>
84
-
85
- <div class="row-fluid">
86
- <div class="span12 single-item">
87
- <div class="row-fluid">
88
- <div class="span5">
89
- <div id="itemsingle" class="carousel slide clearfix">
90
- <div class="carousel-inner">
91
- <% if p.product_images != [] %>
92
- <% p.product_images.each_index do |i| %>
93
- <% if i == 0 %>
94
- <div class="item active" id="img_<%= p.product_images[i].id %>" style='position: relative;'>
95
- <% else %>
96
- <div class="item" id="img_<%= p.product_images[i].id %>" style='position: relative;'>
97
- <% end %>
98
- <a href="<%= p.product_images[i].url(:huge) %>" class="zoom-image" title="<%= p.title %>">
99
- <img src="<%= p.product_images[i].url(:large) %>" title="<%= p.title %>" />
100
- </a>
101
- </div>
102
- <% end %>
103
- </div>
104
-
105
- <ol class="carousel-indicators">
106
- <% p.product_images.each_index do |i| %>
107
- <li class='thumbnail' id="thumb_<%= p.product_images[i].id %>" data-target="#itemsingle" data-slide-to="<%= i %>">
108
- <div class='product_thumb_image' style="<%= square_image(p.product_images[i]) %> height:100px; background-size:100px;"></div>
109
- </li>
110
- <% end %>
111
- </ol>
112
- <% else %>
113
- <div class="item active" style='position: relative;'>
114
- <img src="https://dmwwflw4i3miv.cloudfront.net/placeholder.jpg" title="<%= p.title %>" />
115
- </div>
116
- </div>
117
- <% end
118
- # end p.product_images
119
- %>
120
-
121
- </div>
122
- </div>
123
- <div class="span7">
124
- <h3><%= p.title %></h3>
125
- <div class="row-fluid">
126
- <div class="span6">
127
- <% if @average > 0 %>
128
- <span class="rateit" data-rateit-value="<%= @average %>" data-rateit-ispreset="true" data-rateit-readonly="true" style="margin-bottom:10px;"></span>
129
- <% end %>
130
- <% if p.option1 && p.option1.strip.length > 0 %>
131
- <% default = p.default1 ? p.default1 : p.variants[0].option1 %>
132
- <select name='option1' id='option1'>
133
- <optgroup label="Select a <%= p.option1 %>">
134
- <% p.variants.where(:status => 'Active').collect{|v| v.option1}.reject{|str| str.nil? }.uniq.sort.each do |v| %>
135
- <option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
136
- <% end %>
137
- </optgroup>
138
- </select>
139
- <br>
140
- <% end %>
141
- <% if p.option2 && p.option2.strip.length > 0 %>
142
- <% default = p.default2 ? p.default2 : p.variants[0].option2 %>
143
- <select name='option2' id='option2'>
144
- <optgroup label="Select a <%= p.option2 %>">
145
- <% p.variants.where(:status => 'Active').collect{|v| v.option2}.compact.uniq.sort.each do |v| %>
146
- <option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
147
- <% end %>
148
- </optgroup>
149
- </select>
150
- <br>
151
- <% end %>
152
- <% if p.option3 && p.option3.strip.length > 0 %>
153
- <% default = p.default3 ? p.default3 : p.variants[0].option3 %>
154
- <select name='option3' id='option3'>
155
- <optgroup label="Select a <%= p.option3 %>">
156
- <% p.variants.where(:status => 'Active').collect{|v| v.option3}.reject{|str| str.nil?}.uniq.sort.each do |v| %>
157
- <option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
158
- <% end %>
159
- </optgroup>
160
- </select>
161
- <br>
162
- <% end %>
163
- <span id='variant_qty'></span>
164
- </div>
165
- <div class="span6">
166
- <h4>$<span id="variant_price"><%= p.most_popular_variant.price %></span></h4>
167
- <p id="add_cart_btn"><a href="#" class="btn btn-warning btn-large"><i class="icon-shopping-cart"></i>&nbsp; Add to Cart</a></p>
168
- <p class="btn btn-warning btn-large" id="sold_out_btn" style="display:none;"><i class="icon-shopping-cart"></i>&nbsp; Sold Out</p>
169
- </div>
170
- </div>
171
- <br><br>
172
- <p><%= strip_tags(p.description) %></p>
173
- </div>
174
- </div>
175
-
176
- <div class="row-fluid">
177
- <div class="span12">
178
- <div class="tabbable">
179
- <ul class="nav nav-tabs">
180
- <li class="active"><a href="#tab1" data-toggle="tab">Product Features</a></li>
181
- <li class=""><a href="#tab2" data-toggle="tab">Recent Reviews</a></li>
182
- <li class=""><a href="#tab3" data-toggle="tab">Related Items</a></li>
183
- </ul>
184
- <div class="tab-content">
185
- <div class="tab-pane active" id="tab1">
186
- <p><%= strip_tags(p.description) %></p>
187
- </div>
188
- <div class="tab-pane" id="tab2">
189
- <ul>
190
- <% if @reviews.present? %>
191
- <% @reviews.each do |r| %>
192
- <li class='product-review'>
193
- <% if r.rating && r.rating != 0 %>
194
- <div class="rateit" data-rateit-value="<%= r.rating %>" data-rateit-ispreset="true" data-rateit-readonly="true" style="margin-right:10px;"></div>
195
- <% end %>
196
- <span style="font-weight:bold;"><%= r.name %></span>
197
- <p><%= r.content %></p>
198
- </li>
199
- <%
200
- end # @reviews.each do |r|
201
- %>
202
- <% else %>
203
- <p>No reviews yet.</p>
204
- <%
205
- end # if @reviews.present?
206
- %>
207
- </ul>
208
- <span id="message"></span>
209
- <div id="add-new-review">
210
- <hr style="display:block !important;"/>
211
- Submit Your Review
212
- <br>
213
- <div class="rateit" id="new-rating"></div>
214
- <br>
215
- <form id="new_review">
216
- <textarea name="content" cols="90" rows="3"></textarea>
217
- <input type="hidden" name="product_id" value='<%= p.id %>' />
218
- </form>
219
- <button id="submit_review">Submit</button>
220
- <br>
221
- <br>
222
- </div>
223
- <div id="login-section">
224
- <p>To submit a review, please <a id='login-btn'>log in</a>.</p>
225
- </div>
226
- </div>
227
- <div class="tab-pane" id="tab3">
228
- <div class="row-fluid">
229
- <% if p.related_items && p.related_items.count > 0 %>
230
- <ul class="thumbnails">
231
- <% p.related_items.each do |p2| %>
232
- <li class="span4">
233
- <div class="thumbnail">
234
- <div class="caption-details">
235
- <h5><%= p2.title %></h5>
236
- <span class="price"><%= raw product_price(p2) %></span>
237
- </div>
238
- </div>
239
- </li>
240
- <% end %>
241
- </ul>
242
- <% else %>
243
- <p>This product doesn't have any related items yet.</p>
244
- <% end %>
245
- </div>
246
- </div>
247
- </div>
248
- </div>
249
- </div>
250
- </div>
251
- </div>
252
- <!--break-->
253
- </div>
254
- </div>
255
- </div>
256
-
257
- <%= content_for :caboose_js do %>
258
- <%= javascript_include_tag 'caboose/modules/cart' %>
259
- <%= javascript_include_tag 'caboose/modules/product' %>
260
- <script type='text/javascript'>
261
-
262
- var option1 = <%= raw p.option1 ? p.option1.to_json : false %>;
263
- var option2 = <%= raw p.option2 ? p.option2.to_json : false %>;
264
- var option3 = <%= raw p.option3 ? p.option3.to_json : false %>;
265
- var default1 = <%= raw p.default1 ? p.default1.to_json : false %>;
266
- var default2 = <%= raw p.default2 ? p.default2.to_json : false %>;
267
- var default3 = <%= raw p.default3 ? p.default3.to_json : false %>;
268
- var variants = <%= raw Caboose.json(p.variants) %>;
269
-
270
- var quantities = {};
271
-
272
- function get_variant_for_options()
273
- {
274
- var v1 = option1 ? $('#option1').val() : false;
275
- var v2 = option2 ? $('#option2').val() : false;
276
- var v3 = option3 ? $('#option3').val() : false;
277
-
278
- var variant = false;
279
- $.each(variants, function(i, v) {
280
- if (v.option1 == v1 && (!option2 || (v.option2 == v2 && (!option3 || v.option3 == v3))))
281
- {
282
- variant = v;
283
- return false;
284
- }
285
- });
286
- return variant;
287
- }
288
-
289
- function show_variant_image() {
290
- var v = get_variant_for_options();
291
- if (!v) return;
292
-
293
- var rurl = "/variant-images/" + v.id;
294
- $.ajax({
295
- type: 'get',
296
- url: rurl,
297
- success: function(img) {
298
- if(img) {
299
- var image = "#img_" + img.id;
300
- var thumb = "#thumb_" + img.id;
301
- $(".item").removeClass("active");
302
- $(".thumbnail").removeClass("active");
303
- $(image).addClass("active");
304
- $(thumb).addClass("active");
305
- }
306
- }
307
- });
308
- }
309
-
310
- function set_status()
311
- {
312
- var v = get_variant_for_options();
313
- if (!v || v.quantity_in_stock == 0)
314
- {
315
- $("#variant_qty").html("Sold Out").css("color","red");
316
- $("#add_cart_btn").hide();
317
- $("#sold_out_btn").show();
318
- if (v && v.price > 0) $("#variant_price").html(v.price);
319
- }
320
- else
321
- {
322
- $("#variant_qty").html("In Stock").css("color","green");
323
- $("#add_cart_btn").show();
324
- $("#sold_out_btn").hide();
325
- if (v && v.price > 0) $("#variant_price").html(v.price);
326
- }
327
- }
328
-
329
- function add_to_cart()
330
- {
331
- var v = get_variant_for_options();
332
- if (!v) return;
333
-
334
- $.colorbox({
335
- href: '/cart/add/' + v.id,
336
- iframe: true,
337
- initialWidth: 400,
338
- initialHeight: 200,
339
- innerWidth: 400,
340
- innerHeight: 200,
341
- scrolling: false,
342
- transition: 'fade',
343
- closeButton: false,
344
- onComplete: fix_colorbox,
345
- opacity: 0.50
346
- });
347
- }
348
-
349
- // Added to application footer
350
- //function fix_colorbox() {
351
- // var padding = 21; // 21 is default
352
- // $("#cboxTopLeft" ).css('background', '#111');
353
- // $("#cboxTopRight" ).css('background', '#111');
354
- // $("#cboxBottomLeft" ).css('background', '#111');
355
- // $("#cboxBottomRight" ).css('background', '#111');
356
- // $("#cboxMiddleLeft" ).css('background', '#111');
357
- // $("#cboxMiddleRight" ).css('background', '#111');
358
- // $("#cboxTopCenter" ).css('background', '#111');
359
- // $("#cboxBottomCenter" ).css('background', '#111');
360
- // $("#cboxClose" ).hide();
361
- //
362
- // //var p = (padding-21)*2;
363
- // //$("#cboxWrapper" ).css('padding', '0 ' + p + ' ' + p + ' 0');
364
- // //$('#cboxLoadedContent').css('margin-bottom', 0);
365
- // //h = $('#cboxLoadedContent').height();
366
- // //$('#cboxLoadedContent').css('height', ''+(h+28)+'px');
367
- //}
368
-
369
- $(document).ready(function() {
370
- show_variant_image();
371
- if (option1) $('#option1').change(function() { set_status(); show_variant_image(); });
372
- if (option2) $('#option2').change(function() { set_status(); show_variant_image(); });
373
- if (option3) $('#option3').change(function() { set_status(); show_variant_image(); });
374
- set_status();
375
- $('.zoom-image').each( function() { $(this).easyZoom(); });
376
- $('#add_cart_btn a').click(function(e) {
377
- e.preventDefault();
378
- add_to_cart();
379
- });
380
- });
381
-
382
-
383
- </script>
384
-
385
- <% if @is_logged_in %>
386
- <script type='text/javascript'>
387
- $("#login-section").hide();
388
- $("#submit_review").click( function() {
389
- var info = $("#new_review").serialize();
390
- info += "&rating=" + $("#new-rating").rateit("value") + "&name=" + "<%= @first_name %>" + "+" + "<%= @last_name %>";
391
- $.post("/reviews/add", info, function(data, status) { window.location.reload(true); });
392
- $("#add-new-review").slideUp();
393
- $("#message").html("<p class='note success'>Review added successfully</p>");
394
- });
395
-
396
- </script>
397
-
398
-
399
- <% else %>
400
- <script type='text/javascript'>
401
- $("#add-new-review").hide();
402
- $("#login-btn").click( function() {
403
- open_colorbox();
404
- });
405
-
406
- function open_colorbox() {
407
- $.colorbox({
408
- href: '/login?return_url=/products/<%= p.id %>',
409
- iframe: true,
410
- innerWidth: 200,
411
- innerHeight: 50,
412
- scrolling: false,
413
- transition: 'fade',
414
- closeButton: false,
415
- onComplete: fix_colorbox,
416
- opacity: 0.50,
417
- // onClosed: function() { open_colorbox(); }
418
- });
419
- }
420
-
421
- function fix_colorbox() {
422
- $("#cboxTopLeft" ).css('background', '#111');
423
- $("#cboxTopRight" ).css('background', '#111');
424
- $("#cboxBottomLeft" ).css('background', '#111');
425
- $("#cboxBottomRight" ).css('background', '#111');
426
- $("#cboxMiddleLeft" ).css('background', '#111');
427
- $("#cboxMiddleRight" ).css('background', '#111');
428
- $("#cboxTopCenter" ).css('background', '#111');
429
- $("#cboxBottomCenter" ).css('background', '#111');
430
- $("#cboxClose" ).hide();
431
- }
432
-
433
- </script>
434
- <% end %>
435
-
436
-
437
- <% end %>
438
-
@@ -1,46 +0,0 @@
1
-
2
- <div id="catalogue">
3
- <div class="container">
4
- <div class="row-fluid">
5
- <div class="span12">
6
- <ul class="breadcrumb">
7
- <li><a href="/">Home</a><span class="divider">/</span></li>
8
-
9
- <% @category.ancestry.each do |c| %>
10
- <% if c != @category %>
11
- <li><a href="<%= c.url %>"><%= c.name %></a> <span class="divider">/</span></li>
12
- <% else %>
13
- <li><a href="<%= c.url %>"><%= c.name %></a></li>
14
- <% end %>
15
- <% end %>
16
- </ul>
17
- </div>
18
- </div>
19
-
20
- <div class="row-fluid">
21
- <div class="span12">
22
- <h2><%= @category.name %></h2>
23
- <ul class="thumbs">
24
-
25
- <% if @category.children && @category.children.count > 0 %>
26
- <% @category.children.each do |cat| %>
27
- <% if cat.id != 32 && cat.products != [] %>
28
- <%= render partial: 'category_thumb', locals: {category: cat} %>
29
- <% end %>
30
- <% end %>
31
- <% end %>
32
-
33
- <% if @category.products && @category.products.count > 0 %>
34
- <% @category.products.each do |p| %>
35
- <% if p.status == "Active" && p.variants != [] %>
36
- <%= render partial: 'product_thumb', locals: {product: p} %>
37
- <% end %>
38
- <% end %>
39
- <% end %>
40
-
41
- </ul>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
-
@@ -17,7 +17,8 @@
17
17
  <%= yield :caboose_css %>
18
18
  <% end %>
19
19
  <%
20
- b = @page.block
20
+ b = @page.block
21
+ Caboose.log(@page.block.inspect)
21
22
  if b.nil?
22
23
  bt = Caboose::BlockType.where(:name => 'layout_basic').first
23
24
  Caboose::Block.create(:page_id => @page.id, :block_type_id => bt.id)
@@ -41,28 +42,28 @@
41
42
  }
42
43
 
43
44
  str = nil
44
- if @use_page_cache
45
- pc = Caboose::PageCache.where(:page_id => @page.id).first
46
- if pc # If the page is cached, send it to the user
47
-
48
- require_dependency "#{Caboose.root}/app/models/caboose/block_cache.rb"
49
- require_dependency "#{Caboose.root}/app/models/caboose/block_cache_file.rb"
50
- require_dependency "#{Caboose.root}/app/models/caboose/block_cache_image.rb"
51
-
52
- @block = Marshal.load(pc.block)
53
- @view = options[:view ]
54
- @controller_view_content = options[:controller_view_content ]
55
- @modal = options[:modal ]
56
- @empty_text = options[:empty_text ]
57
- @editing = options[:editing ]
58
- @css = options[:css ]
59
- @js = options[:js ]
60
- @csrf_meta_tags = options[:csrf_meta_tags ]
61
- @csrf_meta_tags2 = options[:csrf_meta_tags2 ]
62
-
63
- str = render(:inline => pc.render_function)
64
- end
65
- end
45
+ #if @use_page_cache
46
+ # pc = Caboose::PageCache.where(:page_id => @page.id).first
47
+ # if pc # If the page is cached, send it to the user
48
+ #
49
+ # require_dependency "#{Caboose.root}/app/models/caboose/block_cache.rb"
50
+ # require_dependency "#{Caboose.root}/app/models/caboose/block_cache_file.rb"
51
+ # require_dependency "#{Caboose.root}/app/models/caboose/block_cache_image.rb"
52
+ #
53
+ # @block = Marshal.load(pc.block)
54
+ # @view = options[:view ]
55
+ # @controller_view_content = options[:controller_view_content ]
56
+ # @modal = options[:modal ]
57
+ # @empty_text = options[:empty_text ]
58
+ # @editing = options[:editing ]
59
+ # @css = options[:css ]
60
+ # @js = options[:js ]
61
+ # @csrf_meta_tags = options[:csrf_meta_tags ]
62
+ # @csrf_meta_tags2 = options[:csrf_meta_tags2 ]
63
+ #
64
+ # str = render(:inline => pc.render_function)
65
+ # end
66
+ #end
66
67
 
67
68
  # Render the blocks if we don't have it cached
68
69
  str = b.render(b, options) if str.nil?
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.53'
2
+ VERSION = '0.5.54'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.53
4
+ version: 0.5.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
@@ -625,6 +625,10 @@ files:
625
625
  - app/views/caboose/blocks/_layout_right_sidebar_footer.html.erb
626
626
  - app/views/caboose/blocks/_layout_right_sidebar_header.html.erb
627
627
  - app/views/caboose/blocks/_layout_right_sidebar_sidebar.html.erb
628
+ - app/views/caboose/blocks/_product_category.html.erb
629
+ - app/views/caboose/blocks/_product_crumbtrail.html.erb
630
+ - app/views/caboose/blocks/_product_details.html.erb
631
+ - app/views/caboose/blocks/_products.html.erb
628
632
  - app/views/caboose/blocks/_render_function.html.erb
629
633
  - app/views/caboose/blocks/_richtext.html.erb
630
634
  - app/views/caboose/blocks/_ruby_block.rb