# HG changeset patch # User Chris Cannam # Date 1350401249 -3600 # Node ID c09e40c4a410ff8a47b36b949eace15e62f08b8c # Parent fa2a1b6cda26d4824ed436303bed98c148b3079d Display download counts for documents diff -r fa2a1b6cda26 -r c09e40c4a410 app/views/attachments/_links.html.erb --- a/app/views/attachments/_links.html.erb Tue Oct 16 15:25:22 2012 +0100 +++ b/app/views/attachments/_links.html.erb Tue Oct 16 16:27:29 2012 +0100 @@ -2,7 +2,7 @@ <% for attachment in attachments %>

<%= link_to_attachment attachment, :class => 'icon icon-attachment' -%> <%= h(" - #{attachment.description}") unless attachment.description.blank? %> - (<%= number_to_human_size attachment.filesize %>) + (<%= number_to_human_size attachment.filesize %><%= ", " + l(:label_x_downloads, :count => attachment.downloads) unless attachment.downloads == 0 %>) <% if options[:deletable] %> <%= link_to image_tag('delete.png'), attachment_path(attachment), :confirm => l(:text_are_you_sure), diff -r fa2a1b6cda26 -r c09e40c4a410 config/locales/en.yml --- a/config/locales/en.yml Tue Oct 16 15:25:22 2012 +0100 +++ b/config/locales/en.yml Tue Oct 16 16:27:29 2012 +0100 @@ -487,6 +487,10 @@ zero: no projects one: 1 project other: "%{count} projects" + label_x_downloads: + zero: never downloaded + one: downloaded once + other: "downloaded %{count} times" label_project_all: All Projects label_project_latest: Latest projects label_projects_more: More projects