caboose-cms 0.9.140 → 0.9.141
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/caboose/modal_inline.css +1 -1
- data/app/controllers/caboose/media_controller.rb +3 -2
- data/app/views/caboose/blocks/_ga.html.erb +13 -44
- data/app/views/caboose/blocks/_ga_old.html.erb +45 -0
- data/app/views/caboose/social/admin_edit.html.erb +70 -15
- data/app/views/layouts/caboose/application.html.erb +3 -4
- 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: 4a12ce0605a6ada50a69e1bd6acce2c85e2644d9
|
4
|
+
data.tar.gz: 3884dd6153bd714da7819b86db0361f39061941f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddff9ac7a922f69933783d8c072d9839429d214a457d486f626ff30a76340343affd4c5f2a937c6239f9776ad52aaa2603cd95476b1299c080bf4e4fb7d5fea3
|
7
|
+
data.tar.gz: faa9dc225784b397a2ae1e58d44456f2264fe6a573a31300a93904e45eb99e52084faf7193a59c2fd0c046ca92c7f23a0967eefef4a9cc2ce7dfd47fed4ab92f
|
@@ -18,7 +18,7 @@
|
|
18
18
|
#the_modal div.mb_container input[type=checkbox] { top: 12px; }
|
19
19
|
#the_modal #modal_crumbtrail,
|
20
20
|
#the_modal #modal_crumbtrail h2,
|
21
|
-
#the_modal #modal_crumbtrail h2 a { font-family: 'Roboto'; font-weight: 300; font-size: 15px !important; color: #0975a7; text-decoration: none; }
|
21
|
+
#the_modal #modal_crumbtrail h2 a { font-family: 'Roboto'; font-weight: 300; font-size: 15px !important; color: #0975a7; text-decoration: none; text-transform: none; letter-spacing: 0; }
|
22
22
|
#the_modal #modal_crumbtrail h2 a:hover {
|
23
23
|
color: #09a710;
|
24
24
|
}
|
@@ -177,7 +177,8 @@ module Caboose
|
|
177
177
|
return unless user_is_allowed('media', 'view')
|
178
178
|
media_category_id = params[:media_category_id]
|
179
179
|
original_name = params[:name]
|
180
|
-
name = Caboose::Media.upload_name(original_name)
|
180
|
+
name = Caboose::Media.upload_name(original_name)
|
181
|
+
desc = original_name.blank? ? "Media File" : original_name.gsub(/\.[0-9a-z]+$/i,'')
|
181
182
|
file_type = params[:file_type]
|
182
183
|
if ['image/gif', 'image/jpeg', 'image/png', 'image/tiff'].include? file_type
|
183
184
|
image_content_type = file_type
|
@@ -187,7 +188,7 @@ module Caboose
|
|
187
188
|
m = Media.where(:media_category_id => media_category_id, :original_name => original_name, :name => name).first
|
188
189
|
if m.nil?
|
189
190
|
max = Media.where(:media_category_id => media_category_id).maximum(:sort_order)
|
190
|
-
m = Media.create(:media_category_id => media_category_id, :sort_order => (max ? (max + 1) : 0), :original_name => original_name, :name => name, :image_content_type => image_content_type, :file_content_type => file_content_type, :processed => false)
|
191
|
+
m = Media.create(:media_category_id => media_category_id, :description => desc, :sort_order => (max ? (max + 1) : 0), :original_name => original_name, :name => name, :image_content_type => image_content_type, :file_content_type => file_content_type, :processed => false)
|
191
192
|
end
|
192
193
|
p = Product.where(:media_category_id => media_category_id).last
|
193
194
|
if p
|
@@ -1,45 +1,14 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
if sc.auto_ga_js && sc.google_analytics_id
|
4
|
-
%>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<%
|
15
|
-
cat = arr[0] ? arr[0] : nil
|
16
|
-
action = arr[1] ? arr[1] : nil
|
17
|
-
label = arr[2] ? arr[2] : nil
|
18
|
-
value = arr[3] ? arr[3] : nil
|
19
|
-
arr2 = [cat, action]
|
20
|
-
arr2 << (label ? label : '') if label || (label.nil? && value)
|
21
|
-
arr2 << value if value
|
22
|
-
%>
|
23
|
-
ga('send', 'event'<% arr2.each do |x| %>, <%= raw Caboose.json(x) %><% end %>);
|
24
|
-
<% end %>
|
25
|
-
<% end %>
|
26
|
-
<% if sc.google_analytics_id2 && sc.google_analytics_id2.strip.length > 0 %>
|
27
|
-
ga('create', '<%= raw sc.google_analytics_id2 %>', 'auto', {'name': 'property2'});
|
28
|
-
ga('property2.send', 'pageview');
|
29
|
-
<% if ga_events && ga_events.count > 0 %>
|
30
|
-
<% ga_events.each do |arr| %>
|
31
|
-
<%
|
32
|
-
cat = arr[0] ? arr[0] : nil
|
33
|
-
action = arr[1] ? arr[1] : nil
|
34
|
-
label = arr[2] ? arr[2] : nil
|
35
|
-
value = arr[3] ? arr[3] : nil
|
36
|
-
arr2 = [cat, action]
|
37
|
-
arr2 << (label ? label : '') if label || (label.nil? && value)
|
38
|
-
arr2 << value if value
|
39
|
-
%>
|
40
|
-
ga('property2.send', 'event'<% arr2.each do |x| %>, <%= raw Caboose.json(x) %><% end %>);
|
41
|
-
<% end %>
|
42
|
-
<% end %>
|
43
|
-
<% end %>
|
44
|
-
</script>
|
1
|
+
<% sc = site.social_config %>
|
2
|
+
|
3
|
+
<% if sc.auto_ga_js && !sc.google_analytics_id.blank? %>
|
4
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=<%== sc.google_analytics_id %>"></script>
|
5
|
+
<script>
|
6
|
+
window.dataLayer = window.dataLayer || [];
|
7
|
+
function gtag(){dataLayer.push(arguments);}
|
8
|
+
gtag('js', new Date());
|
9
|
+
gtag('config', '<%== sc.google_analytics_id %>');
|
10
|
+
<% if !sc.google_analytics_id2.blank? %>
|
11
|
+
gtag('config', '<%== sc.google_analytics_id2 %>');
|
12
|
+
<% end %>
|
13
|
+
</script>
|
45
14
|
<% end %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<%
|
2
|
+
sc = site.social_config
|
3
|
+
if sc.auto_ga_js && sc.google_analytics_id
|
4
|
+
%>
|
5
|
+
<script>
|
6
|
+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
7
|
+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
8
|
+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
9
|
+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
10
|
+
ga('create', '<%= raw sc.google_analytics_id %>', 'auto');
|
11
|
+
ga('send', 'pageview');
|
12
|
+
<% if ga_events && ga_events.count > 0 %>
|
13
|
+
<% ga_events.each do |arr| %>
|
14
|
+
<%
|
15
|
+
cat = arr[0] ? arr[0] : nil
|
16
|
+
action = arr[1] ? arr[1] : nil
|
17
|
+
label = arr[2] ? arr[2] : nil
|
18
|
+
value = arr[3] ? arr[3] : nil
|
19
|
+
arr2 = [cat, action]
|
20
|
+
arr2 << (label ? label : '') if label || (label.nil? && value)
|
21
|
+
arr2 << value if value
|
22
|
+
%>
|
23
|
+
ga('send', 'event'<% arr2.each do |x| %>, <%= raw Caboose.json(x) %><% end %>);
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% if sc.google_analytics_id2 && sc.google_analytics_id2.strip.length > 0 %>
|
27
|
+
ga('create', '<%= raw sc.google_analytics_id2 %>', 'auto', {'name': 'property2'});
|
28
|
+
ga('property2.send', 'pageview');
|
29
|
+
<% if ga_events && ga_events.count > 0 %>
|
30
|
+
<% ga_events.each do |arr| %>
|
31
|
+
<%
|
32
|
+
cat = arr[0] ? arr[0] : nil
|
33
|
+
action = arr[1] ? arr[1] : nil
|
34
|
+
label = arr[2] ? arr[2] : nil
|
35
|
+
value = arr[3] ? arr[3] : nil
|
36
|
+
arr2 = [cat, action]
|
37
|
+
arr2 << (label ? label : '') if label || (label.nil? && value)
|
38
|
+
arr2 << value if value
|
39
|
+
%>
|
40
|
+
ga('property2.send', 'event'<% arr2.each do |x| %>, <%= raw Caboose.json(x) %><% end %>);
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
44
|
+
</script>
|
45
|
+
<% end %>
|
@@ -5,45 +5,100 @@ domain = ms ? (ms.primary_domain ? ms.primary_domain.domain : 'www.caboosecms.co
|
|
5
5
|
%>
|
6
6
|
<h1>Social Media Config</h1>
|
7
7
|
|
8
|
+
<div class="social-wrap">
|
8
9
|
<p>Find your Facebook page ID <a href="http://findmyfbid.com" target="_blank">here</a>.</p>
|
9
|
-
<
|
10
|
-
|
11
|
-
<p><
|
10
|
+
<div id="socialconfig_<%= sc.id %>_facebook_page_id" ></div>
|
11
|
+
<% if false %>
|
12
|
+
<p style="margin:0 0 15px 0;width:500px;font-size:13px;color:#000;text-align:right;position:relative;bottom:10px;"><a id="fb-login" href="#">Authorize Facebook</a> (you must authorize to show posts on this website)
|
13
|
+
<% end %>
|
14
|
+
<div id="socialconfig_<%= sc.id %>_twitter_username" ></div>
|
15
|
+
<div id="socialconfig_<%= sc.id %>_instagram_username" ></div>
|
12
16
|
<% if sc.instagram_access_token %>
|
13
|
-
<p style="margin
|
17
|
+
<p style="margin:0 0 15px 0;width:500px;font-size:13px;color:#000;text-align:right;position:relative;bottom:10px;">
|
14
18
|
Authorized
|
15
19
|
<a href="#" id="deauthorize-instagram" style="color:#949494;font-size:12px;margin-left:6px;">Deauthorize</a>
|
16
20
|
</p><% end %>
|
17
21
|
</p>
|
18
22
|
<% if !sc.instagram_access_token %>
|
19
|
-
<p style="margin
|
23
|
+
<p style="margin:0 0 15px 0;width:500px;font-size:13px;color:#000;text-align:right;position:relative;bottom:10px;"><a href="https://api.instagram.com/oauth/authorize/?client_id=bac12987b6cb4262a004f3ffc388accc&redirect_uri=http://<%= domain %>/api/instagram&response_type=code&state=<%= @site.id %>">Authorize Instagram</a> (you must authorize to show posts on this website)
|
20
24
|
<% if params[:instagram] && params[:instagram] == 'fail' %>
|
21
25
|
<br /><span style="color:red;">Instagram login failed. Please try again.</span>
|
22
26
|
<% end %>
|
23
27
|
</p>
|
24
28
|
<% end %>
|
25
|
-
<
|
26
|
-
<
|
27
|
-
<
|
28
|
-
<
|
29
|
-
<
|
30
|
-
<
|
31
|
-
<
|
32
|
-
<
|
33
|
-
<
|
34
|
-
<
|
29
|
+
<div id="socialconfig_<%= sc.id %>_youtube_url" ></div>
|
30
|
+
<div id="socialconfig_<%= sc.id %>_pinterest_url" ></div>
|
31
|
+
<div id="socialconfig_<%= sc.id %>_vimeo_url" ></div>
|
32
|
+
<div id="socialconfig_<%= sc.id %>_rss_url" ></div>
|
33
|
+
<div id="socialconfig_<%= sc.id %>_google_plus_url" ></div>
|
34
|
+
<div id="socialconfig_<%= sc.id %>_linkedin_url" ></div>
|
35
|
+
<div id="socialconfig_<%= sc.id %>_google_analytics_id" ></div>
|
36
|
+
<div id="socialconfig_<%= sc.id %>_google_analytics_id2" ></div>
|
37
|
+
<div id="socialconfig_<%= sc.id %>_auto_ga_js" ></div>
|
38
|
+
<div id="socialconfig_<%= sc.id %>_share_image" ></div>
|
35
39
|
|
36
40
|
<div id='message'></div>
|
37
41
|
|
42
|
+
</div>
|
43
|
+
|
38
44
|
<% content_for :caboose_css do %>
|
39
45
|
<style type="text/css">
|
40
46
|
#deauthorize-instagram:hover {
|
41
47
|
color: red !important;
|
42
48
|
}
|
49
|
+
.social-wrap > div {
|
50
|
+
margin-bottom: 15px;
|
51
|
+
}
|
43
52
|
</style>
|
44
53
|
<% end %>
|
45
54
|
|
46
55
|
<% content_for :caboose_js do %>
|
56
|
+
|
57
|
+
<% if false %>
|
58
|
+
<script>
|
59
|
+
window.fbAsyncInit = function() {
|
60
|
+
FB.init({
|
61
|
+
appId : '452544411866077',
|
62
|
+
autoLogAppEvents : true,
|
63
|
+
xfbml : true,
|
64
|
+
version : 'v3.0'
|
65
|
+
});
|
66
|
+
};
|
67
|
+
|
68
|
+
$("#fb-login").click(function(e) {
|
69
|
+
e.preventDefault();
|
70
|
+
FB.login(function(response) {
|
71
|
+
if (response.authResponse) {
|
72
|
+
console.log('Welcome! Fetching your information.... ');
|
73
|
+
FB.api('/me', function(response) {
|
74
|
+
console.log('Good to see you, ' + response.name + '.');
|
75
|
+
FB.getLoginStatus(function(response) {
|
76
|
+
if (response.status === 'connected') {
|
77
|
+
var accessToken = response.authResponse.accessToken;
|
78
|
+
console.log(accessToken);
|
79
|
+
FB.api('/me/accounts', function(response) {
|
80
|
+
console.dir(response);
|
81
|
+
});
|
82
|
+
}
|
83
|
+
});
|
84
|
+
});
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
console.log('User cancelled login or did not fully authorize.');
|
88
|
+
}
|
89
|
+
});
|
90
|
+
});
|
91
|
+
|
92
|
+
(function(d, s, id){
|
93
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
94
|
+
if (d.getElementById(id)) {return;}
|
95
|
+
js = d.createElement(s); js.id = id;
|
96
|
+
js.src = "https://connect.facebook.net/en_US/sdk.js";
|
97
|
+
fjs.parentNode.insertBefore(js, fjs);
|
98
|
+
}(document, 'script', 'facebook-jssdk'));
|
99
|
+
</script>
|
100
|
+
<% end %>
|
101
|
+
|
47
102
|
<%= javascript_include_tag "caboose/model/all" %>
|
48
103
|
<script type="text/javascript">
|
49
104
|
|
@@ -99,14 +99,15 @@
|
|
99
99
|
request.env['HTTPS'] = 'on'
|
100
100
|
end
|
101
101
|
|
102
|
-
css =
|
102
|
+
css = b.partial('ga', options)
|
103
|
+
css << yield(:css)
|
103
104
|
css.gsub!("<link href=\"//", "<link href=\"#{protocol}")
|
104
105
|
css.gsub!("<link href='//" , "<link href='#{protocol}")
|
105
106
|
if protocol == 'https://'
|
106
107
|
css.gsub!("<link href=\"http://", "<link href=\"https://")
|
107
108
|
css.gsub!("<link href='http://" , "<link href='https://")
|
108
109
|
end
|
109
|
-
|
110
|
+
|
110
111
|
js = yield(:js)
|
111
112
|
js.gsub!("<script src=\"//", "<script src=\"#{protocol}")
|
112
113
|
js.gsub!("<script src='//" , "<script src='#{protocol}")
|
@@ -117,8 +118,6 @@
|
|
117
118
|
if @site.use_retargeting
|
118
119
|
js << b.partial('retargeting', options)
|
119
120
|
end
|
120
|
-
|
121
|
-
js << b.partial('ga', options)
|
122
121
|
|
123
122
|
str.gsub!('|CABOOSE_CSS|' , css)
|
124
123
|
str.gsub!('|CABOOSE_PROTOCOL|' , protocol)
|
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.141
|
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-05-
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -906,6 +906,7 @@ files:
|
|
906
906
|
- app/views/caboose/blocks/_file.html.erb
|
907
907
|
- app/views/caboose/blocks/_ga.html.erb
|
908
908
|
- app/views/caboose/blocks/_ga_events.html.erb
|
909
|
+
- app/views/caboose/blocks/_ga_old.html.erb
|
909
910
|
- app/views/caboose/blocks/_google_spreadsheet_cell_value.html.erb
|
910
911
|
- app/views/caboose/blocks/_heading.html.erb
|
911
912
|
- app/views/caboose/blocks/_html.html.erb
|