caboose-cms 0.8.55 → 0.8.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/layouts/caboose/admin.html.erb +44 -8
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8aa462e50b81de8d5a19890e06e9718f2f9367d
|
4
|
+
data.tar.gz: c4ef0bfb833d42461bfa368bbb4b878325e0f5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9846f063fd1665761671434ff3dc532862b3ce53f731f87da4d3adda37ae854c82e5bfc6258d7b5cc3746695366c1b86059336909b1de1dbd7360b1c1986a9d7
|
7
|
+
data.tar.gz: dd87b9498fcf43e04ac1c365c0d8a8989b88f5bf3c5aee720313c2350f9d374fb293aaad1cfc3e7e920f2416a46c9c124680188297ba207b74da3cc023c895a4
|
@@ -1,13 +1,50 @@
|
|
1
|
-
|
1
|
+
<%
|
2
|
+
# See if we're using cloudflare
|
3
|
+
protocol = 'http://'
|
4
|
+
if request.env['HTTP_CF_VISITOR'] && request.env['HTTP_CF_VISITOR'].include?('https')
|
5
|
+
protocol = 'https://'
|
6
|
+
request.env['REQUEST_URI'] = "https://#{request.env['REQUEST_URI'][7..-1]}" if (request.env['REQUEST_URI'] =~ %r"http://") == 0
|
7
|
+
request.env['SERVER_PORT'] = '443' if request.env['SERVER_PORT'] == '80'
|
8
|
+
request.env['HTTP_REFERER'] = "https://#{request.env['HTTP_REFERER'][7..-1]}" if (request.env['HTTP_REFERER'] =~ %r"http://") == 0
|
9
|
+
request.env['rack.url_scheme'] = 'https'
|
10
|
+
request.env['HTTPS'] = 'on'
|
11
|
+
end
|
12
|
+
|
13
|
+
content_for :admin_css do
|
14
|
+
%><%= stylesheet_link_tag "caboose/admin", :media => "all" %><%
|
15
|
+
if File.exists?("#{Rails.root}/app/assets/stylesheets/admin.css")
|
16
|
+
%><%= stylesheet_link_tag "admin", :media => "all" %><%
|
17
|
+
end
|
18
|
+
%><%= yield :caboose_css %><%
|
19
|
+
end
|
20
|
+
|
21
|
+
css = yield(:admin_css)
|
22
|
+
css.gsub!("<link href=\"//", "<link href=\"#{protocol}")
|
23
|
+
css.gsub!("<link href='//" , "<link href='#{protocol}")
|
24
|
+
if protocol == 'https://'
|
25
|
+
css.gsub!("<link href=\"http://", "<link href=\"https://")
|
26
|
+
css.gsub!("<link href='http://" , "<link href='https://")
|
27
|
+
end
|
28
|
+
|
29
|
+
content_for :admin_js do
|
30
|
+
%><%= javascript_include_tag "caboose/admin" %><%
|
31
|
+
%><%= yield :caboose_js %><%
|
32
|
+
end
|
33
|
+
|
34
|
+
js = yield(:admin_js)
|
35
|
+
js.gsub!("<script src=\"//", "<script src=\"#{protocol}")
|
36
|
+
js.gsub!("<script src='//" , "<script src='#{protocol}")
|
37
|
+
if protocol == 'https://'
|
38
|
+
js.gsub!("<script src=\"http://", "<script src=\"https://")
|
39
|
+
js.gsub!("<script src='http://" , "<script src='https://")
|
40
|
+
end
|
41
|
+
|
42
|
+
%><!DOCTYPE html>
|
2
43
|
<html class="no-js" lang="en">
|
3
44
|
<head>
|
4
45
|
<meta charset="utf-8" />
|
5
46
|
<title>Caboose Admin</title>
|
6
|
-
<%=
|
7
|
-
<% if File.exists?("#{Rails.root}/app/assets/stylesheets/admin.css") %>
|
8
|
-
<%= stylesheet_link_tag "admin", :media => "all" %>
|
9
|
-
<% end %>
|
10
|
-
<%= yield :caboose_css %>
|
47
|
+
<%= raw css %>
|
11
48
|
<%= csrf_meta_tags %>
|
12
49
|
</head>
|
13
50
|
<body>
|
@@ -28,7 +65,6 @@
|
|
28
65
|
</div>
|
29
66
|
</div>
|
30
67
|
<div class="footer"></div>
|
31
|
-
<%=
|
32
|
-
<%= yield :caboose_js %>
|
68
|
+
<%= raw js %>
|
33
69
|
</body>
|
34
70
|
</html>
|
data/lib/caboose/version.rb
CHANGED