Skip to content
Snippets Groups Projects
Commit fe74ab8c authored by Jean-Philippe Lang's avatar Jean-Philippe Lang
Browse files

Make the project files list sortable (#997).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1330 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 154f60ed
Branches
Tags
No related merge requests found
...@@ -204,7 +204,10 @@ class ProjectsController < ApplicationController ...@@ -204,7 +204,10 @@ class ProjectsController < ApplicationController
end end
def list_files def list_files
@versions = @project.versions.sort.reverse sort_init "#{Attachment.table_name}.filename", "asc"
sort_update
@versions = @project.versions.find(:all, :include => :attachments, :order => sort_clause).sort.reverse
render :layout => !request.xhr?
end end
# Show changelog for @project # Show changelog for @project
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<table class="list"> <table class="list">
<thead><tr> <thead><tr>
<th><%=l(:field_version)%></th> <th><%=l(:field_version)%></th>
<th><%=l(:field_filename)%></th> <%= sort_header_tag("#{Attachment.table_name}.filename", :caption => l(:field_filename)) %>
<th><%=l(:label_date)%></th> <%= sort_header_tag("#{Attachment.table_name}.created_on", :caption => l(:label_date), :default_order => 'desc') %>
<th><%=l(:field_filesize)%></th> <%= sort_header_tag("#{Attachment.table_name}.filesize", :caption => l(:field_filesize), :default_order => 'desc') %>
<th><%=l(:label_downloads_abbr)%></th> <%= sort_header_tag("#{Attachment.table_name}.downloads", :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
<th>MD5</th> <th>MD5</th>
<% if delete_allowed %><th></th><% end %> <% if delete_allowed %><th></th><% end %>
</tr></thead> </tr></thead>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment