]> source.dussan.org Git - redmine.git/commitdiff
Use double splat operator for icons methods that are extending @sprite_icon@ (#23980).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sun, 10 Nov 2024 15:29:42 +0000 (15:29 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sun, 10 Nov 2024 15:29:42 +0000 (15:29 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@23229 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/icons_helper.rb

index 5654f3a2f82e87845290f4653714d12f6c4668a2..f423a2898235d299fa710f5df0e9c5a04514538a 100644 (file)
@@ -36,20 +36,20 @@ module IconsHelper
     end
   end
 
-  def file_icon(entry, name, size: DEFAULT_ICON_SIZE, css_class: nil)
+  def file_icon(entry, name, **options)
     if entry.is_dir?
-      sprite_icon("folder", name, size: size, css_class: css_class)
+      sprite_icon("folder", name, **options)
     else
       icon_name = icon_for_mime_type(Redmine::MimeType.css_class_of(name))
-      sprite_icon(icon_name, name, size: size, css_class: css_class)
+      sprite_icon(icon_name, name, **options)
     end
   end
 
-  def principal_icon(principal_class, size: DEFAULT_ICON_SIZE, css_class: nil)
-    sprite_icon('group', size: size, css_class: css_class) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class)
+  def principal_icon(principal_class, **options)
+    sprite_icon('group', **options) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class)
   end
 
-  def activity_event_type_icon(event_type, size: DEFAULT_ICON_SIZE, css_class: nil)
+  def activity_event_type_icon(event_type, **options)
     icon_name = case event_type
                 when 'reply'
                   'comments'
@@ -61,7 +61,7 @@ module IconsHelper
                   event_type
                 end
 
-    sprite_icon(icon_name, size: size, css_class: css_class)
+    sprite_icon(icon_name, **options)
   end
 
   private