caboose-cms 0.9.185 → 0.9.186

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: 0a44bbf807dee07c46455284ebc542fe64f679f3
4
- data.tar.gz: a6700b6e26f8080f444e48e749e0d3fc18f1bca0
3
+ metadata.gz: a54046beb7e66063a1a9ed7951eedbb5fa6d1d4c
4
+ data.tar.gz: 5277cae8be51f4b8ee729dfec6ce2e0a63828b44
5
5
  SHA512:
6
- metadata.gz: 60049316ca5e63a457452f94c87eed894d58aba619dd4d94adcd9e5495c433b432464f238fc627fd32cc20bdb5ccaf8b2937542915316491ed400b79d3248e72
7
- data.tar.gz: 40d5eaf66f71161dee9a957cb82a9e3d2a2aaeaf4e74a31c9fcc9ce6a51e210366b83bf8339f49626d6bb4255c7fa5251ffbfa69687e5c2f4700c706d3a2829c
6
+ metadata.gz: 900fc17bb8b33ef0f64579ce7a2cad570b7eb61c78f9531f503bd938868e85666d3315547256f7d64788ae719713f097e478d1257e78ecf78d96ccfb3effd77e
7
+ data.tar.gz: 43947619ab12956c139d728d796c234f4e62da9a8e19e1b580ddc5460b29898a883c23e3e070df51022d34955302ea71b401c9f1af15108b0d9b6438bc432697
@@ -121,10 +121,6 @@ BoundColor = BoundControl.extend({
121
121
  this.attribute.value = this.attribute.value_clean;
122
122
  $('#'+this.el).val(this.attribute.value);
123
123
  $('#'+this.el).removeClass('mb_dirty');
124
-
125
- //if ($('#'+this.el+'_check').length)
126
- // this.hide_check();
127
-
128
124
  if (this.attribute.after_cancel) this.attribute.after_cancel();
129
125
  },
130
126
 
@@ -121,6 +121,16 @@ module Caboose
121
121
  end
122
122
  @site = Site.find(params[:id])
123
123
  end
124
+
125
+ # @route GET /admin/sites/:id/codes
126
+ def admin_edit_codes
127
+ return if !user_is_allowed('sites', 'edit')
128
+ if (@site.id.to_s != params[:id] && !@site.is_master)
129
+ @error = "You are not allowed to edit this site."
130
+ render :file => 'caboose/extras/error' and return
131
+ end
132
+ @site = Site.find(params[:id])
133
+ end
124
134
 
125
135
  # @route GET /admin/sites/:id/delete
126
136
  def admin_delete_form
@@ -205,6 +215,9 @@ module Caboose
205
215
  when 'zip' then site.zip = value
206
216
  when 'fax' then site.fax = value
207
217
  when 'contact_email' then site.contact_email = value
218
+ when 'head_code' then site.head_code = value
219
+ when 'body_open_code' then site.body_open_code = value
220
+ when 'body_close_code' then site.body_close_code = value
208
221
  end
209
222
  end
210
223
  resp.success = save && site.save
@@ -824,7 +824,10 @@ class Caboose::Schema < Caboose::Utilities::Schema
824
824
  [ :state, :string ],
825
825
  [ :zip, :string ],
826
826
  [ :fax, :string ],
827
- [ :contact_email, :string ]
827
+ [ :contact_email, :string ],
828
+ [ :head_code, :text ],
829
+ [ :body_open_code, :text ],
830
+ [ :body_close_code, :text ]
828
831
  ],
