]> source.dussan.org Git - redmine.git/commitdiff
Set "icon icon-group" CSS classes in _members_box.html.erb instead of ApplicationHele...
authorGo MAEDA <maeda@farend.jp>
Tue, 20 Jul 2021 21:35:06 +0000 (21:35 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 20 Jul 2021 21:35:06 +0000 (21:35 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@21074 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/views/projects/_members_box.html.erb
test/helpers/application_helper_test.rb

index ae0094872f1a54256840d78294a5dbdc0792e281..be3f40a94fc0332cca2bc1a09aa6463d4aace538 100644 (file)
@@ -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
 
index ff7170e488a23d802ae281cc758c5795475f16a0..b5bb46e3a50a7dd3ab59c1631c8ad286aae91fba 100644 (file)
@@ -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 %>
index 384b7a3838e2ce7b50e345456d5d8223cd73595a..2a11575d6649f11df809911791f29d59dba0ab74 100644 (file)
@@ -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