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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a7f9a70370e9c5d99ac4c0f78557687c76d7069
4
- data.tar.gz: 8a20215e7e1b15d4e5b17fb0c6c65e9f0c6bd565
3
+ metadata.gz: a8aa462e50b81de8d5a19890e06e9718f2f9367d
4
+ data.tar.gz: c4ef0bfb833d42461bfa368bbb4b878325e0f5d9
5
5
  SHA512:
6
- metadata.gz: 4acc6e7c193095541e742edd809d74a0f0a60285ac6021366cb74d05b009c08b7082522f8cd63abe88c42735206b404d9d8dfc003d1f8be63f26017c0d006a07
7
- data.tar.gz: 9bfd52b6631c64cd893cdba29b61e02d3c1782cf5b28b67e51b8e219bbc7d4e316cea8306e6af09beecfff6f611b3736104ad0388290d6d06bd67a54ae13255f
6
+ metadata.gz: 9846f063fd1665761671434ff3dc532862b3ce53f731f87da4d3adda37ae854c82e5bfc6258d7b5cc3746695366c1b86059336909b1de1dbd7360b1c1986a9d7
7
+ data.tar.gz: dd87b9498fcf43e04ac1c365c0d8a8989b88f5bf3c5aee720313c2350f9d374fb293aaad1cfc3e7e920f2416a46c9c124680188297ba207b74da3cc023c895a4
@@ -1,13 +1,50 @@
1
- <!DOCTYPE html>
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
- <%= stylesheet_link_tag "caboose/admin", :media => "all" %>
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
- <%= javascript_include_tag "caboose/admin" %>
32
- <%= yield :caboose_js %>
68
+ <%= raw js %>
33
69
  </body>
34
70
  </html>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.55'
2
+ VERSION = '0.8.56'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.55
4
+ version: 0.8.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry