Feature #43797
closedShow file-type icons instead of paperclip icons in attachment lists
Description
Redmine currently displays a paperclip icon in front of each attachment in containers such as issues and Wiki pages.
In many modern applications, the paperclip icon is mainly used to represent an attachment action (attach a file) or the fact that an object has attachments. It is not commonly used as a generic “file” icon for each item in an attachment list.
This issue proposes to replace the paperclip icon with a file-type icon (PDF, image, zip, text, etc.), so users can quickly understand what kind of files are attached, especially when there are many attachments.
Redmine already shows file-type icons in the repository browser. This patch applies the same approach to attachment lists across Redmine.
Before:

Files
Related issues
Updated by Go MAEDA 21 days ago
- File 0001-Change-IconsHelper-icon_for_mime_type-to-accept-raw-.patch 0001-Change-IconsHelper-icon_for_mime_type-to-accept-raw-.patch added
- File 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch added
I am attaching patches.
Updated by Go MAEDA 21 days ago
- File 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch added
I updated the patch.
The original patch made IconsHelper#icon_for_mime_type public because ApplicationHelper#link_to_attachment required an icon name and therefore had to call icon_for_mime_type to determine the icon name before calling link_to_attachment. After improving link_to_attachment to choose the icon internally based on the attachment's content type when the icon: :auto option is passed, calling icon_for_mime_type is no longer necessary and it can remain private.
Updated by Go MAEDA 19 days ago
- File 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch 0002-Update-attachments-list-to-show-MIME-type-icons-inst.patch added
I have updated the patch again.
This patch reverts the change to ApplicationHelper#link_to_attachment made by the patch attached to #note-2.
Since the private method IconsHelper#icon_for_mime_type can be called from the app/views/attachments/_links.html.erb partial, the change to ApplicationHelper#link_to_attachment was unnecessary.
I wrote the following in #note-2, but I overlooked the fact that the private method icon_for_mime_type can be called from app/views/attachments/_links.html.erb.
Go MAEDA wrote in #note-2:
The original patch made
IconsHelper#icon_for_mime_typepublic becauseApplicationHelper#link_to_attachmentrequired an icon name and therefore had to callicon_for_mime_typeto determine the icon name before callinglink_to_attachment. After improvinglink_to_attachmentto choose the icon internally based on the attachment's content type when theicon: :autooption is passed, callingicon_for_mime_typeis no longer necessary and it can remain private.
Updated by Go MAEDA 18 days ago
- Related to Feature #43805: Update file-type icons for additional MIME types added