<%= link_to_if_authorized l(:label_document_new),
{:controller => 'projects', :action => 'add_document', :id => @project},
:class => 'icon icon-add',
:onclick => 'Element.show("add-document"); return false;' %>
<%=l(:label_document_new)%>
<% form_tag({:action => 'add_document', :id => @project}, :class => "tabular", :multipart => true) do %>
<%= render :partial => 'documents/form' %>
<%= render :partial => 'common/attachments_form'%>
<%= 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 %>