How to add file listing description?

Added by Ben Siroshton over 11 years ago

I'm using Redmine 1.1.2, how can I display the file description in the file listing view for projects?

Thanks.

-=ben

Replies (2)

RE: How to add file listing description? - Added by Christina Louise Warne over 11 years ago

Hi Ben,

If you're up for a little code tweaking, you can do this by editing one of the views (make a backup copy of the view just in case).

Open app/views/files/index.html.erb
Find the line that reads (Note: I've tweaked a 1.1.3 install and checked the latest trunk, both have this line in the view):-

<td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>

And change it as you require.

<td class="filename"><b><%= file.description %></b><br /><%= link_to_attachment file, :download => true, :text => file.filename %></td>

This is the tweaked version from my install. This displays the file description in bold, adds a break followed by the existing link. You'll notice that I removed the :title => file.description from the link_to_attachment as it's pretty redundant when the description is on display. Make the change you want to that column in the table, save the file and restart your app.

It should be noted that the sort option on the filename column header still operates on the filename. I did try and tweak that, but that requires changes to the controller app/controllers/files_controller.rb (they are a little beyond my very limited experience with Ruby/Rails at this time).

I've attached a screenshot of the modified view on my install.

Hope this helps

Christina

ModifiedFilesView.PNG - Modified file view sample (11.2 KB)

RE: How to add file listing description? - Added by shravan kumar over 10 years ago

I am not able to fix, could not find this path app/views/files/index.html.erb. I have redmine 1.0.0 stable

(1-2/2)