diff options
-rw-r--r-- | app/helpers/application_helper.rb | 3 | ||||
-rw-r--r-- | app/views/projects/_members_box.html.erb | 2 | ||||
-rw-r--r-- | test/helpers/application_helper_test.rb | 2 |
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 |