2007-03-12 20:59:02 +03:00
|
|
|
<div class="contextual">
|
2007-10-18 20:59:28 +04:00
|
|
|
<%= 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;' %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-document" style="display:none;">
|
|
|
|
<h2><%=l(:label_document_new)%></h2>
|
|
|
|
<% form_tag({:action => 'add_document', :id => @project}, :class => "tabular", :multipart => true) do %>
|
|
|
|
<%= render :partial => 'documents/form' %>
|
|
|
|
<div class="box">
|
|
|
|
<%= render :partial => 'common/attachments_form'%>
|
|
|
|
</div>
|
|
|
|
<%= submit_tag l(:button_create) %>
|
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
|
|
|
|
<% end %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%=l(:label_document_plural)%></h2>
|
|
|
|
|
2007-09-22 17:17:49 +04:00
|
|
|
<% if @documents.empty? %>
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
|
|
<% end %>
|
2007-03-12 20:59:02 +03:00
|
|
|
|
|
|
|
<% documents = @documents.group_by {|d| d.category } %>
|
|
|
|
<% documents.each do |category, docs| %>
|
|
|
|
<h3><%= category.name %></h3>
|
|
|
|
<%= render :partial => 'documents/document', :collection => docs %>
|
2006-12-16 15:15:31 +03:00
|
|
|
<% end %>
|