diff options
Diffstat (limited to 'app/views/projects/list_documents.rhtml')
-rw-r--r-- | app/views/projects/list_documents.rhtml | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/views/projects/list_documents.rhtml b/app/views/projects/list_documents.rhtml index 595b15fd1..bb272ee86 100644 --- a/app/views/projects/list_documents.rhtml +++ b/app/views/projects/list_documents.rhtml @@ -19,12 +19,19 @@ <h2><%=l(:label_document_plural)%></h2> -<% if @documents.empty? %> -<p class="nodata"><%= l(:label_no_data) %></p> +<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %> + +<% @grouped.keys.sort.each do |group| %> + <h3><%= group %></h3> + <%= render :partial => 'documents/document', :collection => @grouped[group] %> <% end %> -<% documents = @documents.group_by {|d| d.category } %> -<% documents.each do |category, docs| %> - <h3><%= category.name %></h3> - <%= render :partial => 'documents/document', :collection => docs %> -<% end %>
\ No newline at end of file +<% content_for :sidebar do %> + <h3><%= l(:label_sort_by, '') %></h3> + <% form_tag({}, :method => :get) do %> + <label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br /> + <label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br /> + <label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br /> + <label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label> + <% end %> +<% end %> |