caboose-cms 0.4.54 → 0.4.55
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 +32 -5
- data/app/models/caboose/schema.rb +10 -0
- data/app/views/caboose/blocks/_heading.html.erb +5 -4
- data/app/views/caboose/blocks/_layout_left_sidebar_content.html.erb +7 -1
- data/app/views/caboose/blocks/_render_function.html.erb +1 -1
- data/app/views/layouts/caboose/application.html.erb +2 -1
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2Y1MmRhNWFjNTMxMzUwMzU5YWViNWYxY2Y5ZTlmN2NlOGZiODI4Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGM2ODg1YzRlMjgxNTMzZDE5MjA0OWJlNzFmOWVkYmNhZTdjNTZmYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmJiYjQyZWFlMDNhOTc4YjMyN2YzZjU5MTQyNTM5Y2FhZTMyOTkyMjAxOWYw
|
10
|
+
OTZhZGY2YjA1ZDIxNzIxOGI0ZDAyMjVkZTk1MTA5NTk2MWZjZDA1OTc5NDc5
|
11
|
+
ODE5Nzk0ZDhlNzJmZDlkYzkxNzI5M2JmMDQwY2JlZjQ4Y2IwYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDViZjhjYjcyMjBkNDg3Y2UwMWE0YWVmOTJkMTU3Yzc1OWRiNjgxNjgzYTY1
|
14
|
+
MjkzY2Q3Y2YxNGFiNzJhYTJlNjQ3ZjQ3ZDc1ZmJkYjBiMjZjZDQ1ODlkMDcz
|
15
|
+
YjEwOTk1OTQ3ZjBjNjhhZTliYTg2NTBkYTQ1M2E0ZmVhZmNmYTg=
|
data/app/models/caboose/block.rb
CHANGED
@@ -105,12 +105,36 @@ class Caboose::Block < ActiveRecord::Base
|
|
105
105
|
end
|
106
106
|
str = ""
|
107
107
|
|
108
|
-
defaults = {
|
108
|
+
defaults = {
|
109
|
+
:view => nil,
|
110
|
+
:controller_view_content => nil,
|
111
|
+
:modal => false,
|
112
|
+
:empty_text => '',
|
113
|
+
:editing => false,
|
114
|
+
:css => nil,
|
115
|
+
:js => nil,
|
116
|
+
:csrf_meta_tags => nil,
|
117
|
+
:csrf_meta_tags2 => nil,
|
118
|
+
:logged_in_user => nil
|
119
|
+
}
|
120
|
+
#defaults = { :modal => false, :empty_text => '', :editing => false, :css => nil, :js => nil, :block => block }
|
109
121
|
options2 = nil
|
110
122
|
if options.is_a?(Hash)
|
111
123
|
options2 = defaults.merge(options)
|
112
124
|
else
|
113
|
-
options2 = { :modal => options.modal, :empty_text => options.empty_text, :editing => options.editing, :css => options.css, :js => options.js }
|
125
|
+
#options2 = { :modal => options.modal, :empty_text => options.empty_text, :editing => options.editing, :css => options.css, :js => options.js }
|
126
|
+
options2 = {
|
127
|
+
:view => options.view ? options.view : nil,
|
128
|
+
:controller_view_content => options.controller_view_content ? options.controller_view_content : nil,
|
129
|
+
:modal => options.modal ? options.modal : nil,
|
130
|
+
:empty_text => options.empty_text ? options.empty_text : nil,
|
131
|
+
:editing => options.editing ? options.editing : nil,
|
132
|
+
:css => options.css ? options.css : nil,
|
133
|
+
:js => options.js ? options.js : nil,
|
134
|
+
:csrf_meta_tags => options.csrf_meta_tags ? options.csrf_meta_tags : nil,
|
135
|
+
:csrf_meta_tags2 => options.csrf_meta_tags2 ? options.csrf_meta_tags2 : nil,
|
136
|
+
:logged_in_user => options.logged_in_user ? options.logged_in_user : nil
|
137
|
+
}
|
114
138
|
end
|
115
139
|
options2[:block] = block
|
116
140
|
|
@@ -141,13 +165,16 @@ class Caboose::Block < ActiveRecord::Base
|
|
141
165
|
begin
|
142
166
|
str = view.render(:partial => "caboose/blocks/#{block.block_type.field_type}", :locals => options2)
|
143
167
|
rescue Exception => ex
|
144
|
-
|
168
|
+
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") : ''
|
169
|
+
Caboose.log("#{msg}#{ex.message}\n#{ex.backtrace.join("\n")}")
|
145
170
|
end
|
146
171
|
rescue Exception => ex
|
147
|
-
|
172
|
+
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") : ''
|
173
|
+
Caboose.log("#{msg}#{ex.message}\n#{ex.backtrace.join("\n")}")
|
148
174
|
end
|
149
175
|
rescue Exception => ex
|
150
|
-
|
176
|
+
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") : ''
|
177
|
+
Caboose.log("#{msg}#{ex.message}\n#{ex.backtrace.join("\n")}")
|
151
178
|
end
|
152
179
|
end
|
153
180
|
return str
|
@@ -218,6 +218,16 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
218
218
|
[ :user_id , :integer ],
|
219
219
|
[ :role , :string ]
|
220
220
|
],
|
221
|
+
Caboose::SmtpConfig => [
|
222
|
+
[ :site_id , :integer ],
|
223
|
+
[ :address , :string , { :default => 'localhost' }],
|
224
|
+
[ :port , :integer , { :default => 25 }],
|
225
|
+
[ :domain , :string ],
|
226
|
+
[ :user_name , :string ],
|
227
|
+
[ :password , :string ],
|
228
|
+
[ :authentication , :string ], # :plain, :login, :cram_md5.
|
229
|
+
[ :enable_starttls_auto , :boolean , { :default => true }]
|
230
|
+
],
|
221
231
|
Caboose::Timezone => [
|
222
232
|
[ :country_code , :string ],
|
223
233
|
[ :name , :string ]
|
@@ -1,8 +1,9 @@
|
|
1
1
|
<%
|
2
|
-
size = block.
|
3
|
-
text = block.
|
2
|
+
size = block.child_value('size')
|
3
|
+
text = block.child_value('text')
|
4
|
+
style = block.child_value('style')
|
4
5
|
size = 1 if size.nil?
|
5
6
|
text = (empty_text ? empty_text : "") if text.nil? || text == ""
|
6
7
|
|
7
|
-
if editing %><div id='block_<%= block.id %>'><h<%= size
|
8
|
-
else %><h<%= size %> id='block_<%= block.id %>'><%= raw text %></h<%= size %>><% end %>
|
8
|
+
if editing %><div id='block_<%= block.id %>'><h<%= size %> style='<%= style %>'><%= raw text %></h<%= size %>></div><%
|
9
|
+
else %><h<%= size %> id='block_<%= block.id %>' style='<%= style %>'><%= raw text %></h<%= size %>><% end %>
|
@@ -1,7 +1,13 @@
|
|
1
1
|
<div class="content_wrapper" id='block_<%= block.id %>'>
|
2
2
|
<div class="content_body">
|
3
3
|
<% if editing %><div class='sortable'><% end %>
|
4
|
-
<% block.children.each do |b|
|
4
|
+
<% block.children.each do |b| %>
|
5
|
+
<%
|
6
|
+
#msg = b ? (b.block_type ? "#{b.block_type.name} block (block_type_id #{b.block_type.id}, block_id #{b.id})\n" : "Block (block_id #{b.id})\n") : ''
|
7
|
+
#Caboose.log(msg)
|
8
|
+
%>
|
9
|
+
<%= raw block.render(b, local_assigns) %>
|
10
|
+
<% end %>
|
5
11
|
<% if editing %></div><% end %>
|
6
12
|
</div>
|
7
13
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
<%= raw ERB.new(block.block_type.render_function).result(self.instance_eval { binding }) %>
|
@@ -31,11 +31,12 @@
|
|
31
31
|
:css => '|CABOOSE_CSS|',
|
32
32
|
:js => '|CABOOSE_JAVASCRIPT|',
|
33
33
|
:csrf_meta_tags => '|CABOOSE_CSRF|',
|
34
|
+
:csrf_meta_tags2 => '|CABOOSE_CSRF|',
|
34
35
|
:logged_in_user => @logged_in_user
|
35
36
|
})
|
36
37
|
str.gsub!('|CABOOSE_CSS|' , yield(:css))
|
37
38
|
str.gsub!('|CABOOSE_JAVASCRIPT|' , yield(:js))
|
38
|
-
str.gsub!('|CABOOSE_CSRF|' , csrf_meta_tags)
|
39
|
+
str.gsub!('|CABOOSE_CSRF|' , csrf_meta_tags)
|
39
40
|
|
40
41
|
%><%= raw str %><%
|
41
42
|
|
data/lib/caboose/version.rb
CHANGED