caboose-cms 0.9.182 → 0.9.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/caboose/block_type_categories_controller.rb +4 -1
- data/app/controllers/caboose/themes_controller.rb +4 -0
- data/app/models/caboose/schema.rb +2 -1
- data/app/models/caboose/theme.rb +14 -1
- data/app/views/caboose/block_types/admin_edit.html.erb +1 -2
- data/app/views/caboose/block_types/admin_edit_btsm_css.html.erb +1 -1
- data/app/views/caboose/block_types/admin_edit_btsm_html.html.erb +1 -1
- data/app/views/caboose/block_types/admin_edit_render_function.html.erb +7 -0
- data/app/views/caboose/block_types/admin_edit_sass.html.erb +7 -0
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0945be556ffe5758cc00e1046d1af4e634b79e71
|
4
|
+
data.tar.gz: aa2a7f7f16217941d3c8d95d5290a4e9c422e9bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b1843d89e4fe318ba445c7c9e67de8ee3e3c4130b21d1da17ce17fcee4bc3493660d3a6e229b6ccd68da2a0d6ad849693d76d4c577e30d7b11669d4e000611
|
7
|
+
data.tar.gz: f4a50d2568fd53991334bdac92622e57355831926ccbaee9553f6eef73b19c0704cc3d45a58d6e425d5c5c252b207672a052107c722593d7419d5f2ace621125
|
@@ -11,7 +11,10 @@ module Caboose
|
|
11
11
|
# @route GET /admin/block-type-categories/:id/options
|
12
12
|
def admin_options
|
13
13
|
btc = BlockTypeCategory.find(params[:id])
|
14
|
-
|
14
|
+
options = params[:default] == 'yes' ? [{:text => 'Default', :value => 'Default'}] : []
|
15
|
+
BlockType.joins(:block_type_site_memberships).where("block_type_site_memberships.site_id = ?",@site.id).where("block_type_site_memberships.block_type_id = block_types.id").where("block_types.block_type_category_id = ?",btc.id).reorder('block_types.description').all.each do |s|
|
16
|
+
options << { 'value' => s.id, 'text' => s.description }
|
17
|
+
end
|
15
18
|
render :json => options
|
16
19
|
end
|
17
20
|
|
@@ -133,6 +133,10 @@ module Caboose
|
|
133
133
|
theme.default_banner_image = params[:default_banner_image]
|
134
134
|
resp.success = theme.save
|
135
135
|
resp.attributes = { 'default_banner_image' => { 'value' => theme.default_banner_image.url(:huge) }}
|
136
|
+
if Caboose::use_cloudinary
|
137
|
+
theme.update_cloudinary_banner if Rails.env.development?
|
138
|
+
theme.delay(:queue => 'general', :priority => 12).update_cloudinary_banner if Rails.env.production?
|
139
|
+
end
|
136
140
|
render :text => resp.to_json
|
137
141
|
end
|
138
142
|
|
@@ -1000,7 +1000,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
1000
1000
|
[ :actual_footer_height, :string ],
|
1001
1001
|
[ :actual_banner_height, :string ],
|
1002
1002
|
[ :dropdown_nav_padding, :string ],
|
1003
|
-
[ :custom_sass, :text ]
|
1003
|
+
[ :custom_sass, :text ],
|
1004
|
+
[ :cl_banner_version, :string ]
|
1004
1005
|
],
|
1005
1006
|
Caboose::ThemeFile => [
|
1006
1007
|
[ :filename, :string ],
|
data/app/models/caboose/theme.rb
CHANGED
@@ -80,7 +80,8 @@ class Caboose::Theme < ActiveRecord::Base
|
|
80
80
|
:dropdown_nav_padding,
|
81
81
|
|
82
82
|
:digest,
|
83
|
-
:custom_sass
|
83
|
+
:custom_sass,
|
84
|
+
:cl_banner_version
|
84
85
|
|
85
86
|
def compile(for_site_id = 0)
|
86
87
|
theme = self
|
@@ -165,5 +166,17 @@ class Caboose::Theme < ActiveRecord::Base
|
|
165
166
|
def update_digest(digest)
|
166
167
|
self.update_column('digest', digest)
|
167
168
|
end
|
169
|
+
|
170
|
+
def update_cloudinary_banner
|
171
|
+
if Caboose::use_cloudinary
|
172
|
+
url = self.default_banner_image.url(:huge)
|
173
|
+
url = "https:#{url}" if !url.include?('https')
|
174
|
+
if !url.include?('res.cloudinary')
|
175
|
+
result = Cloudinary::Uploader.upload(url , :public_id => "banner_images/#{self.id}_huge", :overwrite => true)
|
176
|
+
self.cl_banner_version = result['version'] if result && result['version']
|
177
|
+
self.save
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
168
181
|
|
169
182
|
end
|
@@ -11,7 +11,6 @@ bt = @block_type
|
|
11
11
|
<a href="/admin/block-types/<%= bt.id %>/render-function" class="caboose-btn">Edit Render Function</a>
|
12
12
|
<a href="/admin/block-types/<%= bt.id %>/sass" class="caboose-btn">Edit Custom SCSS</a>
|
13
13
|
|
14
|
-
<div id='message'></div>
|
15
14
|
<p><div id='blocktype_<%= bt.id %>_name' ></div></p>
|
16
15
|
<p><div id='blocktype_<%= bt.id %>_description' ></div></p>
|
17
16
|
|
@@ -43,7 +42,7 @@ bt = @block_type
|
|
43
42
|
</p>
|
44
43
|
<p><div id='blocktype_<%= bt.id %>_options_function' ></div></p>
|
45
44
|
|
46
|
-
|
45
|
+
<div id='message'></div>
|
47
46
|
|
48
47
|
<p>
|
49
48
|
<input type='button' value='< Back' onclick="window.location='/admin/block-types<%= bt.parent_id && bt.parent_id > 0 ? "/#{bt.parent_id}" : '' %>';" />
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
<div class="holder">
|
6
6
|
<div class="clearfix buttons">
|
7
|
+
<p class="warning">WARNING: This code is used on multiple sites. Edit with caution.</p>
|
7
8
|
<a href="/admin/block-types/<%= @block_type.id %>" class="caboose-btn">Back</a>
|
8
9
|
<a href="/admin/block-types/<%= @block_type.id %>/errors" class="caboose-btn">Error Log</a>
|
9
10
|
<a href="#" onclick="save();return false;" class="caboose-btn green">Save</a>
|
@@ -20,6 +21,12 @@
|
|
20
21
|
|
21
22
|
<% content_for :caboose_css do %>
|
22
23
|
<style>
|
24
|
+
p.warning {
|
25
|
+
color: #d43030;
|
26
|
+
font-size: 14px;
|
27
|
+
font-weight: bold;
|
28
|
+
margin: 0 0 8px 0;
|
29
|
+
}
|
23
30
|
p#tips {
|
24
31
|
display: inline-block;
|
25
32
|
float: right;
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
<div class="holder">
|
6
6
|
<div class="clearfix buttons">
|
7
|
+
<p class="warning">WARNING: This code is used on multiple sites. Edit with caution.</p>
|
7
8
|
<a href="/admin/block-types/<%= @block_type.id %>" class="caboose-btn">Back</a>
|
8
9
|
<a href="#" onclick="save();return false;" class="caboose-btn green">Save</a>
|
9
10
|
<span id="modified">Modified</span>
|
@@ -19,6 +20,12 @@
|
|
19
20
|
|
20
21
|
<% content_for :caboose_css do %>
|
21
22
|
<style>
|
23
|
+
p.warning {
|
24
|
+
color: #d43030;
|
25
|
+
font-size: 14px;
|
26
|
+
font-weight: bold;
|
27
|
+
margin: 0 0 8px 0;
|
28
|
+
}
|
22
29
|
p#tips {
|
23
30
|
display: inline-block;
|
24
31
|
float: right;
|
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.9.
|
4
|
+
version: 0.9.183
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|