Actions
Defect #26778
closedInvalid "theme-*" CSS class in body element when theme name contains spaces
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
The body element in HTML has CSS classes correspond to the current theme, project, controller and action.
But "theme-*" class name is broken when the directory name of the theme includes "_" or " ". Assume that you have installed a theme whose directory name is "foo_bar". Redmine will generate a class name "theme-Foo bar". But it is clearly broken because a whitespace is used as a separater.
Here is an example.
<body class="theme-Foo bar project-ecookbook controller-issues action-index avatars-off">
Files
Updated by Go MAEDA 2 months ago
I propose the following change:
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b11619088..8d390d6f7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -863,7 +863,7 @@ module ApplicationHelper
def body_css_classes
css = []
if theme = Redmine::Themes.theme(Setting.ui_theme)
- css << 'theme-' + theme.name
+ css << 'theme-' + theme.name.tr(' ', '_')
end
css << 'project-' + @project.identifier if @project && @project.identifier.present?
Updated by Go MAEDA 2 months ago
- File 26778.patch 26778.patch added
- Target version set to 6.0.0
Setting the target version to 6.0.0.
Updated by Go MAEDA 2 months ago
- Subject changed from Wrong CSS class for themes if its name includes "_" or " " to Invalid "theme-*" CSS class in body element when theme name contains spaces
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch in r23144.
Actions