diff -r 4169862209f5 app/controllers/application_controller.rb --- a/app/controllers/application_controller.rb Sun Jan 19 02:44:29 2020 +0000 +++ b/app/controllers/application_controller.rb Tue Jan 21 07:36:44 2020 +0100 @@ -529,6 +529,12 @@ request.xhr? ? false : 'base' end + #adds css class to body tag of layout + def add_body_css_class(css_class) + @css ||= [] + @css << css_class + end + def render_feed(items, options={}) @items = (items || []).to_a @items.sort! {|x,y| y.event_datetime <=> x.event_datetime } diff -r 4169862209f5 app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb Sun Jan 19 02:44:29 2020 +0000 +++ b/app/helpers/application_helper.rb Tue Jan 21 07:36:44 2020 +0100 @@ -637,20 +637,20 @@ # Returns the theme, controller name, and action as css classes for the # HTML body. def body_css_classes - css = [] + @css ||= [] if theme = Redmine::Themes.theme(Setting.ui_theme) - css << 'theme-' + theme.name + @css << 'theme-' + theme.name end - css << 'project-' + @project.identifier if @project && @project.identifier.present? - css << 'has-main-menu' if display_main_menu?(@project) - css << 'controller-' + controller_name - css << 'action-' + action_name - css << 'avatars-' + (Setting.gravatar_enabled? ? 'on' : 'off') + @css << 'project-' + @project.identifier if @project && @project.identifier.present? + @css << 'has-main-menu' if display_main_menu?(@project) + @css << 'controller-' + controller_name + @css << 'action-' + action_name + @css << 'avatars-' + (Setting.gravatar_enabled? ? 'on' : 'off') if UserPreference::TEXTAREA_FONT_OPTIONS.include?(User.current.pref.textarea_font) - css << "textarea-#{User.current.pref.textarea_font}" + @css << "textarea-#{User.current.pref.textarea_font}" end - css.join(' ') + @css.join(' ') end def accesskey(s)