index.html.erb
34 lines
| 1.5 KiB
| text/plain
|
TextLexer
|
r330 | <div class="contextual"> | ||
|
r7890 | <%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add', | ||
:onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' if User.current.allowed_to?(:manage_documents, @project) %> | ||||
|
r838 | </div> | ||
<div id="add-document" style="display:none;"> | ||||
<h2><%=l(:label_document_new)%></h2> | ||||
|
r7890 | <% 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 => 'Element.hide("add-document")' %> | ||||
</p> | ||||
|
r838 | <% end %> | ||
|
r330 | </div> | ||
<h2><%=l(:label_document_plural)%></h2> | ||||
|
r866 | <% 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] %> | ||||
|
r736 | <% end %> | ||
|
r330 | |||
|
r866 | <% content_for :sidebar do %> | ||
|
r8544 | <h3><%= l(:label_sort_by, '') %></h3> | ||
<%= link_to l(:field_category), {:sort_by => 'category'}, :class => (@sort_by == 'category' ? 'selected' :nil) %><br /> | ||||
<%= link_to l(:label_date), {:sort_by => 'date'}, :class => (@sort_by == 'date' ? 'selected' :nil) %><br /> | ||||
<%= link_to l(:field_title), {:sort_by => 'title'}, :class => (@sort_by == 'title' ? 'selected' :nil) %><br /> | ||||
<%= link_to l(:field_author), {:sort_by => 'author'}, :class => (@sort_by == 'author' ? 'selected' :nil) %> | ||||
|
r866 | <% end %> | ||
|
r951 | |||
|
r1019 | <% html_title(l(:label_document_plural)) -%> | ||