Feature #5038
closed
Added by Max Abramowitz over 14 years ago.
Updated over 11 years ago.
Description
It would be nice if there were some options for sorting documents. It appears that documents are listed in the order in which they are added. It would also be nice to sort the documents alphabetically.
Files
Is this still active?
The same request came from my users at the university.
In the 1.0-stable branch r4450 you can sort documents by title, date etc.
but if you had files e.g
"101115 printout" uploaded November 29th and
"101105 printout" uploaded on the same day but 3 minutes later
you get the order shown above if you sort by title even though you would expect it to be the other way around.
- Status changed from New to Resolved
Index: documents_controller.rb
===================================================================
--- documents_controller.rb
+++ documents_controller.rb
@@ -27,7 +27,7 @@
def index
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
- documents = @project.documents.find :all, :include => [:attachments, :category]
+ documents = @project.documents.find :all, :include => [:attachments, :category], :order => 'title ASC'
case @sort_by
when 'date'
@grouped = documents.group_by {|d| d.updated_on.to_date }
Closing this, status is resolved since 400 days and more (issue was last updated more than 400 days ago)...
- Status changed from Resolved to Closed
Document sort on title only appears to be sorting on the first letter of the title, not the entire title.
Also available in: Atom
PDF