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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3209f594ae27c33634e49f496aa6b1c45bf21f55
4
- data.tar.gz: a855ded3722263c8b9eec24daf69392503abc0a7
3
+ metadata.gz: 0945be556ffe5758cc00e1046d1af4e634b79e71
4
+ data.tar.gz: aa2a7f7f16217941d3c8d95d5290a4e9c422e9bc
5
5
  SHA512:
6
- metadata.gz: 22057e15ad6facedb49a7a62dc754f4d66e75f41a2bc3b7267a04b2eb49816f6622e7d8446a794ea4a6784f95d5a12259795322a4dc23c9e058f3b018214d446
7
- data.tar.gz: 9f10fccd3cb1bfb3a0b16b212c841700010ac7434bb0d4ae29228364474fa70473266b548b6c20181260b92bb06baaec87454e1ae3e03c892cf1fc3c525734d2
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
- options = 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.collect { |s| { 'value' => s.id, 'text' => s.description }}
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 ],
@@ -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}" : '' %>';" />
@@ -16,7 +16,7 @@
16
16
  <span>Command+E = Compile</span>
17
17
  </p>
18
18
  </div>
19
- <div id="editor"><%= @btsm.custom_css %></div>
19
+ <div id="editor"><%= @btsm.custom_css.blank? ? @btsm.block_type.custom_sass : @btsm.custom_css %></div>
20
20
  </div>
21
21
 
22
22
  </div>
@@ -13,7 +13,7 @@
13
13
  <span>Command+S = Save</span>
14
14
  </p>
15
15
  </div>
16
- <div id="editor"><%= @btsm.custom_html %></div>
16
+ <div id="editor"><%= @btsm.custom_html.blank? ? @btsm.block_type.render_function : @btsm.custom_html %></div>
17
17
  </div>
18
18
 
19
19
  </div>
@@ -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;
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.182'
2
+ VERSION = '0.9.183'
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.9.182
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-23 00:00:00.000000000 Z
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg