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 +8 -8
- data/app/models/caboose/block.rb +64 -42
- data/app/models/caboose/order_package.rb +1 -1
- data/app/views/layouts/caboose/application.html.erb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmU2ODcxODZiMmY0YzU5N2NhNGZhY2M5NTRmOWNiOTFmNDI5ZTcxNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmUyNTI2ODdiZGRmZDZlMTVkODE2MzUwNmFiZTJmZGM2ODgwYjVhYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjlkMzA0NTBjNjA3MmZkYTdkNzQxZmY5ZDBhZGRkMmM5ZTMzZjcwMWUxZjVk
|
10
|
+
YjBkMzZlZjBkNWI4YTA2NTU2ZTE5NDMwNjM2MmViOTNjNTEyOTMxZjlkYzNi
|
11
|
+
NGI4NTgwNGYxMWY1YWRjNmU4NmZiYzYyMzcxZGNlMmIyMjBjNWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDZlMTljZWU3N2VjNjhkNTUwOGY3YWZkN2Y1ODAyMzU0ZTJlYmJjMDJiYTlh
|
14
|
+
NWM4YmIxNmMyMzA1MTUwNjkxOTAyYzdhYjIzZGJhNzU2YWRhNDkzNzc2ZmQ4
|
15
|
+
OTY1YjI3MjE0MmZjMjRhM2UxZmI0MGRiYzFmMmY0MzUzZGEzMmY=
|
data/app/models/caboose/block.rb
CHANGED
@@ -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
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
begin
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
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
|
data/lib/caboose/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|