%
# See if we're using cloudflare
protocol = 'http://'
if request.env['HTTP_CF_VISITOR'] && request.env['HTTP_CF_VISITOR'].include?('https')
protocol = 'https://'
request.env['REQUEST_URI'] = "https://#{request.env['REQUEST_URI'][7..-1]}" if (request.env['REQUEST_URI'] =~ %r"http://") == 0
request.env['SERVER_PORT'] = '443' if request.env['SERVER_PORT'] == '80'
request.env['HTTP_REFERER'] = "https://#{request.env['HTTP_REFERER'][7..-1]}" if (request.env['HTTP_REFERER'] =~ %r"http://") == 0
request.env['rack.url_scheme'] = 'https'
request.env['HTTPS'] = 'on'
end
content_for :admin_css do
%><%= stylesheet_link_tag "caboose/admin", :media => "all" %>
<%= stylesheet_link_tag "colorbox-rails", :media => "all" %>
<%= stylesheet_link_tag "caboose/model_binder", :media => "all" %>
<%# stylesheet_link_tag "caboose/page_bar_generator", :media => "all" %>
<%
if File.exists?("#{Rails.root}/app/assets/stylesheets/admin.css")
%><%= stylesheet_link_tag "admin", :media => "all" %><%
end
%><%= yield :caboose_css %><%
end
css = yield(:admin_css)
css.gsub!("
<%= javascript_include_tag "caboose/admin" %>
<%= javascript_include_tag "caboose/jquery.detect" %>
<%
%><%= yield :caboose_js %><%
end
js = yield(:admin_js)
js.gsub!("