Browse Source

Added css classes to the HTML body based on the theme, controller, and action. #819

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3911 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/1.1.0
Eric Davis 14 years ago
parent
commit
a544a1e57c
2 changed files with 14 additions and 1 deletions
  1. 13
    0
      app/helpers/application_helper.rb
  2. 1
    1
      app/views/layouts/base.rhtml

+ 13
- 0
app/helpers/application_helper.rb View File

@@ -393,6 +393,19 @@ module ApplicationHelper
end
end

# Returns the theme, controller name, and action as css classes for the
# HTML body.
def body_css_classes
css = []
if theme = Redmine::Themes.theme(Setting.ui_theme)
css << 'theme-' + theme.name
end

css << 'controller-' + params[:controller]
css << 'action-' + params[:action]
css.join(' ')
end

def accesskey(s)
Redmine::AccessKeys.key_for s
end

+ 1
- 1
app/views/layouts/base.rhtml View File

@@ -19,7 +19,7 @@
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<body>
<body class="<%= body_css_classes %>">
<div id="wrapper">
<div id="wrapper2">
<div id="top-menu">

Loading…
Cancel
Save