caboose-cms 0.9.228 → 0.9.229
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/admin.js +1 -1
- data/app/assets/javascripts/caboose/admin_main.js +1 -13
- data/app/assets/javascripts/caboose/admin_media_index.js +161 -158
- data/app/assets/javascripts/caboose/application.js +8 -7
- data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +60 -4
- data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +3 -2
- data/app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js +17 -6
- data/app/assets/javascripts/caboose/model/all.js +5 -1
- data/app/assets/stylesheets/caboose/admin_block_edit_image.css.scss +2 -1
- data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +71 -15
- data/app/assets/stylesheets/caboose/admin_main.css.scss +25 -29
- data/app/assets/stylesheets/caboose/admin_media_index.css.scss +26 -5
- data/app/assets/stylesheets/caboose/application.css +11 -5
- data/app/assets/stylesheets/caboose/login.scss +1 -0
- data/app/assets/stylesheets/caboose/model_binder.css +13 -4
- data/app/assets/stylesheets/caboose/page_bar_generator.css +2 -1
- data/app/controllers/caboose/admin_controller.rb +3 -4
- data/app/controllers/caboose/application_controller.rb +16 -19
- data/app/controllers/caboose/block_types_controller.rb +8 -6
- data/app/controllers/caboose/cart_controller.rb +2 -2
- data/app/controllers/caboose/change_logs_controller.rb +13 -0
- data/app/controllers/caboose/fonts_controller.rb +139 -2
- data/app/controllers/caboose/invoices_controller.rb +5 -4
- data/app/controllers/caboose/login_logs_controller.rb +5 -7
- data/app/controllers/caboose/media_categories_controller.rb +16 -2
- data/app/controllers/caboose/media_controller.rb +14 -11
- data/app/controllers/caboose/pages_controller.rb +104 -42
- data/app/controllers/caboose/posts_controller.rb +53 -7
- data/app/controllers/caboose/products_controller.rb +1 -1
- data/app/controllers/caboose/sites_controller.rb +25 -6
- data/app/controllers/caboose/sns_controller.rb +3 -3
- data/app/controllers/caboose/themes_controller.rb +30 -0
- data/app/controllers/caboose/users_controller.rb +17 -10
- data/app/controllers/caboose/variants_controller.rb +9 -9
- data/app/models/caboose/block.rb +98 -22
- data/app/models/caboose/block_type.rb +2 -1
- data/app/models/caboose/block_type_parser.rb +1 -1
- data/app/models/caboose/calendar_event_group.rb +2 -2
- data/app/models/caboose/change_log.rb +97 -0
- data/app/models/caboose/core_plugin.rb +4 -3
- data/app/models/caboose/font.rb +7 -2
- data/app/models/caboose/font_variant.rb +12 -0
- data/app/models/caboose/media.rb +15 -4
- data/app/models/caboose/media_category.rb +2 -4
- data/app/models/caboose/page.rb +316 -45
- data/app/models/caboose/page_bar_generator.rb +20 -10
- data/app/models/caboose/post.rb +108 -8
- data/app/models/caboose/product.rb +1 -1
- data/app/models/caboose/role.rb +2 -2
- data/app/models/caboose/schema.rb +73 -72
- data/app/models/caboose/site.rb +203 -1
- data/app/models/caboose/theme.rb +70 -5
- data/app/views/caboose/block_types/admin_edit.html.erb +6 -8
- data/app/views/caboose/blocks/_cached_block.html.erb +28 -0
- data/app/views/caboose/blocks/_file.html.erb +2 -2
- data/app/views/caboose/blocks/_ga.html.erb +1 -2
- data/app/views/caboose/blocks/_image.html.erb +4 -0
- data/app/views/caboose/blocks/_render_function.html.erb +9 -4
- data/app/views/caboose/change_logs/admin_index.html.erb +65 -0
- data/app/views/caboose/fonts/admin_family_edit.html.erb +63 -0
- data/app/views/caboose/fonts/admin_family_index.html.erb +42 -0
- data/app/views/caboose/fonts/admin_index.html.erb +55 -10
- data/app/views/caboose/fonts/admin_variant_edit.html.erb +84 -0
- data/app/views/caboose/invoices_mailer/customer_status_updated.html.erb +5 -14
- data/app/views/caboose/login_logs/admin_index_for_user.html.erb +1 -1
- data/app/views/caboose/media/admin_index.html.erb +14 -24
- data/app/views/caboose/my_account/index.html.erb +1 -0
- data/app/views/caboose/pages/_admin_header.html.erb +5 -0
- data/app/views/caboose/pages/admin_change_logs.html.erb +56 -0
- data/app/views/caboose/pages/admin_edit_content.html.erb +6 -2
- data/app/views/caboose/pages/admin_edit_general.html.erb +32 -4
- data/app/views/caboose/pages/compiled_asset.css.erb +0 -0
- data/app/views/caboose/pages/compiled_asset.js.erb +0 -0
- data/app/views/caboose/posts/_admin_header.html.erb +5 -0
- data/app/views/caboose/posts/admin_change_logs.html.erb +56 -0
- data/app/views/caboose/posts/admin_delete_form.html.erb +1 -1
- data/app/views/caboose/posts/admin_edit_content.html.erb +6 -2
- data/app/views/caboose/products/admin_group_variants.html.erb +1 -1
- data/app/views/caboose/products/admin_sort.html copy.erb +1 -1
- data/app/views/caboose/sites/admin_edit.html.erb +21 -0
- data/app/views/caboose/sites/compiled_asset.css.erb +0 -0
- data/app/views/caboose/sites/compiled_asset.js.erb +0 -0
- data/app/views/caboose/themes/admin_edit.html.erb +7 -3
- data/app/views/caboose/themes/admin_error_log.html.erb +9 -0
- data/app/views/caboose/themes/admin_js.html.erb +131 -0
- data/app/views/caboose/users/_admin_header.html.erb +4 -0
- data/app/views/caboose/users/admin_change_logs.html.erb +63 -0
- data/app/views/caboose/users/admin_edit_roles.html.erb +1 -0
- data/app/views/caboose/variants/admin_group.html.erb +1 -1
- data/app/views/layouts/caboose/admin.html.erb +9 -2
- data/app/views/layouts/caboose/application.html.erb +62 -92
- data/app/views/layouts/caboose/css.css.erb +44 -0
- data/app/views/layouts/caboose/footer_css.css.erb +41 -0
- data/app/views/layouts/caboose/footer_js.js.erb +31 -0
- data/app/views/layouts/caboose/js.js.erb +34 -0
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +3 -14
- metadata +23 -27
- data/app/controllers/caboose/assets_controller.rb +0 -65
- data/app/models/caboose/asset.rb +0 -23
- data/app/models/caboose/asset_manifest.rb +0 -91
- data/app/models/caboose/block_cache.rb +0 -105
- data/app/models/caboose/block_cache_file.rb +0 -22
- data/app/models/caboose/block_cache_image.rb +0 -53
- data/app/models/caboose/page_cache.rb +0 -12
- data/app/models/caboose/page_cacher.rb +0 -137
- data/app/views/caboose/pages/admin_new_old.html.erb +0 -46
- data/app/views/caboose/pages/test.html.erb +0 -64
@@ -21,13 +21,15 @@ module Caboose
|
|
21
21
|
# itemsPerPage: Number of items you want to show per page. Defaults to 10 if not present.
|
22
22
|
# page: Current page number. Defaults to 0 if not present.
|
23
23
|
#
|
24
|
-
attr_accessor :original_params, :params, :options, :custom_url_vars, :post_get
|
24
|
+
attr_accessor :original_params, :params, :options, :custom_url_vars, :post_get, :use_game, :game_id
|
25
25
|
|
26
26
|
#def initialize(post_get, params = nil, options = nil, &custom_url_vars = nil)
|
27
27
|
def initialize(post_get, params = nil, options = nil)
|
28
28
|
|
29
29
|
params = {} if params.nil?
|
30
30
|
options = {} if options.nil?
|
31
|
+
@use_game = false
|
32
|
+
@game_id = 0
|
31
33
|
|
32
34
|
# Note: a few keys are required:
|
33
35
|
# base_url, page, itemCount, itemsPerPage
|
@@ -51,19 +53,22 @@ module Caboose
|
|
51
53
|
# search_field_2 => [association_name, join_table, column_name]
|
52
54
|
# }
|
53
55
|
}
|
56
|
+
|
54
57
|
params.each do |key, val|
|
55
58
|
@original_params[key] = val
|
56
59
|
@params[key] = val
|
57
60
|
end
|
61
|
+
|
62
|
+
if @post_get['game_id'] && !@post_get['game_id'].blank?
|
63
|
+
@use_game = true
|
64
|
+
@game_id = @post_get['game_id']
|
65
|
+
end
|
66
|
+
|
58
67
|
options.each { |key, val| @options[key] = val }
|
59
68
|
|
60
|
-
#@params.each { |key, val|
|
61
|
-
# k = @options['abbreviations'].include?(key) ? @options['abbreviations'][key] : nil
|
62
|
-
# @params[key] = post_get[key].nil? ? (k && !post_get[k].nil? ? post_get[k] : val) : post_get[key]
|
63
|
-
#}
|
64
|
-
|
65
69
|
new_params = {}
|
66
70
|
keys_to_delete = []
|
71
|
+
|
67
72
|
@params.each { |key, val|
|
68
73
|
next if !@options['abbreviations'].has_key?(key)
|
69
74
|
long_key = @options['abbreviations'][key]
|
@@ -72,9 +77,11 @@ module Caboose
|
|
72
77
|
}
|
73
78
|
keys_to_delete.each { |k| @params.delete(k) }
|
74
79
|
new_params.each { |k,v| @params[k] = v }
|
75
|
-
@original_params.each { |k,v| @original_params[k] = post_get[k] ? post_get[k] : v }
|
80
|
+
@original_params.each { |k,v| @original_params[k] = post_get[k] ? post_get[k] : v }
|
81
|
+
|
76
82
|
@params.each { |k,v| @params[k] = post_get[k] ? post_get[k] : v }
|
77
|
-
@options.each { |k,v| @options[k] = ok(post_get[k]) ? post_get[k] : v }
|
83
|
+
@options.each { |k,v| @options[k] = ok(post_get[k]) ? post_get[k] : v }
|
84
|
+
|
78
85
|
#@custom_url_vars = custom_url_vars if !custom_url_vars.nil?
|
79
86
|
@use_url_params = @options['use_url_params'].nil? ? Caboose.use_url_params : @options['use_url_params']
|
80
87
|
|
@@ -241,9 +248,9 @@ module Caboose
|
|
241
248
|
if !@custom_url_vars.nil?
|
242
249
|
return @custom_url_vars.call @options['base_url'], @params
|
243
250
|
end
|
244
|
-
|
251
|
+
|
245
252
|
vars = []
|
246
|
-
@original_params.each do |k,v|
|
253
|
+
@original_params.each do |k,v|
|
247
254
|
next if @options['skip'].include?(k)
|
248
255
|
k = @options['abbreviations'].include?(k) ? @options['abbreviations'][k] : k
|
249
256
|
if v.kind_of?(Array)
|
@@ -263,6 +270,9 @@ module Caboose
|
|
263
270
|
end
|
264
271
|
end
|
265
272
|
end
|
273
|
+
if @use_game
|
274
|
+
vars.push("game_id=#{@game_id}")
|
275
|
+
end
|
266
276
|
if @use_url_params
|
267
277
|
vars.push("sort/#{@options['sort']}")
|
268
278
|
vars.push("desc/#{@options['desc']}")
|
data/app/models/caboose/post.rb
CHANGED
@@ -18,8 +18,7 @@ class Caboose::Post < ActiveRecord::Base
|
|
18
18
|
:image_url ,
|
19
19
|
:published ,
|
20
20
|
:created_at ,
|
21
|
-
:updated_at
|
22
|
-
:status
|
21
|
+
:updated_at
|
23
22
|
|
24
23
|
has_attached_file :image,
|
25
24
|
:path => ':caboose_prefixposts/:id_:style.:extension',
|
@@ -49,9 +48,96 @@ class Caboose::Post < ActiveRecord::Base
|
|
49
48
|
Caboose::Block.where(:post_id => self.id).where('status != ?','published').count == 0 if !self.id.nil?
|
50
49
|
end
|
51
50
|
|
52
|
-
|
51
|
+
# Returns an array of block IDs for all descendant blocks of the homepage footer
|
52
|
+
def self.home_page_footer_block_ids(post)
|
53
|
+
home_page = Caboose::Page.index_page(post.site_id)
|
54
|
+
home_footer = home_page ? home_page.block.child('footer') : nil
|
55
|
+
if home_footer
|
56
|
+
footer_ids = [home_footer.id]
|
57
|
+
home_footer.children.where("name is null").each do |f1|
|
58
|
+
footer_ids << f1.id
|
59
|
+
f1.children.where("name is null").each do |f2|
|
60
|
+
footer_ids << f2.id
|
61
|
+
f2.children.where("name is null").each do |f3|
|
62
|
+
footer_ids << f3.id
|
63
|
+
f3.children.where("name is null").each do |f4|
|
64
|
+
footer_ids << f4.id
|
65
|
+
f4.children.where("name is null").each do |f5|
|
66
|
+
footer_ids << f5.id
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
return footer_ids
|
73
|
+
else
|
74
|
+
return [0]
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def update_cached_blocks(block_ids)
|
79
|
+
blocks = block_ids && block_ids.count > 0 ? Caboose::Block.where("id in (?)", block_ids).order(:id).all : []
|
80
|
+
blocks.each do |b|
|
81
|
+
b.use_cache = false
|
82
|
+
b.save
|
83
|
+
b.delay(:queue => 'caching', :priority => 6).update_cache
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def cached_css
|
88
|
+
str = ''
|
89
|
+
return str if self.site.nil? || !self.site.use_caching
|
90
|
+
footer_ids = Caboose::Post.home_page_footer_block_ids(self)
|
91
|
+
blocks = Caboose::Block.includes(:block_type).where("blocks.post_id = ? OR blocks.parent_id in (?)",self.id,footer_ids).where("blocks.cached_css IS NOT NULL").where("block_types.is_dynamic = false").all
|
92
|
+
blocks.each do |b|
|
93
|
+
str << b.cached_css
|
94
|
+
end
|
95
|
+
return str.blank? ? '' : str.gsub(/<\/style>(\s*)<style>/,'')
|
96
|
+
end
|
97
|
+
|
98
|
+
def cached_js
|
99
|
+
str = ''
|
100
|
+
return str if self.site.nil? || !self.site.use_caching
|
101
|
+
footer_ids = Caboose::Post.home_page_footer_block_ids(self)
|
102
|
+
blocks = Caboose::Block.includes(:block_type).where("blocks.post_id = ? OR blocks.parent_id in (?)",self.id,footer_ids).where("blocks.cached_js IS NOT NULL").where("block_types.is_dynamic = false").all
|
103
|
+
blocks.each do |b|
|
104
|
+
str << b.cached_js
|
105
|
+
end
|
106
|
+
return str
|
107
|
+
end
|
108
|
+
|
109
|
+
def publish(user_id)
|
53
110
|
if !self.id.nil?
|
111
|
+
use_caching = self.site.use_caching
|
112
|
+
changed_ids = []
|
54
113
|
Caboose::Block.where(:post_id => self.id).where('status = ? OR status = ?','edited','added').all.each do |b|
|
114
|
+
if self.site && self.site.use_change_logs
|
115
|
+
if b.new_parent_id.blank? && b.new_value.blank? && b.sort_order == b.new_sort_order && b.status == 'edited'
|
116
|
+
# This one just got moved because something else was added
|
117
|
+
else
|
118
|
+
cl = Caboose::ChangeLog.create(:site_id => self.site_id, :user_id => user_id, :post_id => self.id, :block_id => b.id, :block_parent_id => b.parent_id, :timestamp => DateTime.now, :action => b.status)
|
119
|
+
desc = ""
|
120
|
+
desc += b.parent.parent.block_type.description + " -> " if b.parent && b.parent.parent && b.parent.parent.block_type && b.parent.parent.block_type.description != "Content" && !b.parent.parent.block_type.name.include?('layout')
|
121
|
+
pos = b.parent && b.parent.block_type && b.parent.block_type.name == 'flex_grid_unit' ? b.parent.sort_order + 1 : nil
|
122
|
+
desc += b.parent.block_type.description + " #{pos} -> " if b.parent && b.parent.block_type && b.parent.block_type.description != "Content" && !b.parent.block_type.name.include?('layout')
|
123
|
+
desc += b.block_type.description if b.block_type
|
124
|
+
cl.description = desc
|
125
|
+
cl.is_field = true if !b.name.blank?
|
126
|
+
ov = ['page','page_id'].include?(b.name) ? Caboose::Page.title_for_id(b.value) : b.value
|
127
|
+
nv = ['page','page_id'].include?(b.name) ? Caboose::Page.title_for_id(b.new_value) : b.new_value
|
128
|
+
if b.new_value.blank? && !b.new_media_id.blank?
|
129
|
+
ov = Caboose::Media.title_for_id(b.media_id)
|
130
|
+
nv = Caboose::Media.title_for_id(b.new_media_id)
|
131
|
+
end
|
132
|
+
cl.old_value = ov
|
133
|
+
cl.new_value = nv
|
134
|
+
cl.old_sort_order = b.sort_order
|
135
|
+
cl.new_sort_order = b.new_sort_order
|
136
|
+
cl.old_parent_id = b.parent_id
|
137
|
+
cl.new_parent_id = b.new_parent_id
|
138
|
+
cl.save
|
139
|
+
end
|
140
|
+
end
|
55
141
|
if b.new_value == 'EMPTY'
|
56
142
|
b.value = nil
|
57
143
|
elsif !b.new_value.blank?
|
@@ -67,16 +153,32 @@ class Caboose::Post < ActiveRecord::Base
|
|
67
153
|
b.status = 'published'
|
68
154
|
b.new_value = nil
|
69
155
|
b.new_media_id = nil
|
70
|
-
b.new_sort_order =
|
156
|
+
b.new_sort_order = b.sort_order
|
71
157
|
b.new_parent_id = nil
|
72
158
|
b.save
|
159
|
+
# Update cached value for the closest cached ancestor of this block
|
160
|
+
changed_ids << b.cached_ancestor if use_caching
|
161
|
+
end
|
162
|
+
if use_caching # Catch published blocks that have never been cached before
|
163
|
+
content = self.block.child('content')
|
164
|
+
Caboose::Block.includes(:block_type).where(:parent_id => content.id, :status => 'published', :cached_value => nil, :name => nil).where("block_types.is_dynamic = false").all.each do |b|
|
165
|
+
changed_ids << b.cached_ancestor
|
166
|
+
end
|
73
167
|
end
|
74
168
|
deleted_blocks = Caboose::Block.where(:post_id => self.id, :status => 'deleted').pluck(:id)
|
75
169
|
dids = deleted_blocks.blank? ? 0 : deleted_blocks
|
170
|
+
if self.site && self.site.use_change_logs
|
171
|
+
Caboose::Block.where("id in (?)",dids).all.each do |b|
|
172
|
+
cl = Caboose::ChangeLog.create(:site_id => self.site_id, :user_id => user_id, :post_id => self.id, :block_id => b.id, :block_parent_id => b.parent_id, :timestamp => DateTime.now, :action => 'deleted')
|
173
|
+
cl.old_value = b.new_value.blank? ? b.value : b.new_value
|
174
|
+
cl.description = b.block_type.description if b.block_type
|
175
|
+
cl.is_field = true if !b.name.blank?
|
176
|
+
cl.save
|
177
|
+
end
|
178
|
+
end
|
76
179
|
Caboose::Block.where("id in (?) or parent_id in (?)",dids,dids).destroy_all
|
77
180
|
Caboose::Block.where(:post_id => self.id, :status => nil).update_all(:status => 'published')
|
78
|
-
self.
|
79
|
-
self.save
|
181
|
+
self.update_cached_blocks(changed_ids) if use_caching
|
80
182
|
end
|
81
183
|
end
|
82
184
|
|
@@ -84,8 +186,6 @@ class Caboose::Post < ActiveRecord::Base
|
|
84
186
|
if !self.id.nil?
|
85
187
|
Caboose::Block.where(:post_id => self.id).where(:status => 'added').destroy_all
|
86
188
|
Caboose::Block.where(:post_id => self.id).update_all("status = 'published', new_value = null, new_media_id = null, new_sort_order = sort_order, new_parent_id = null")
|
87
|
-
self.status = 'published'
|
88
|
-
self.save
|
89
189
|
end
|
90
190
|
end
|
91
191
|
|
data/app/models/caboose/role.rb
CHANGED
@@ -43,10 +43,10 @@ class Caboose::Role < ActiveRecord::Base
|
|
43
43
|
|
44
44
|
def is_allowed(resource, action)
|
45
45
|
# Check for the admin permission
|
46
|
+
exc = ["theme","site_settings"] # Excluded resources for ALL permission - must be specifically designated
|
46
47
|
for perm in permissions
|
47
|
-
return true if (perm.resource == "all" && perm.action == "all")
|
48
|
+
return true if (perm.resource == "all" && perm.action == "all" && !exc.include?(resource))
|
48
49
|
end
|
49
|
-
|
50
50
|
if (resource.is_a?(Caboose::Page))
|
51
51
|
for perm in page_permissions
|
52
52
|
return true if (perm.page_id == resource.id && perm.action == action)
|
@@ -6,8 +6,6 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
6
6
|
{
|
7
7
|
:roles_users => :role_memberships,
|
8
8
|
:permissions_roles => :role_permissions,
|
9
|
-
#:page_block_field_values => :fields,
|
10
|
-
#:page_block_fields => :field_types,
|
11
9
|
:page_block_types => :block_types,
|
12
10
|
:page_blocks => :blocks,
|
13
11
|
:store_order_discounts => :store_invoice_discounts,
|
@@ -90,8 +88,9 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
90
88
|
:decremented ,
|
91
89
|
:user_subscription_id
|
92
90
|
],
|
93
|
-
#Caboose::PageCache => [:block],
|
94
91
|
#Caboose::RetargetingConfig => [:fb_pixels_function],
|
92
|
+
Caboose::Page => [:content_format, :linked_resources, :layout, :status],
|
93
|
+
Caboose::Post => [:hide, :image_url, :status],
|
95
94
|
Caboose::ShippingPackage => [:price, :carrier, :service_code, :service_name, :shipping_method_id, :length, :width, :height],
|
96
95
|
Caboose::Site => [:shipping_cost_function],
|
97
96
|
Caboose::StoreConfig => [:use_usps, :allowed_shipping_codes, :default_shipping_code, :pp_relay_url, :pp_response_url],
|
@@ -146,15 +145,6 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
146
145
|
[ :country , :string ],
|
147
146
|
[ :country_code , :string ],
|
148
147
|
[ :phone , :string ]
|
149
|
-
],
|
150
|
-
Caboose::Asset => [
|
151
|
-
[ :page_id , :integer ],
|
152
|
-
[ :user_id , :integer ],
|
153
|
-
[ :date_uploaded , :datetime ],
|
154
|
-
[ :name , :string ],
|
155
|
-
[ :filename , :string ],
|
156
|
-
[ :description , :string ],
|
157
|
-
[ :extension , :string ]
|
158
148
|
],
|
159
149
|
Caboose::Block => [
|
160
150
|
[ :page_id , :integer ],
|
@@ -175,7 +165,11 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
175
165
|
[ :new_parent_id, :integer ],
|
176
166
|
[ :new_sort_order, :integer ],
|
177
167
|
[ :new_value, :text ],
|
178
|
-
[ :new_media_id , :integer ]
|
168
|
+
[ :new_media_id , :integer ],
|
169
|
+
[ :cached_value, :text ],
|
170
|
+
[ :cached_css, :text ],
|
171
|
+
[ :cached_js, :text ],
|
172
|
+
[ :use_cache, :boolean , { :default => false }]
|
179
173
|
],
|
180
174
|
Caboose::BlockType => [
|
181
175
|
[ :parent_id , :integer ],
|
@@ -204,7 +198,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
204
198
|
[ :default_included , :boolean , { :default => false }],
|
205
199
|
[ :default_full_width , :boolean , { :default => false }],
|
206
200
|
[ :share , :boolean , { :default => true }],
|
207
|
-
[ :downloaded , :boolean , { :default => false }]
|
201
|
+
[ :downloaded , :boolean , { :default => false }],
|
202
|
+
[ :is_dynamic, :boolean , { :default => false }]
|
208
203
|
],
|
209
204
|
Caboose::BlockTypeSiteMembership => [
|
210
205
|
[ :site_id , :integer ],
|
@@ -288,6 +283,25 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
288
283
|
[ :product_id , :integer ],
|
289
284
|
[ :sort_order , :integer , { :default => 0 }]
|
290
285
|
],
|
286
|
+
Caboose::ChangeLog => [
|
287
|
+
[ :site_id, :integer ],
|
288
|
+
[ :page_id, :integer ],
|
289
|
+
[ :post_id, :integer ],
|
290
|
+
[ :block_id, :integer ],
|
291
|
+
[ :media_id, :integer ],
|
292
|
+
[ :user_id, :integer ],
|
293
|
+
[ :description, :string ],
|
294
|
+
[ :action, :string ],
|
295
|
+
[ :timestamp, :datetime ],
|
296
|
+
[ :old_value, :text ],
|
297
|
+
[ :new_value, :text ],
|
298
|
+
[ :old_parent_id, :integer ],
|
299
|
+
[ :new_parent_id, :integer ],
|
300
|
+
[ :old_sort_order, :integer ],
|
301
|
+
[ :new_sort_order, :integer ],
|
302
|
+
[ :is_field, :boolean , { :default => false }],
|
303
|
+
[ :block_parent_id, :integer ]
|
304
|
+
],
|
291
305
|
Caboose::CustomizationMembership => [
|
292
306
|
[ :product_id , :integer ],
|
293
307
|
[ :customization_id , :integer ]
|
@@ -325,7 +339,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
325
339
|
[ :name , :string ],
|
326
340
|
[ :family , :string ],
|
327
341
|
[ :variant , :string ],
|
328
|
-
[ :url , :string ]
|
342
|
+
[ :url , :string ],
|
343
|
+
[ :variant_id , :integer ]
|
329
344
|
],
|
330
345
|
Caboose::FontFamily => [
|
331
346
|
[ :name , :string ]
|
@@ -336,7 +351,9 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
336
351
|
[ :ttf_url , :string ],
|
337
352
|
[ :weight , :string ],
|
338
353
|
[ :style , :string ],
|
339
|
-
[ :sort_order , :integer ]
|
354
|
+
[ :sort_order , :integer ],
|
355
|
+
[ :ttf_file , :attachment ],
|
356
|
+
[ :woff_file , :attachment ]
|
340
357
|
],
|
341
358
|
Caboose::FormSubmission => [
|
342
359
|
[ :site_id, :integer ],
|
@@ -478,7 +495,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
478
495
|
[ :original_name , :string ],
|
479
496
|
[ :image , :attachment ],
|
480
497
|
[ :file , :attachment ],
|
481
|
-
[ :processed , :boolean , { :default => false }]
|
498
|
+
[ :processed , :boolean , { :default => false }],
|
499
|
+
[ :deleted , :boolean , { :default => false }]
|
482
500
|
],
|
483
501
|
Caboose::Modification => [
|
484
502
|
[ :product_id , :integer ],
|
@@ -569,24 +587,6 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
569
587
|
[ :gift_message , :text ],
|
570
588
|
[ :include_receipt , :boolean , { :default => true }],
|
571
589
|
[ :instore_pickup , :boolean , { :default => false }]
|
572
|
-
|
573
|
-
#[ :email , :string ],
|
574
|
-
#[ :invoice_number , :string ],
|
575
|
-
#[ :payment_id , :integer ],
|
576
|
-
#[ :gateway_id , :integer ],
|
577
|
-
#[ :date_authorized , :datetime ],
|
578
|
-
#[ :date_captured , :datetime ],
|
579
|
-
#[ :date_cancelled , :datetime ],
|
580
|
-
#[ :shipping_carrier , :string ],
|
581
|
-
#[ :shipping_service_code , :string ],
|
582
|
-
#[ :shipping_service_name , :string ],
|
583
|
-
#[ :transaction_id , :string ],
|
584
|
-
#[ :transaction_id , :string ],
|
585
|
-
#[ :transaction_service , :string ],
|
586
|
-
#[ :amount_discounted , :numeric ],
|
587
|
-
#[ :auth_code , :string ],
|
588
|
-
#[ :date_shipped , :datetime ],
|
589
|
-
#[ :decremented , :boolean ]
|
590
590
|
],
|
591
591
|
Caboose::Page => [
|
592
592
|
[ :site_id , :integer ],
|
@@ -598,13 +598,10 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
598
598
|
[ :uri , :string ],
|
599
599
|
[ :redirect_url , :string ],
|
600
600
|
[ :hide , :boolean , { :default => false }],
|
601
|
-
[ :content_format , :integer , { :default => Caboose::Page::CONTENT_FORMAT_HTML }],
|
602
601
|
[ :custom_css , :text ],
|
603
602
|
[ :custom_css_files , :text ],
|
604
603
|
[ :custom_js , :text ],
|
605
604
|
[ :custom_js_files , :text ],
|
606
|
-
[ :linked_resources , :text ],
|
607
|
-
[ :layout , :string ],
|
608
605
|
[ :sort_order , :integer , { :default => 0 }],
|
609
606
|
[ :custom_sort_children , :boolean , { :default => false }],
|
610
607
|
[ :seo_title , :string , { :limit => 200 }],
|
@@ -614,14 +611,9 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
614
611
|
[ :canonical_url , :string ],
|
615
612
|
[ :fb_description , :string , { :limit => 300 }],
|
616
613
|
[ :gp_description , :string , { :limit => 300 }],
|
617
|
-
[ :
|
618
|
-
|
619
|
-
|
620
|
-
[ :page_id , :integer ],
|
621
|
-
[ :render_function , :text ],
|
622
|
-
[ :block , :binary ],
|
623
|
-
[ :refresh , :boolean , { :default => false }]
|
624
|
-
],
|
614
|
+
[ :css_digest , :string ],
|
615
|
+
[ :js_digest , :string ]
|
616
|
+
],
|
625
617
|
Caboose::PageCustomField => [
|
626
618
|
[ :site_id , :integer ],
|
627
619
|
[ :key , :string ],
|
@@ -683,15 +675,12 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
683
675
|
[ :author , :text ],
|
684
676
|
[ :body , :text ],
|
685
677
|
[ :preview , :text ],
|
686
|
-
[ :hide , :boolean ],
|
687
|
-
[ :image_url , :text ],
|
688
678
|
[ :published , :boolean ],
|
689
679
|
[ :created_at , :datetime ],
|
690
680
|
[ :updated_at , :datetime ],
|
691
681
|
[ :image , :attachment ],
|
692
682
|
[ :slug , :string ],
|
693
|
-
[ :uri , :string ]
|
694
|
-
[ :status , :string ]
|
683
|
+
[ :uri , :string ]
|
695
684
|
],
|
696
685
|
Caboose::PostCategory => [
|
697
686
|
[ :site_id , :integer ],
|
@@ -903,7 +892,14 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
903
892
|
[ :head_code, :text ],
|
904
893
|
[ :body_open_code, :text ],
|
905
894
|
[ :body_close_code, :text ],
|
906
|
-
[ :recaptcha_threshold, :float, { :default => 0.05 } ]
|
895
|
+
[ :recaptcha_threshold, :float, { :default => 0.05 } ],
|
896
|
+
[ :use_change_logs, :boolean , { :default => false }],
|
897
|
+
[ :google_api_key, :string ],
|
898
|
+
[ :use_caching, :boolean , { :default => false }],
|
899
|
+
[ :footer_css_digest, :string ],
|
900
|
+
[ :footer_js_digest, :string ],
|
901
|
+
[ :custom_css_files , :text ],
|
902
|
+
[ :custom_js_files , :text ]
|
907
903
|
],
|
908
904
|
Caboose::SiteMembership => [
|
909
905
|
[ :site_id , :integer ],
|
@@ -1102,7 +1098,12 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
1102
1098
|
[ :mobile_logo_height, :string ],
|
1103
1099
|
[ :mobile_logo_top_padding, :string ],
|
1104
1100
|
[ :constrain_footer, :string ],
|
1105
|
-
[ :heading_base_font_size, :string ]
|
1101
|
+
[ :heading_base_font_size, :string ],
|
1102
|
+
[ :sass_error, :text ],
|
1103
|
+
[ :main_js, :text ],
|
1104
|
+
[ :js_digest, :string ],
|
1105
|
+
[ :default_page_padding, :string ],
|
1106
|
+
[ :default_page_constrain, :string ]
|
1106
1107
|
],
|
1107
1108
|
Caboose::ThemeFile => [
|
1108
1109
|
[ :filename, :string ],
|
@@ -1362,28 +1363,28 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
1362
1363
|
btc.create(:name => 'Rows', :parent_id => content.id) if !btc.where(:name => 'Rows', :parent_id => content.id).exists?
|
1363
1364
|
|
1364
1365
|
# Create default block types
|
1365
|
-
if !Caboose::BlockType.where(:name => 'layout_basic').exists?
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
end
|
1366
|
+
# if !Caboose::BlockType.where(:name => 'layout_basic').exists?
|
1367
|
+
# bt = Caboose::BlockType.create(:name => 'layout_basic', :description => 'Basic', :block_type_category_id => layouts.id, :use_render_function_for_layout => true, :allow_child_blocks => false, :field_type => 'block')
|
1368
|
+
# Caboose::BlockType.create(:name => 'header' , :description => 'Header' , :parent_id => bt.id, :field_type => 'block')
|
1369
|
+
# Caboose::BlockType.create(:name => 'content' , :description => 'Content' , :parent_id => bt.id, :field_type => 'block', :allow_child_blocks => true)
|
1370
|
+
# Caboose::BlockType.create(:name => 'footer' , :description => 'Footer' , :parent_id => bt.id, :field_type => 'block')
|
1371
|
+
# end
|
1371
1372
|
|
1372
|
-
if !Caboose::BlockType.where(:name => 'layout_left_sidebar').exists?
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
end
|
1373
|
+
# if !Caboose::BlockType.where(:name => 'layout_left_sidebar').exists?
|
1374
|
+
# bt = Caboose::BlockType.create(:name => 'layout_left_sidebar', :description => 'Left Sidebar', :block_type_category_id => layouts.id, :use_render_function_for_layout => true, :allow_child_blocks => false, :field_type => 'block')
|
1375
|
+
# Caboose::BlockType.create(:name => 'header' , :description => 'Header' , :parent_id => bt.id, :field_type => 'block')
|
1376
|
+
# Caboose::BlockType.create(:name => 'sidebar' , :description => 'Sidebar' , :parent_id => bt.id, :field_type => 'block', :allow_child_blocks => true)
|
1377
|
+
# Caboose::BlockType.create(:name => 'content' , :description => 'Content' , :parent_id => bt.id, :field_type => 'block', :allow_child_blocks => true)
|
1378
|
+
# Caboose::BlockType.create(:name => 'footer' , :description => 'Footer' , :parent_id => bt.id, :field_type => 'block')
|
1379
|
+
# end
|
1379
1380
|
|
1380
|
-
if !Caboose::BlockType.where(:name => 'layout_right_sidebar').exists?
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
end
|
1381
|
+
# if !Caboose::BlockType.where(:name => 'layout_right_sidebar').exists?
|
1382
|
+
# bt = Caboose::BlockType.create(:name => 'layout_right_sidebar', :description => 'Right Sidebar', :block_type_category_id => layouts.id, :use_render_function_for_layout => true, :allow_child_blocks => false, :field_type => 'block')
|
1383
|
+
# Caboose::BlockType.create(:name => 'header' , :description => 'Header' , :parent_id => bt.id, :field_type => 'block')
|
1384
|
+
# Caboose::BlockType.create(:name => 'sidebar' , :description => 'Sidebar' , :parent_id => bt.id, :field_type => 'block', :allow_child_blocks => true)
|
1385
|
+
# Caboose::BlockType.create(:name => 'content' , :description => 'Content' , :parent_id => bt.id, :field_type => 'block', :allow_child_blocks => true)
|
1386
|
+
# Caboose::BlockType.create(:name => 'footer' , :description => 'Footer' , :parent_id => bt.id, :field_type => 'block')
|
1387
|
+
# end
|
1387
1388
|
|
1388
1389
|
if !Caboose::BlockType.where(:name => 'heading').exists?
|
1389
1390
|
bt = Caboose::BlockType.create(:name => 'heading', :description => 'Heading', :field_type => 'block')
|