Feature #14759
closedAdding project ID to CSS classes at least in issue screen (but whereever it is possibe)
0%
Description
I would appreciate to have textual project ID (not a database numeric ID but the text typed into project form) in page's CSS classes - at leas for issue related pages, but it would be great to have it in all project - related pages (wiki, noews ... etc).
It would allow to distinct renrering of the same part of screend in different projects using custom CSS files.
Concrete use case is that we have UAT (acceptance testing) subrojects of each project, that are targeted to end users with minimal computer experiences. We allows only single tracker in this project (UAT_bug) and want hide all page elements that are not absolutely neccesdsary to make this page as simple as possible. 
Since we use redmine for lots of different project type and project-specific settings are limitted, it is not so easy to configure look of issue page in each project differently. I guess this would be a way how to achieve this.
Another way (maybe better) would be to add additional field to project setting (let say "Project category" that's value (if set) would be passed to the CSS class. But in this case I still would put there the project ID.
Related issues
      
      Updated by Radek  Terber about 12 years ago
      
    
    Also it would be great to add CSS class about tracker and perhaps about issue status into both "static" abd "dynamic" part of issue screen. "Static" part means that which is shown only (and cannot be changed), "dynamic" part meand the form for issue editing.
      
      Updated by Daniel Felix about 12 years ago
      
    
    You can achive this by adding just one line here: source:/trunk/app/helpers/application_helper.rb#L491
For example replace:
  def body_css_classes
    css = []
    if theme = Redmine::Themes.theme(Setting.ui_theme)
      css << 'theme-' + theme.name
    end
    css << 'controller-' + controller_name
    css << 'action-' + action_name
    css.join(' ')
  end 
	with this:
  def body_css_classes
    css = []
    if theme = Redmine::Themes.theme(Setting.ui_theme)
      css << 'theme-' + theme.name
    end
    css << 'project-'+@project.identifier if @project
    css << 'controller-' + controller_name
    css << 'action-' + action_name
    css.join(' ')
  end 
	Please note:
css << 'project-'+@project.identifier if @project
	Best regards,
Daniel
      
      Updated by Mischa The Evil about 12 years ago
      
    
    - Category set to UI
 - Status changed from New to Closed
 
      
      Updated by Mischa The Evil about 12 years ago
      
    
    - Related to Patch #14767: More CSS classes on various fields added