Browse Source

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
tags/2.4.0
Jean-Philippe Lang 10 years ago
parent
commit
481a1311b7
2 changed files with 6 additions and 0 deletions
  1. 1
    0
      app/helpers/application_helper.rb
  2. 5
    0
      test/functional/projects_controller_test.rb

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

@@ -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(' ')

+ 5
- 0
test/functional/projects_controller_test.rb View File

@@ -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

Loading…
Cancel
Save