From: Jean-Philippe Lang Date: Sun, 29 Sep 2013 15:34:25 +0000 (+0000) Subject: Adds a project specific css class to body (#14767). X-Git-Tag: 2.4.0~90 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=481a1311b75e696ccecb487b6ab4cd8686111988;p=redmine.git Adds a project specific css class to body (#14767). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12170 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cac90d04..4b33e15f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -488,6 +488,7 @@ module ApplicationHelper css << 'theme-' + theme.name end + css << 'project-' + @project.identifier if @project && @project.identifier.present? css << 'controller-' + controller_name css << 'action-' + action_name css.join(' ') diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index c8bd19c5e..79721d589 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -589,4 +589,9 @@ class ProjectsControllerTest < ActionController::TestCase assert_response :success assert_template 'show' end + + def test_body_should_have_project_css_class + get :show, :id => 1 + assert_select 'body.project-ecookbook' + end end