do not customize the admin section
This commit is contained in:
parent
23deecfe44
commit
07cbf8f4e3
|
@ -112,7 +112,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def login_path
|
||||
return "#{Discourse::base_uri}/login"
|
||||
"#{Discourse::base_uri}/login"
|
||||
end
|
||||
|
||||
def mobile_view?
|
||||
|
@ -128,4 +128,9 @@ module ApplicationHelper
|
|||
# TODO: this is dumb. user agent matching is a doomed approach. a better solution is coming.
|
||||
request.user_agent =~ /Mobile|webOS|Nexus 7/ and !(request.user_agent =~ /iPad/)
|
||||
end
|
||||
|
||||
def customization_disabled?
|
||||
controller.class.name.split("::").first == "Admin" || session[:disable_customization]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -21,6 +21,7 @@ class SiteContent < ActiveRecord::Base
|
|||
add_content_type :privacy_policy, allow_blank: true
|
||||
add_content_type :faq, allow_blank: true
|
||||
|
||||
|
||||
def site_content_type
|
||||
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
|
||||
end
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
<%= stylesheet_link_tag "admin"%>
|
||||
<%-end%>
|
||||
|
||||
<%- unless session[:disable_customization] %>
|
||||
<%- unless customization_disabled? %>
|
||||
<%= SiteCustomization.custom_stylesheet(session[:preview_style], mobile_view? ? :mobile : :desktop) %>
|
||||
<%- end %>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<body>
|
||||
<!--[if IE 9]><script type="text/javascript">ie = "new";</script><![endif]-->
|
||||
|
||||
<%- unless session[:disable_customization] %>
|
||||
<%- unless customization_disabled? %>
|
||||
<%= SiteCustomization.custom_header(session[:preview_style], mobile_view? ? :mobile : :desktop) %>
|
||||
<%- end %>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= discourse_csrf_tags %>
|
||||
</head>
|
||||
<body>
|
||||
<%- unless session[:disable_customization] %>
|
||||
<%- unless customization_disabled? %>
|
||||
<%= SiteCustomization.custom_header(session[:preview_style]) %>
|
||||
<%- end %>
|
||||
<section id='main'>
|
||||
|
|
Loading…
Reference in New Issue