2015-03-06 14:55:21 +08:00
|
|
|
<div class="project_r_h">
|
|
|
|
<h2 class="project_h2"><%=l(:label_document_plural)%></h2>
|
|
|
|
</div>
|
2013-08-01 10:33:49 +08:00
|
|
|
<div class="contextual">
|
2013-08-06 21:08:11 +08:00
|
|
|
<!--Moved by young-->
|
2013-08-06 20:55:34 +08:00
|
|
|
<%= l(:label_documents_sort) %>
|
|
|
|
<%= link_to l(:field_category), {:sort_by => 'category'}, :class => (@sort_by == 'category' ? 'selected' :nil) %>
|
|
|
|
<%= link_to l(:label_date), {:sort_by => 'date'}, :class => (@sort_by == 'date' ? 'selected' :nil) %>
|
|
|
|
<%= link_to l(:field_title), {:sort_by => 'title'}, :class => (@sort_by == 'title' ? 'selected' :nil) %>
|
|
|
|
<%= link_to l(:field_author), {:sort_by => 'author'}, :class => (@sort_by == 'author' ? 'selected' :nil) %>
|
|
|
|
|
|
2013-08-06 21:08:11 +08:00
|
|
|
<!--Ended by young-->
|
2013-08-06 20:55:34 +08:00
|
|
|
<%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
|
2015-03-06 14:55:21 +08:00
|
|
|
:onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %>
|
2013-08-01 10:33:49 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-document" style="display:none;">
|
2015-03-06 14:55:21 +08:00
|
|
|
<h3>
|
|
|
|
<%=l(:label_document_new)%>
|
|
|
|
</h3>
|
|
|
|
<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
|
|
|
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
|
|
<p>
|
|
|
|
<%= submit_tag l(:button_create) %>
|
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
2013-08-01 10:33:49 +08:00
|
|
|
</div>
|
|
|
|
|
2014-10-27 16:26:31 +08:00
|
|
|
<% if @grouped.empty? %>
|
2015-03-11 15:14:13 +08:00
|
|
|
<p class="nodata" style="margin-top: 30px;">
|
2014-10-27 16:26:31 +08:00
|
|
|
<%= l(:label_no_data) %>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
2013-08-01 10:33:49 +08:00
|
|
|
|
2014-10-27 16:26:31 +08:00
|
|
|
<% if @grouped.has_key? nil %>
|
|
|
|
<% @grouped.keys.each do |group| %>
|
|
|
|
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<% @grouped.keys.sort.each do |group| %>
|
2014-07-22 09:32:46 +08:00
|
|
|
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
|
2014-10-27 16:26:31 +08:00
|
|
|
<% end %>
|
2014-07-22 09:32:46 +08:00
|
|
|
<% end %>
|
2013-08-01 10:33:49 +08:00
|
|
|
|
|
|
|
<% html_title(l(:label_document_plural)) -%>
|