summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-08-04 01:17:45 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-08-04 01:17:45 +0000
commita544a1e57cd6620d0341566230598753677dfc13 (patch)
tree24f4f7c2e8dcf56c1fbc6e818c7187932a618dcd /app/helpers/application_helper.rb
parent07cd12978e524deafcfd81714ce965003c5e29bc (diff)
downloadredmine-a544a1e57cd6620d0341566230598753677dfc13.tar.gz
redmine-a544a1e57cd6620d0341566230598753677dfc13.zip
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
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e40758969..d6fd16a6e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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