caboose-cms 0.5.211 → 0.5.212

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
- OGM4NTg5NTU1MDNjYjQ2NGMxN2Q0NTQ0YTkwMWJmNTljMjNhOGRiZQ==
4
+ NmU2ODcxODZiMmY0YzU5N2NhNGZhY2M5NTRmOWNiOTFmNDI5ZTcxNw==
5
5
  data.tar.gz: !binary |-
6
- NjgzYzc5NTVmMjc0ZGQzZTZkMzY1OWYzZjE3ZDdkZWRhY2FlNjQ5Yg==
6
+ YmUyNTI2ODdiZGRmZDZlMTVkODE2MzUwNmFiZTJmZGM2ODgwYjVhYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTE0YmRiNTQzYjgwZGRjYmEzMjI5NWQwY2NkOGMzYTdiNDUwMTRmNmNlMGZk
10
- NDEzYzQzNWM4ZmJkZmUyOTc4MjUwZTI5ZDJiZmNlYjg4MjQ2ZDU4OGYxNmEx
11
- MDVkYmQ2ZWU0NzI4NmVlMmEzNjU1NmY1MjlkMjg0MDc2OGUzMDc=
9
+ NjlkMzA0NTBjNjA3MmZkYTdkNzQxZmY5ZDBhZGRkMmM5ZTMzZjcwMWUxZjVk
10
+ YjBkMzZlZjBkNWI4YTA2NTU2ZTE5NDMwNjM2MmViOTNjNTEyOTMxZjlkYzNi
11
+ NGI4NTgwNGYxMWY1YWRjNmU4NmZiYzYyMzcxZGNlMmIyMjBjNWM=
12
12
  data.tar.gz: !binary |-
13
- NzBkZmY3NTU1YzBjYWZmYzA1NmQ5Y2M3OGExZWVlODdjMmY3MzUyNzZhZWVi
14
- ZDEwZjVlMjZhMGEyMTBmMDE2N2MyMTZkZjIyNWJkNjM5YmQzNTU1MWRlZjI3
15
- NTEzOTFlZThmYzhlZDBiMWU4OWMwNmQzZTg5YTdiZmVlMzg3YzU=
13
+ ZDZlMTljZWU3N2VjNjhkNTUwOGY3YWZkN2Y1ODAyMzU0ZTJlYmJjMDJiYTlh
14
+ NWM4YmIxNmMyMzA1MTUwNjkxOTAyYzdhYjIzZGJhNzU2YWRhNDkzNzc2ZmQ4
15
+ OTY1YjI3MjE0MmZjMjRhM2UxZmI0MGRiYzFmMmY0MzUzZGEzMmY=
@@ -162,52 +162,74 @@ class Caboose::Block < ActiveRecord::Base
162
162
  if site.nil?
163
163
  self.block_message(block, "Error: site variable is nil.")
164
164
  end
