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.7KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <div class="contextual">
  2. <%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
  3. :onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_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 => '$("#add-document").hide(); return false;' %>
  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.__send__(@sort_by == 'date' ? :reverse_each : :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. <ul>
  24. <li><%= link_to(l(:field_category), {:sort_by => 'category'},
  25. :class => (@sort_by == 'category' ? 'selected' :nil)) %></li>
  26. <li><%= link_to(l(:label_date), {:sort_by => 'date'},
  27. :class => (@sort_by == 'date' ? 'selected' :nil)) %></li>
  28. <li><%= link_to(l(:field_title), {:sort_by => 'title'},
  29. :class => (@sort_by == 'title' ? 'selected' :nil)) %></li>
  30. <li><%= link_to(l(:field_author), {:sort_by => 'author'},
  31. :class => (@sort_by == 'author' ? 'selected' :nil)) %></li>
  32. </ul>
  33. <% end %>
  34. <% html_title(l(:label_document_plural)) -%>