caboose-cms 0.9.185 → 0.9.186
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/model/bound_color.js +0 -4
- data/app/controllers/caboose/sites_controller.rb +13 -0
- data/app/models/caboose/schema.rb +4 -1
- data/app/models/caboose/site.rb +4 -1
- data/app/models/caboose/theme.rb +2 -2
- data/app/views/caboose/sites/_admin_header.html.erb +1 -1
- data/app/views/caboose/sites/admin_edit.html.erb +1 -1
- data/app/views/caboose/sites/admin_edit_codes.html.erb +38 -0
- data/app/views/caboose/themes/admin_edit.html.erb +8 -5
- data/lib/caboose/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54046beb7e66063a1a9ed7951eedbb5fa6d1d4c
|
4
|
+
data.tar.gz: 5277cae8be51f4b8ee729dfec6ce2e0a63828b44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 ],
|
data/app/models/caboose/site.rb
CHANGED
data/app/models/caboose/theme.rb
CHANGED
@@ -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 => '
|
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
|
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
|
-
|
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 <head>', type: 'textarea', value: <%== Caboose.json(@site.head_code) %>, width: 600, height: 300 },
|
32
|
+
{ name: 'body_open_code', nice_name: 'Code for after <body>', type: 'textarea', value: <%== Caboose.json(@site.body_open_code) %>, width: 600, height: 300 },
|
33
|
+
{ name: 'body_close_code', nice_name: 'Code for before </body>', 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",
|
373
|
-
|
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) {
|
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.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-
|
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
|