summaryrefslogtreecommitdiffstats
path: root/app/views/projects/list_documents.rhtml
blob: e6cf2b828754fe0cffaab92c4c84570e3b660c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<h2><%=l(:label_document_plural)%></h2>

<% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>

<% documents = @documents.group_by {|d| d.category } %>
<% documents.each do |category, docs| %>
<h3><%= category.name %></h3>
<ul>
<% docs.each do |d| %>
  <li>
    <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b>
    <br />
    <%= truncate d.description, 250 %><br />
    <em><%= format_time(d.created_on) %></em><br />&nbsp;
  </li>		

<% end %>
</ul>
<% end %>

<p>
<%= link_to_if_authorized '&#187; ' + l(:label_document_new), :controller => 'projects', :action => 'add_document', :id => @project %>
</p>