mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Apply the category class on initial page load
This commit is contained in:
parent
6129fda8af
commit
72560b5260
@ -59,6 +59,12 @@ module ApplicationHelper
|
|||||||
"#{mobile_view? ? 'mobile-view' : 'desktop-view'} #{mobile_device? ? 'mobile-device' : 'not-mobile-device'} #{rtl_class} #{current_user ? '' : 'anon'}"
|
"#{mobile_view? ? 'mobile-view' : 'desktop-view'} #{mobile_device? ? 'mobile-device' : 'not-mobile-device'} #{rtl_class} #{current_user ? '' : 'anon'}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def body_classes
|
||||||
|
if @category && @category.url.present?
|
||||||
|
"category-#{@category.url.sub(/^\/c\//, '').gsub(/\//, '-')}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def rtl_class
|
def rtl_class
|
||||||
rtl? ? 'rtl' : ''
|
rtl? ? 'rtl' : ''
|
||||||
end
|
end
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<%= yield :head %>
|
<%= yield :head %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="<%= body_classes %>">
|
||||||
<div class='debug-eyeline'></div>
|
<div class='debug-eyeline'></div>
|
||||||
|
|
||||||
<noscript data-path="<%= request.env['PATH_INFO'] %>">
|
<noscript data-path="<%= request.env['PATH_INFO'] %>">
|
||||||
|
Loading…
Reference in New Issue
Block a user