<%= 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_plural)%>

<% if @documents.empty? %>

<%= l(:label_no_data) %>

<% end %> <% documents = @documents.group_by {|d| d.category } %> <% documents.each do |category, docs| %>

<%= category.name %>

<%= render :partial => 'documents/document', :collection => docs %> <% end %>