Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#47769] Adjust apperance of storage links to new styles.

Pavel Balashov347a7e1461cd
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index 66df1bc322f..c9f872c6926 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -36,9 +36,8 @@ module IconsHelper
%(<i class="#{classnames}" #{title} aria-hidden="true"></i>).html_safe
end
- def spot_icon(icon_name, title: nil)
- classnames = "spot-icon spot-icon_#{icon_name}"
- content_tag(:span, title, class: classnames.to_s)
+ def spot_icon(icon_name, title: nil, classnames: nil)
+ content_tag(:span, title, class: "spot-icon spot-icon_#{icon_name} #{classnames}")
end
##
diff --git a/frontend/src/global_styles/common/menu/menu.sass b/frontend/src/global_styles/common/menu/menu.sass
index dfb6e7120df..fa2022b273e 100644
--- a/frontend/src/global_styles/common/menu/menu.sass
+++ b/frontend/src/global_styles/common/menu/menu.sass
@@ -10,14 +10,6 @@
overflow: hidden
text-overflow: ellipsis
- > .spot-icon
- width: 1.25rem
- height: 1.25rem
- margin-left: 0.25rem
- margin-right: 0
- color: var(--primary-color--minor1)
-
-
&-action
display: block
height: 32px
@@ -31,6 +23,9 @@
width: 1.25rem
height: 1.25rem
+ &.icon-after
+ margin-left: auto
+
&:first-child
margin-right: 0.75rem
diff --git a/lib/redmine/menu_manager/menu_helper.rb b/lib/redmine/menu_manager/menu_helper.rb
index bb7bdebc30f..d4982242e72 100644
--- a/lib/redmine/menu_manager/menu_helper.rb
+++ b/lib/redmine/menu_manager/menu_helper.rb
@@ -170,11 +170,14 @@ module Redmine::MenuManager::MenuHelper
title_text = ''.html_safe + content_tag(:span, caption) + badge_for(item)
if item.enterprise_feature.present? && !EnterpriseToken.allows_to?(item.enterprise_feature)
title_text << (''.html_safe + spot_icon('enterprise-addons'))
- elsif item.icon_after.present?
- title_text << (''.html_safe + spot_icon(item.icon_after))
end
title_text
end
+
+ if item.icon_after.present?
+ link_text << (''.html_safe + spot_icon(item.icon_after, classnames: "icon-after"))
+ end
+
html_options = item.html_options(selected:)
html_options[:title] ||= selected ? t(:description_current_position) + caption : caption
html_options[:class] = "#{html_options[:class]} #{menu_class}--item-action"