165
-
166
- begin
167
- str = view.render(:partial => "../../sites/#{site.name}/blocks/#{full_name}", :locals => options2)
168
- rescue ActionView::MissingTemplate => ex
169
- #Caboose.log("Can't find partial: ../../sites/#{site.name}/blocks/#{full_name}")
170
- begin
171
- str = view.render(:partial => "../../sites/#{site.name}/blocks/#{block.block_type.name}", :locals => options2)
172
- rescue ActionView::MissingTemplate => ex
173
- #Caboose.log("Can't find partial: ../../sites/#{site.name}/blocks/#{block.block_type.name}")
174
- begin
175
- str = view.render(:partial => "../../sites/#{site.name}/blocks/#{block.block_type.field_type}", :locals => options2)
176
- rescue ActionView::MissingTemplate
177
- #Caboose.log("Can't find partial: ../../sites/#{site.name}/blocks/#{block.block_type.field_type}")
178
- begin
179
- str = view.render(:partial => "caboose/blocks/#{full_name}", :locals => options2)
180
- rescue ActionView::MissingTemplate
181
- #Caboose.log("Can't find partial: caboose/blocks/#{full_name}")
182
- begin
183
- str = view.render(:partial => "caboose/blocks/#{block.block_type.name}", :locals => options2)
184
- rescue ActionView::MissingTemplate
185
- #Caboose.log("Can't find partial: caboose/blocks/#{block.block_type.name}")
186
- begin
187
- str = view.render(:partial => "caboose/blocks/#{block.block_type.field_type}", :locals => options2)
188
- rescue Exception => ex
189
- #Caboose.log("Can't find partial: caboose/blocks/#{block.block_type.field_type}")
190
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
191
- end
192
- rescue Exception => ex
193
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
194
- end
195
- rescue Exception => ex
196
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
197
- end
198
- rescue Exception => ex
199
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
200
- end
201
- rescue Exception => ex
202
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
203
- end
204
- rescue Exception => ex
205
- str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
206
- end
165
+
166
+ #begin str = view.render(:partial => "../../sites/#{site.name}/blocks/#{full_name}", :locals => options2)
167
+ #rescue ActionView::MissingTemplate => ex
168
+ # begin str = view.render(:partial => "../../sites/#{site.name}/blocks/#{block.block_type.name}", :locals => options2)
169
+ # rescue ActionView::MissingTemplate => ex
170
+ # begin str = view.render(:partial => "../../sites/#{site.name}/blocks/#{block.block_type.field_type}", :locals => options2)
171
+ # rescue ActionView::MissingTemplate => ex
172
+ # begin str = view.render(:partial => "../../app/views/caboose/blocks/#{full_name}", :locals => options2)
173
+ # rescue ActionView::MissingTemplate => ex
174
+ # begin str = view.render(:partial => "../../app/views/caboose/blocks/#{block.block_type.name}", :locals => options2)
175
+ # rescue ActionView::MissingTemplate => ex
176
+ # begin str = view.render(:partial => "../../app/views/caboose/blocks/#{block.block_type.field_type}", :locals => options2)
177
+ # rescue ActionView::MissingTemplate => ex
178
+ # begin str = view.render(:partial => "caboose/blocks/#{full_name}", :locals => options2)
179
+ # rescue ActionView::MissingTemplate => ex
180
+ # begin str = view.render(:partial => "caboose/blocks/#{block.block_type.name}", :locals => options2)
181
+ # rescue ActionView::MissingTemplate => ex
182
+ # begin str = view.render(:partial => "caboose/blocks/#{block.block_type.field_type}", :locals => options2)
183
+ # rescue Exception => ex
184
+ # str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
185
+ # end
186
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
187
+ # end
188
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
189
+ # end
190
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
191
+ # end
192
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
193
+ # end
194
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
195
+ # end
196
+ # rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
197
+ # end
198
+ #rescue Exception => ex { str = "<p class='note error'>#{self.block_message(block, ex)}</p>" }
199
+ #end
200
+
201
+ arr = [
202
+ "../../sites/#{site.name}/blocks/#{full_name}",
203
+ "../../sites/#{site.name}/blocks/#{block.block_type.name}",
204
+ "../../sites/#{site.name}/blocks/#{block.block_type.field_type}",
205
+ "../../app/views/caboose/blocks/#{full_name}",
206
+ "../../app/views/caboose/blocks/#{block.block_type.name}",
207
+ "../../app/views/caboose/blocks/#{block.block_type.field_type}",
208
+ "caboose/blocks/#{full_name}",
209
+ "caboose/blocks/#{block.block_type.name}",
210
+ "caboose/blocks/#{block.block_type.field_type}"
211
+ ]
212
+ str = self.render_helper(view, options2, block, full_name, arr, 0)
213
+
207
214
  end
208
215
  return str
209
216
  end
210
217
 
218
+ def render_helper(view, options, block, full_name, arr, i)
219
+ return "<p class='note error'>Could not find block view anywhere.</p>" if i > arr.count
220
+ begin
221
+ str = view.render(:partial => arr[i], :locals => options)
222
+ #Caboose.log("Level #{i+1} for #{full_name}: Found partial #{arr[i]}")
223
+ rescue ActionView::MissingTemplate => ex
224
+ #Caboose.log("Level #{i+1} for #{full_name}: #{ex.message}")
225
+ str = render_helper(view, options, block, full_name, arr, i+1)
226
+ rescue Exception => ex
227
+ #Caboose.log("Level #{i+1} for #{full_name}: #{ex.message}")
228
+ str = "<p class='note error'>#{self.block_message(block, ex)}</p>"
229
+ end
230
+ return str
231
+ end
232
+
211
233
  def block_message(block, ex)
212
234
  msg = block ? (block.block_type ? "Error with #{block.block_type.name} block (block_type_id #{block.block_type.id}, block_id #{block.id})\n" : "Error with block (block_id #{block.id})\n") : ''
213
235
  if ex.is_a?(String)
@@ -126,7 +126,7 @@ module Caboose
126
126
  dimensions[2] = dimensions[0] / 2.54
127
127
  end
128
128
 
129
- return ActiveShipping::Package.new(weight, dimensions, :units => :imperial)
129
+ return ActiveShipping::Package.new(weight, dimensions, :units => :imperial, :container => :variable)
130
130
  end
131
131
 
132
132
  end
@@ -50,6 +50,7 @@
50
50
  :logged_in_user => @logged_in_user,
51
51
  :site => @site
52
52
  }
53
+ @block_options.each{ |k,v| options[k] = v } if @block_options
53
54
 
54
55
  str = nil
55
56
  #if @use_page_cache
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.211'
2
+ VERSION = '0.5.212'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.211
4
+ version: 0.5.212
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg