aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/layouts/admin.rhtml5
-rw-r--r--config/environment.rb5
2 files changed, 6 insertions, 4 deletions
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml
index 306af03e7..426a01cf5 100644
--- a/app/views/layouts/admin.rhtml
+++ b/app/views/layouts/admin.rhtml
@@ -3,10 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" >
<title>WhatDoTheyKnow admin<%= @title ? ":" : "" %> <%=@title%></title>
- <%
- # Have to do explicit tag for stylesheet, to get absolute path on main server
- %>
- <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => admin_public_url(stylesheet_path('admin')) }) %>
+ <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %>
</head>
<body>
diff --git a/config/environment.rb b/config/environment.rb
index 76f459889..85e23e8a4 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -97,6 +97,11 @@ end
# Domain for URLs (so can work for scripts, not just web pages)
ActionController::UrlWriter.default_url_options[:host] = MySociety::Config.get("DOMAIN", 'localhost:3000')
+# So that javascript assets use full URL, so proxied admin URLs read javascript OK
+if (MySociety::Config.get("DOMAIN", "") != "")
+ ActionController::Base.asset_host = MySociety::Config.get("DOMAIN", 'localhost:3000')
+end
+
# Monkeypatch! Method to remove individual error messages from an ActiveRecord.
module ActiveRecord
class Errors