summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-07-20 21:35:06 +0000
committerGo MAEDA <maeda@farend.jp>2021-07-20 21:35:06 +0000
commit605dadd37465398e0317ca855741e6582cdd0170 (patch)
tree1fc36dbeda0852864fb4ebb684ba9777f2d79730
parent56a7fd22c7af2119980c6dba42606e140383b878 (diff)
downloadredmine-605dadd37465398e0317ca855741e6582cdd0170.tar.gz
redmine-605dadd37465398e0317ca855741e6582cdd0170.zip
Set "icon icon-group" CSS classes in _members_box.html.erb instead of ApplicationHeler (#12795).
git-svn-id: http://svn.redmine.org/redmine/trunk@21074 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/views/projects/_members_box.html.erb2
-rw-r--r--test/helpers/application_helper_test.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ae0094872..be3f40a94 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -67,11 +67,12 @@ module ApplicationHelper
when Group
name = h(principal.to_s)
url = group_url(principal, :only_path => only_path)
- css_classes = "group icon icon-#{principal.class.name.downcase}"
+ css_classes = 'group'
else
name = h(principal.to_s)
end
+ css_classes += " #{options[:class]}" if options[:class].present?
url ? link_to(name, url, :class => css_classes) : name
end
diff --git a/app/views/projects/_members_box.html.erb b/app/views/projects/_members_box.html.erb
index ff7170e48..b5bb46e3a 100644
--- a/app/views/projects/_members_box.html.erb
+++ b/app/views/projects/_members_box.html.erb
@@ -2,7 +2,7 @@
<div class="members box">
<h3 class="icon icon-group"><%=l(:label_member_plural)%></h3>
<% @principals_by_role.keys.sort.each do |role| %>
- <p><span class="label"><%= role %>:</span> <%= @principals_by_role[role].sort.collect{|p| link_to_principal p}.join(", ").html_safe %></p>
+ <p><span class="label"><%= role %>:</span> <%= @principals_by_role[role].sort.collect{|p| link_to_principal(p, :class => p.is_a?(Group) ? 'icon icon-group' : nil)}.join(", ").html_safe %></p>
<% end %>
</div>
<% end %>
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index 384b7a383..2a11575d6 100644
--- a/test/helpers/application_helper_test.rb
+++ b/test/helpers/application_helper_test.rb
@@ -1715,7 +1715,7 @@ class ApplicationHelperTest < Redmine::HelperTest
def test_link_to_principal_should_link_to_group
group = Group.find(10)
- result = link_to('A Team', '/groups/10', :class => 'group icon icon-group')
+ result = link_to('A Team', '/groups/10', :class => 'group')
assert_equal result, link_to_principal(group)
end