You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html.erb 1.5KB

12345678910111213141516171819202122232425262728293031323334
  1. <div class="contextual">
  2. <%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
  3. :onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' if User.current.allowed_to?(:manage_documents, @project) %>
  4. </div>
  5. <div id="add-document" style="display:none;">
  6. <h2><%=l(:label_document_new)%></h2>
  7. <%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
  8. <%= render :partial => 'form', :locals => {:f => f} %>
  9. <p>
  10. <%= submit_tag l(:button_create) %>
  11. <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
  12. </p>
  13. <% end %>
  14. </div>
  15. <h2><%=l(:label_document_plural)%></h2>
  16. <% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
  17. <% @grouped.keys.sort.each do |group| %>
  18. <h3><%= group %></h3>
  19. <%= render :partial => 'documents/document', :collection => @grouped[group] %>
  20. <% end %>
  21. <% content_for :sidebar do %>
  22. <h3><%= l(:label_sort_by, '') %></h3>
  23. <%= link_to l(:field_category), {:sort_by => 'category'}, :class => (@sort_by == 'category' ? 'selected' :nil) %><br />
  24. <%= link_to l(:label_date), {:sort_by => 'date'}, :class => (@sort_by == 'date' ? 'selected' :nil) %><br />
  25. <%= link_to l(:field_title), {:sort_by => 'title'}, :class => (@sort_by == 'title' ? 'selected' :nil) %><br />
  26. <%= link_to l(:field_author), {:sort_by => 'author'}, :class => (@sort_by == 'author' ? 'selected' :nil) %>
  27. <% end %>
  28. <% html_title(l(:label_document_plural)) -%>