2007-03-12 20:59:02 +03:00
|
|
|
<div class="contextual">
|
2011-11-30 23:51:16 +04:00
|
|
|
<%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
|
2013-01-20 15:38:20 +04:00
|
|
|
:onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %>
|
2007-10-18 20:59:28 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-document" style="display:none;">
|
|
|
|
<h2><%=l(:label_document_new)%></h2>
|
2012-04-25 21:17:49 +04:00
|
|
|
<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
|
2011-11-30 23:51:16 +04:00
|
|
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
|
|
<p>
|
2013-03-15 18:15:34 +04:00
|
|
|
<%= submit_tag l(:button_create) %>
|
2012-07-22 17:29:26 +04:00
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
|
2011-11-30 23:51:16 +04:00
|
|
|
</p>
|
2007-10-18 20:59:28 +04:00
|
|
|
<% end %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%=l(:label_document_plural)%></h2>
|
|
|
|
|
2007-11-04 14:15:04 +03:00
|
|
|
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
|
|
|
|
|
|
|
|
<% @grouped.keys.sort.each do |group| %>
|
|
|
|
<h3><%= group %></h3>
|
|
|
|
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% end %>
|
2007-03-12 20:59:02 +03:00
|
|
|
|
2007-11-04 14:15:04 +03:00
|
|
|
<% content_for :sidebar do %>
|
2012-01-17 00:02:43 +04:00
|
|
|
<h3><%= l(:label_sort_by, '') %></h3>
|
2013-05-03 12:09:47 +04:00
|
|
|
<ul>
|
|
|
|
<li><%= link_to(l(:field_category), {:sort_by => 'category'},
|
|
|
|
:class => (@sort_by == 'category' ? 'selected' :nil)) %></li>
|
|
|
|
<li><%= link_to(l(:label_date), {:sort_by => 'date'},
|
|
|
|
:class => (@sort_by == 'date' ? 'selected' :nil)) %></li>
|
|
|
|
<li><%= link_to(l(:field_title), {:sort_by => 'title'},
|
|
|
|
:class => (@sort_by == 'title' ? 'selected' :nil)) %></li>
|
|
|
|
<li><%= link_to(l(:field_author), {:sort_by => 'author'},
|
|
|
|
:class => (@sort_by == 'author' ? 'selected' :nil)) %></li>
|
|
|
|
</ul>
|
2007-11-04 14:15:04 +03:00
|
|
|
<% end %>
|
2007-12-07 21:42:40 +03:00
|
|
|
|
2008-01-03 01:41:53 +03:00
|
|
|
<% html_title(l(:label_document_plural)) -%>
|