changeset 254:0c9da2b87ad6 feature_80

Naively display download "active" status in downloads page, and allow sorting by it
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 03 Mar 2011 18:31:22 +0000
parents 82caabe96ad4
children a7002a8f0eca
files app/controllers/files_controller.rb app/views/files/index.html.erb config/locales/en.yml
diffstat 3 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/files_controller.rb	Thu Mar 03 15:30:43 2011 +0000
+++ b/app/controllers/files_controller.rb	Thu Mar 03 18:31:22 2011 +0000
@@ -10,6 +10,7 @@
   def index
     sort_init 'filename', 'asc'
     sort_update 'filename' => "#{Attachment.table_name}.filename",
+		'active' => "#{Attachment.table_name}.active",
                 'created_on' => "#{Attachment.table_name}.created_on",
                 'size' => "#{Attachment.table_name}.filesize",
                 'downloads' => "#{Attachment.table_name}.downloads"
--- a/app/views/files/index.html.erb	Thu Mar 03 15:30:43 2011 +0000
+++ b/app/views/files/index.html.erb	Thu Mar 03 18:31:22 2011 +0000
@@ -8,6 +8,7 @@
 
 <table class="list files">
   <thead><tr>
+    <%= sort_header_tag('active', :caption => l(:field_current)) %>
     <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
     <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
     <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
@@ -27,6 +28,7 @@
 	<% end -%>
   <% container.attachments.each do |file| %>		
   <tr class="file <%= cycle("odd", "even") %>">
+    <td class="active"><%= file.active? %></td>
     <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
     <td class="created_on"><%= format_time(file.created_on) %></td>
     <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
--- a/config/locales/en.yml	Thu Mar 03 15:30:43 2011 +0000
+++ b/config/locales/en.yml	Thu Mar 03 18:31:22 2011 +0000
@@ -859,6 +859,7 @@
   version_status_closed: closed
 
   field_active: Active
+  field_current: Current
   
   text_select_mail_notifications: Select actions for which email notifications should be sent.
   text_regexp_info: eg. ^[A-Z0-9]+$