# HG changeset patch # User Chris Cannam # Date 1299180902 0 # Node ID a7002a8f0eca47aa530985955536833f87899a7a # Parent 0c9da2b87ad609c61d00795b424af7927a947119 Show a star (or similar) by active files, or a checkbox if permitted to edit them. Checkbox doesn't do anything yet diff -r 0c9da2b87ad6 -r a7002a8f0eca app/views/files/index.html.erb --- a/app/views/files/index.html.erb Thu Mar 03 18:31:22 2011 +0000 +++ b/app/views/files/index.html.erb Thu Mar 03 19:35:02 2011 +0000 @@ -5,14 +5,15 @@

<%=l(:label_attachment_plural)%>

<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> +<% active_change_allowed = delete_allowed %> - <%= sort_header_tag('active', :caption => l(:field_current)) %> + <%= sort_header_tag('active', :caption => l(:label_new)) %> <%= 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') %> - <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> + <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc') %> @@ -21,15 +22,21 @@ <% next if container.attachments.empty? -%> <% if container.is_a?(Version) -%> - <% end -%> <% container.attachments.each do |file| %> "> - - + + diff -r 0c9da2b87ad6 -r a7002a8f0eca public/themes/soundsoftware/stylesheets/application.css --- a/public/themes/soundsoftware/stylesheets/application.css Thu Mar 03 18:31:22 2011 +0000 +++ b/public/themes/soundsoftware/stylesheets/application.css Thu Mar 03 19:35:02 2011 +0000 @@ -141,6 +141,8 @@ #top-menu a.administration { background-image: url(../images/wrench.png); } #top-menu a.help { background-image: url(../../../images/help.png); } +.file .active { font-weight: bold; } + /* for Javadoc in Embedded context: */ .TableHeadingColor { background-color: #fdf7e4; color: #3e442c; border: 0px solid #fff; }
MD5
+ <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
<%= file.active? %><%= link_to_attachment file, :download => true, :title => file.description %> + <% if active_change_allowed -%> + <%= check_box_tag 'active', file.id, file.active? %> + <% else -%> + <%= image_tag('fav.png') if file.active? %> + <% end -%> + "><%= link_to_attachment file, :download => true, :title => file.description %> <%= format_time(file.created_on) %> <%= number_to_human_size(file.filesize) %> <%= file.downloads %>