Project

General

Profile

Actions

Feature #43797

closed

Show file-type icons instead of paperclip icons in attachment lists

Added by Go MAEDA 21 days ago. Updated 19 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
UI
Target version:
Resolution:
Fixed

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

Related to Redmine - Feature #43805: Update file-type icons for additional MIME typesClosedGo MAEDAActions
Actions #2

Updated by Go MAEDA 21 days ago

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.

Actions #3

Updated by Marius BĂLTEANU 20 days ago

  • Target version set to 7.0.0

Nice improvement!

Actions #4

Updated by Go MAEDA 19 days ago

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_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.

Actions #5

Updated by Go MAEDA 19 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r24402 and r24403.

Actions #6

Updated by Go MAEDA 18 days ago

  • Related to Feature #43805: Update file-type icons for additional MIME types added
Actions

Also available in: Atom PDF