To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / documents / index.rhtml @ 441:cbce1fd3b1b7

History | View | Annotate | Download (1.9 KB)

1
<div class="contextual">
2
<%= link_to_if_authorized l(:label_document_new),
3
                          {:controller => 'documents', :action => 'new', :project_id => @project},
4
                          :class => 'icon icon-add',
5
                          :onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' %>
6
</div>
7

    
8
<div id="add-document" style="display:none;">
9
<h2><%=l(:label_document_new)%></h2>
10
<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
11
<%= render :partial => 'documents/form' %>
12
<div class="box">
13
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
14
</div>
15
<%= submit_tag l(:button_create) %>
16
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
17
<% end %>
18
</div>
19

    
20
<h2><%=l(:label_document_plural)%></h2>
21

    
22
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
23

    
24
<% @grouped.keys.sort.each do |group| %>
25
    <h3><%= group %></h3>
26
    <%= render :partial => 'documents/document', :collection => @grouped[group] %>
27
<% end %>
28

    
29
<% content_for :sidebar do %>
30
    <h3><%= l(:label_sort_by, '') %></h3>
31
    <% form_tag({}, :method => :get) do %>
32
    <label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br />
33
    <label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br />
34
    <label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br />
35
    <label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label>
36
    <% end %>
37
<% end %>
38

    
39
<% html_title(l(:label_document_plural)) -%>