829
832
  Caboose::SiteMembership => [
830
833
  [ :site_id , :integer ],
@@ -61,7 +61,10 @@ class Caboose::Site < ActiveRecord::Base
61
61
  :state,
62
62
  :zip,
63
63
  :fax,
64
- :contact_email
64
+ :contact_email,
65
+ :head_code,
66
+ :body_open_code,
67
+ :body_close_code
65
68
 
66
69
  before_save :validate_presence_of_store_config
67
70
 
@@ -6,7 +6,7 @@ class Caboose::Theme < ActiveRecord::Base
6
6
  has_many :theme_files, :through => :theme_file_memberships
7
7
 
8
8
  has_attached_file :default_banner_image,
9
- :path => 'banner_images/:id_:style.:extension',
9
+ :path => ':caboose_prefixbanner_images/:id_:style.:extension',
10
10
  :default_url => 'https://res.cloudinary.com/caboose/image/upload/c_scale,f_auto,q_auto:good,w_1800/v1539265856/default_banner.jpg',
11
11
  :s3_protocol => :https,
12
12
  :styles => {
@@ -187,7 +187,7 @@ class Caboose::Theme < ActiveRecord::Base
187
187
  url = self.default_banner_image.url(:huge)
188
188
  url = "https:#{url}" if !url.include?('https')
189
189
  if !url.include?('res.cloudinary')
190
- result = Cloudinary::Uploader.upload(url , :public_id => "banner_images/#{self.id}_huge", :overwrite => true)
190
+ result = Cloudinary::Uploader.upload(url, :public_id => "caboose/banner_images/#{self.id}_huge", :overwrite => true)
191
191
  self.cl_banner_version = result['version'] if result && result['version']
192
192
  self.save
193
193
  end
@@ -29,7 +29,7 @@ tabs = {
29
29
  'Block Types' => "/admin/sites/#{@site.id}/block-types",
30
30
  'Custom CSS' => "/admin/sites/#{@site.id}/css",
31
31
  'Custom JS' => "/admin/sites/#{@site.id}/js",
32
- # 'Retargeting' => "/admin/sites/#{@site.id}/retargeting",
32
+ 'Embedded HTML' => "/admin/sites/#{@site.id}/codes",
33
33
  'Delete Site' => "/admin/sites/#{@site.id}/delete"
34
34
  }
35
35
 
@@ -25,7 +25,7 @@ user_ids = [] if user_ids.nil?
25
25
  <p><div id='site_<%= @site.id %>_favicon' ></div></p>
26
26
 
27
27
  <h2>Domains</h2>
28
- <p><a href='#' onclick="add_domain(<%= @site.id %>);">New Domain</a></p>
28
+ <p><a href='#' onclick="add_domain(<%= @site.id %>);return false;">New Domain</a></p>
29
29
  <div id='new_domain_container'></div>
30
30
  <% if @site.domains && @site.domains.count > 0 %>
31
31
  <table class='data'>
@@ -0,0 +1,38 @@
1
+ <%= render :partial => 'caboose/sites/admin_header' %>
2
+
3
+ <h5 style="margin:0;font-size:18px;">Embedded HTML</h5>
4
+
5
+ <p><div id='site_<%= @site.id %>_head_code'></div></p>
6
+ <p><div id='site_<%= @site.id %>_body_open_code'></div></p>
7
+ <p><div id='site_<%= @site.id %>_body_close_code'></div></p>
8
+
9
+ <%= render :partial => 'caboose/sites/admin_footer' %>
10
+
11
+ <% content_for :caboose_css do %>
12
+ <style>
13
+ textarea {
14
+ font-family: monospace;
15
+ font-size: 13px;
16
+ line-height: 18px;
17
+ }
18
+ </style>
19
+ <% end %>
20
+
21
+ <% content_for :caboose_js do %>
22
+ <script type="text/javascript">
23
+
24
+ $(document).ready(function() {
25
+ new ModelBinder({
26
+ name: 'Site',
27
+ id: <%= @site.id %>,
28
+ update_url: '/admin/sites/<%= @site.id %>',
29
+ authenticity_token: '<%= form_authenticity_token %>',
30
+ attributes: [
31
+ { name: 'head_code', nice_name: 'Code for &lt;head&gt;', type: 'textarea', value: <%== Caboose.json(@site.head_code) %>, width: 600, height: 300 },
32
+ { name: 'body_open_code', nice_name: 'Code for after &lt;body&gt;', type: 'textarea', value: <%== Caboose.json(@site.body_open_code) %>, width: 600, height: 300 },
33
+ { name: 'body_close_code', nice_name: 'Code for before &lt;/body&gt;', type: 'textarea', value: <%== Caboose.json(@site.body_close_code) %>, width: 600, height: 300 }
34
+ ]
35
+ });
36
+ });
37
+ </script>
38
+ <% end %>
@@ -332,6 +332,7 @@ $(window).load(function() {
332
332
  $.each($(".mb_container.color"), function(k,v) {
333
333
  var inp = $(v).find("input[type='text']").first();
334
334
  inp.spectrum("option","showPalette",false);
335
+ inp.spectrum("option","showAlpha",true);
335
336
  inp.spectrum("option","showSelectionPalette",false);
336
337
  if ( inp.val() == 'main' ) {
337
338
  inp.spectrum("set",color_main);
@@ -350,8 +351,8 @@ $(window).load(function() {
350
351
  inp.val('dark');
351
352
  }
352
353
  inp.on("change.spectrum", function(e, color) {
353
- console.log("input changed to " + color);
354
- console.log("input v: " + inp.val());
354
+ // console.log("input changed to " + color);
355
+ // console.log("input v: " + inp.val());
355
356
  if ( inp.val() == 'main' ) {
356
357
  inp.spectrum("set",color_main);
357
358
  inp.val('main');
@@ -368,10 +369,12 @@ $(window).load(function() {
368
369
  inp.spectrum("set",color_dark);
369
370
  inp.val('dark');
370
371
  }
371
- else {
372
- inp.spectrum("set", inp.val());
373
- // inp.val(color);
372
+ else if ( inp.val() == 'transparent' ) {
373
+ inp.spectrum("set","rgba(0,0,0,0)");
374
+ inp.val('transparent');
374
375
  }
376
+ else
377
+ inp.spectrum("set", inp.val());
375
378
  });
376
379
  });
377
380
  $("#theme_<%= @theme.id %>_color_main").on("change.spectrum", function(e, color) {
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.185'
2
+ VERSION = '0.9.186'
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.185
4
+ version: 0.9.186
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-25 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -1161,6 +1161,7 @@ files:
1161
1161
  - app/views/caboose/sites/admin_delete_form.html.erb
1162
1162
  - app/views/caboose/sites/admin_edit.html.erb
1163
1163
  - app/views/caboose/sites/admin_edit_block_types.html.erb
1164
+ - app/views/caboose/sites/admin_edit_codes.html.erb
1164
1165
  - app/views/caboose/sites/admin_edit_contact.html.erb
1165
1166
  - app/views/caboose/sites/admin_edit_css.html.erb
1166
1167
  - app/views/caboose/sites/admin_edit_js.html.erb