<%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
:onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' if User.current.allowed_to?(:manage_documents, @project) %>
<%=l(:label_document_new)%>
<% labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
<% end %>
<%=l(:label_document_plural)%>
<% if @grouped.empty? %><%= l(:label_no_data) %>
<% end %>
<% @grouped.keys.sort.each do |group| %>
<%= group %>
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
<% end %>
<% content_for :sidebar do %>
<%= l(:label_sort_by, '') %>
<% form_tag({}, :method => :get) do %>
<% end %>
<% end %>
<% html_title(l(:label_document_plural)) -%>