caboose-cms 0.9.116 → 0.9.117
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/caboose/domains_controller.rb +1 -0
- data/app/controllers/caboose/pages_controller.rb +5 -0
- data/app/controllers/caboose/sites_controller.rb +1 -0
- data/app/controllers/caboose/social_controller.rb +11 -0
- data/app/models/caboose/domain.rb +1 -1
- data/app/models/caboose/schema.rb +5 -2
- data/app/models/caboose/site.rb +2 -1
- data/app/models/caboose/social_config.rb +12 -2
- data/app/views/caboose/sites/admin_edit.html.erb +16 -0
- data/app/views/caboose/social/admin_edit.html.erb +3 -1
- 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: 746344802d927992c0c1c995175f7322ec22b4e2
|
4
|
+
data.tar.gz: 58012ad3bfc826b6f2bcdf067c7c4ab24eb142a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05cbaf50d9cbb2bb8f9b0de43ad94764f6f1acf21a3afbfbee8a9e7f2905169942fcabccbc64f4be0895f8007e7b87363f12c8cbf098834eb9cf4a39023a357e
|
7
|
+
data.tar.gz: 769f9f79f5ab0afc18224a4029d3a0afb59cf1d4b9f6f6f13e7d3262608b2ea7b5cc76235364931d60c4304788c16b2ff5f614368881be9005c494d73bf8c2b2
|
@@ -42,6 +42,7 @@ module Caboose
|
|
42
42
|
when 'under_construction' then d.under_construction = value
|
43
43
|
when 'forward_to_primary' then d.forward_to_primary = value
|
44
44
|
when 'forward_to_uri' then d.forward_to_uri = value
|
45
|
+
when 'force_ssl' then d.force_ssl = value
|
45
46
|
when 'primary' then
|
46
47
|
d.primary = value
|
47
48
|
Domain.where(:site_id => params[:site_id]).all.each do |d2|
|
@@ -48,12 +48,17 @@ module Caboose
|
|
48
48
|
url = "#{request.protocol}#{d.domain}#{d.forward_to_uri}"
|
49
49
|
redirect_to url
|
50
50
|
return
|
51
|
+
elsif d.force_ssl == true && request.protocol != 'https://' && Rails.env.production?
|
52
|
+
url = "https://#{d.domain}#{request.fullpath}"
|
53
|
+
redirect_to url
|
54
|
+
return
|
51
55
|
end
|
52
56
|
|
53
57
|
if !page
|
54
58
|
asset
|
55
59
|
return
|
56
60
|
end
|
61
|
+
|
57
62
|
|
58
63
|
user = logged_in_user
|
59
64
|
if !user.is_allowed(page, 'view')
|
@@ -183,6 +183,7 @@ module Caboose
|
|
183
183
|
when 'custom_js' then site.custom_js = value
|
184
184
|
when 'default_layout_id' then site.default_layout_id = value
|
185
185
|
when 'allow_self_registration' then site.allow_self_registration = value
|
186
|
+
when 'theme_color' then site.theme_color = value
|
186
187
|
end
|
187
188
|
end
|
188
189
|
|
@@ -93,6 +93,17 @@ module Caboose
|
|
93
93
|
resp.success = true
|
94
94
|
render :json => resp
|
95
95
|
end
|
96
|
+
|
97
|
+
# @route POST /admin/social/image
|
98
|
+
def admin_update_image
|
99
|
+
return if !user_is_allowed('social', 'edit')
|
100
|
+
resp = Caboose::StdClass.new
|
101
|
+
sc = @site.social_config
|
102
|
+
sc.share_image = params[:share_image]
|
103
|
+
resp.success = sc.save
|
104
|
+
resp.attributes = { 'share_image' => { 'value' => sc.share_image.url(:large) }}
|
105
|
+
render :text => resp.to_json
|
106
|
+
end
|
96
107
|
|
97
108
|
end
|
98
109
|
end
|
@@ -3,6 +3,6 @@ class Caboose::Domain < ActiveRecord::Base
|
|
3
3
|
self.table_name = "domains"
|
4
4
|
|
5
5
|
belongs_to :site, :class_name => 'Caboose::Site'
|
6
|
-
attr_accessible :id, :site_id, :domain, :primary, :under_construction, :forward_to_primary, :forward_to_uri
|
6
|
+
attr_accessible :id, :site_id, :domain, :primary, :under_construction, :forward_to_primary, :forward_to_uri, :force_ssl
|
7
7
|
|
8
8
|
end
|
@@ -293,6 +293,7 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
293
293
|
[ :primary , :boolean, { :default => false }],
|
294
294
|
[ :under_construction , :boolean, { :default => false }],
|
295
295
|
[ :forward_to_primary , :boolean, { :default => false }],
|
296
|
+
[ :force_ssl , :boolean, { :default => false }],
|
296
297
|
[ :forward_to_uri , :string ]
|
297
298
|
],
|
298
299
|
Caboose::Font => [
|
@@ -748,7 +749,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
748
749
|
[ :default_layout_id , :integer ],
|
749
750
|
[ :login_fail_lock_count , :integer , { :default => 5 }],
|
750
751
|
[ :sitemap_xml , :text ],
|
751
|
-
[ :robots_txt , :text ]
|
752
|
+
[ :robots_txt , :text ],
|
753
|
+
[ :theme_color , :string ]
|
752
754
|
#[ :custom_css , :text ],
|
753
755
|
#[ :custom_css_files , :text ],
|
754
756
|
#[ :custom_js , :text ],
|
@@ -786,7 +788,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
786
788
|
[ :linkedin_url , :string ],
|
787
789
|
[ :google_analytics_id , :string ],
|
788
790
|
[ :google_analytics_id2 , :string ],
|
789
|
-
[ :auto_ga_js , :boolean , { :default => false }]
|
791
|
+
[ :auto_ga_js , :boolean , { :default => false }],
|
792
|
+
[ :share_image , :attachment ]
|
790
793
|
],
|
791
794
|
Caboose::StackableGroup => [
|
792
795
|
[ :name , :string ],
|
data/app/models/caboose/site.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
class Caboose::SocialConfig < ActiveRecord::Base
|
2
2
|
self.table_name = "social_configs"
|
3
3
|
|
4
|
-
belongs_to :site
|
4
|
+
belongs_to :site, :class_name => "Caboose::Site"
|
5
|
+
|
5
6
|
attr_accessible :id,
|
6
7
|
:site_id ,
|
7
8
|
:facebook_page_id ,
|
@@ -15,6 +16,15 @@ class Caboose::SocialConfig < ActiveRecord::Base
|
|
15
16
|
:rss_url ,
|
16
17
|
:google_plus_url ,
|
17
18
|
:linkedin_url ,
|
18
|
-
:google_analytics_id
|
19
|
+
:google_analytics_id
|
20
|
+
|
21
|
+
has_attached_file :share_image,
|
22
|
+
:path => ':share_images/:id_:style.:extension',
|
23
|
+
:default_url => 'http://placehold.it/800x500',
|
24
|
+
:s3_protocol => :https,
|
25
|
+
:styles => {
|
26
|
+
large: '1200x1200>'
|
27
|
+
}
|
28
|
+
do_not_validate_attachment_file_type :share_image
|
19
29
|
|
20
30
|
end
|
@@ -17,6 +17,7 @@ user_ids = [] if user_ids.nil?
|
|
17
17
|
<p><div id='site_<%= @site.id %>_use_fonts' ></div></p>
|
18
18
|
<p><div id='site_<%= @site.id %>_use_dragdrop' ></div></p>
|
19
19
|
<p><div id='site_<%= @site.id %>_allow_self_registration' ></div></p>
|
20
|
+
<p><div id='site_<%= @site.id %>_theme_color' ></div></p>
|
20
21
|
<p><div id='site_<%= @site.id %>_default_layout_id' ></div></p>
|
21
22
|
|
22
23
|
<h2>Domains</h2>
|
@@ -28,6 +29,7 @@ user_ids = [] if user_ids.nil?
|
|
28
29
|
<th>Domain</th>
|
29
30
|
<th>Primary</th>
|
30
31
|
<th>Under Construction</th>
|
32
|
+
<th>Force SSL</th>
|
31
33
|
<th>Forward to Primary</th>
|
32
34
|
<th>Forward to URI</th>
|
33
35
|
<th>Delete</th>
|
@@ -37,6 +39,7 @@ user_ids = [] if user_ids.nil?
|
|
37
39
|
<td><%= d.domain %></td>
|
38
40
|
<td align='center'><input type='radio' name='primary_domain' <%= d.primary? ? "checked='true'" : '' %> onclick="set_primary_domain(<%= s.id %>, <%= d.id %>);" /></td>
|
39
41
|
<td align='center'><input type='checkbox' name='under_construction_<%= d.id %>' <%= d.under_construction ? "checked='true'" : '' %> onclick="set_under_construction(<%= s.id %>, <%= d.id %>, $(this).prop('checked'));" /></td>
|
42
|
+
<td align='center'><input type='checkbox' name='force_ssl_<%= d.id %>' <%= d.force_ssl ? "checked='true'" : '' %> onclick="set_force_ssl(<%= s.id %>, <%= d.id %>, $(this).prop('checked'));" /></td>
|
40
43
|
<td align='center'><input type='checkbox' name='forward_to_primary_<%= d.id %>' <%= d.forward_to_primary ? "checked='true'" : '' %> onclick="set_forward_to_primary(<%= s.id %>, <%= d.id %>, $(this).prop('checked'));" /></td>
|
41
44
|
<td align='center'><input type='text' name='forward_to_uri_<%= d.id %>' value="<%= d.forward_to_uri %>" onchange="set_forward_to_uri(<%= s.id %>, <%= d.id %>, $(this).val());" /></td>
|
42
45
|
<td align='center'><input type='button' value='Delete' onclick="delete_domain(<%= @site.id %>, <%= d.id %>);" /></td>
|
@@ -73,6 +76,9 @@ user_ids = [] if user_ids.nil?
|
|
73
76
|
line-height: 20px;
|
74
77
|
padding: 30px 9px 9px 9px !important;
|
75
78
|
}
|
79
|
+
table.data th {
|
80
|
+
padding: 2px 8px !important;
|
81
|
+
}
|
76
82
|
</style>
|
77
83
|
<% end %>
|
78
84
|
|
@@ -88,6 +94,7 @@ $(document).ready(function() {
|
|
88
94
|
attributes: [
|
89
95
|
{ name: 'logo' , nice_name: 'Logo' , type: 'image' , value: <%= raw Caboose.json(@site.logo ? @site.logo.url(:thumb) : '') %>, width: 400, update_url: '/admin/sites/<%= @site.id %>/logo' },
|
90
96
|
{ name: 'description' , nice_name: 'Description' , type: 'text' , value: <%= raw Caboose.json(@site.description) %>, width: 600 },
|
97
|
+
{ name: 'theme_color' , nice_name: 'Theme Color' , type: 'text' , value: <%= raw Caboose.json(@site.theme_color) %>, width: 600 },
|
91
98
|
{ name: 'under_construction_html' , nice_name: 'Under Construction HTML' , type: 'textarea' , value: <%= raw Caboose.json(@site.under_construction_html) %>, width: 600, height: 220 },
|
92
99
|
{ name: 'use_store' , nice_name: 'Enable Store' , type: 'checkbox' , value: <%= raw Caboose.json(@site.use_store ? true : false) %>, width: 400 },
|
93
100
|
{ name: 'use_fonts' , nice_name: 'Enable Fonts' , type: 'checkbox' , value: <%= raw Caboose.json(@site.use_fonts ? true : false) %>, width: 400 },
|
@@ -116,6 +123,15 @@ function set_forward_to_primary(site_id, domain_id, checked)
|
|
116
123
|
});
|
117
124
|
}
|
118
125
|
|
126
|
+
function set_force_ssl(site_id, domain_id, checked)
|
127
|
+
{
|
128
|
+
$.ajax({
|
129
|
+
url: '/admin/sites/' + site_id + '/domains/' + domain_id,
|
130
|
+
type: 'put',
|
131
|
+
data: { force_ssl: checked ? 1 : 0 }
|
132
|
+
});
|
133
|
+
}
|
134
|
+
|
119
135
|
function set_forward_to_uri(site_id, domain_id, val)
|
120
136
|
{
|
121
137
|
$.ajax({
|
@@ -31,6 +31,7 @@ Authorized
|
|
31
31
|
<p><div id="socialconfig_<%= sc.id %>_google_analytics_id" ></div></p>
|
32
32
|
<p><div id="socialconfig_<%= sc.id %>_google_analytics_id2" ></div></p>
|
33
33
|
<p><div id="socialconfig_<%= sc.id %>_auto_ga_js" ></div></p>
|
34
|
+
<p><div id="socialconfig_<%= sc.id %>_share_image" ></div></p>
|
34
35
|
|
35
36
|
<div id='message'></div>
|
36
37
|
|
@@ -78,7 +79,8 @@ $(document).ready(function() {
|
|
78
79
|
{ name: 'linkedin_url' , nice_name: 'LinkedIn URL' , type: 'text' , value: <%= raw Caboose.json(sc.linkedin_url) %>, width: 500 },
|
79
80
|
{ name: 'google_analytics_id' , nice_name: 'Primary Google Analytics Tracking ID' , type: 'text' , value: <%= raw Caboose.json(sc.google_analytics_id) %>, width: 500 },
|
80
81
|
{ name: 'google_analytics_id2' , nice_name: 'Secondary Google Analytics Tracking ID' , type: 'text' , value: <%= raw Caboose.json(sc.google_analytics_id2) %>, width: 500 },
|
81
|
-
{ name: 'auto_ga_js' , nice_name: 'Auto Embed Google Analytics JS' , type: 'checkbox' , value: <%= sc.auto_ga_js ? 1 : 0 %>, width: 500 }
|
82
|
+
{ name: 'auto_ga_js' , nice_name: 'Auto Embed Google Analytics JS' , type: 'checkbox' , value: <%= sc.auto_ga_js ? 1 : 0 %>, width: 500 },
|
83
|
+
{ name: 'share_image' , nice_name: 'Share Image' , type: 'image' , value: <%= raw Caboose.json(sc.share_image ? sc.share_image.url(:large) : 'http://placehold.it?300x300') %>, width: 800, update_url: '/admin/social/image' }
|
82
84
|
]
|
83
85
|
});
|
84
86
|
|
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.117
|
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-03-
|
11
|
+
date: 2018-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|