Skip to content

Commit 605dadd

Browse files
committed
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
1 parent 56a7fd2 commit 605dadd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/helpers/application_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ def link_to_principal(principal, options={})
6767
when Group
6868
name = h(principal.to_s)
6969
url = group_url(principal, :only_path => only_path)
70-
css_classes = "group icon icon-#{principal.class.name.downcase}"
70+
css_classes = 'group'
7171
else
7272
name = h(principal.to_s)
7373
end
7474

75+
css_classes += " #{options[:class]}" if options[:class].present?
7576
url ? link_to(name, url, :class => css_classes) : name
7677
end
7778

app/views/projects/_members_box.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="members box">
33
<h3 class="icon icon-group"><%=l(:label_member_plural)%></h3>
44
<% @principals_by_role.keys.sort.each do |role| %>
5-
<p><span class="label"><%= role %>:</span> <%= @principals_by_role[role].sort.collect{|p| link_to_principal p}.join(", ").html_safe %></p>
5+
<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>
66
<% end %>
77
</div>
88
<% end %>

test/helpers/application_helper_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ def test_link_to_principal_should_link_to_user
17151715

17161716
def test_link_to_principal_should_link_to_group
17171717
group = Group.find(10)
1718-
result = link_to('A Team', '/groups/10', :class => 'group icon icon-group')
1718+
result = link_to('A Team', '/groups/10', :class => 'group')
17191719
assert_equal result, link_to_principal(group)
17201720
end
17211721

0 commit comments

Comments
 (0)