2006-06-28 22:11:03 +04:00
|
|
|
<h2><%= @document.title %></h2>
|
|
|
|
|
2006-12-01 01:00:35 +03:00
|
|
|
<p><em><%= @document.category.name %><br />
|
|
|
|
<%= format_date @document.created_on %></em></p>
|
|
|
|
<%= textilizable @document.description %>
|
2006-06-28 22:11:03 +04:00
|
|
|
|
|
|
|
|
2006-12-01 01:00:35 +03:00
|
|
|
<table width="100%">
|
|
|
|
<tr><td><%= link_to_if_authorized l(:button_edit), :controller => 'documents', :action => 'edit', :id => @document %></td>
|
|
|
|
<td align="right">
|
2006-06-28 22:11:03 +04:00
|
|
|
<% if authorize_for('documents', 'destroy') %>
|
2006-07-29 23:54:22 +04:00
|
|
|
<%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %>
|
|
|
|
<%= submit_tag l(:button_delete) %>
|
2006-12-01 01:00:35 +03:00
|
|
|
<%= end_form_tag %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|
2006-12-01 01:00:35 +03:00
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
<br />
|
2006-06-28 22:11:03 +04:00
|
|
|
|
2006-12-01 01:00:35 +03:00
|
|
|
<h3><%= l(:label_attachment_plural) %></h3>
|
|
|
|
<ul>
|
2006-10-08 14:42:50 +04:00
|
|
|
<% for attachment in @attachments %>
|
2006-12-01 01:00:35 +03:00
|
|
|
<li>
|
2006-12-01 01:17:44 +03:00
|
|
|
<% if authorize_for('documents', 'destroy_attachment') %>
|
2006-12-01 01:00:35 +03:00
|
|
|
<div style="float:right;padding:6px;">
|
2006-12-01 01:17:44 +03:00
|
|
|
<%= start_form_tag({ :controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment } ) %>
|
2006-12-01 01:00:35 +03:00
|
|
|
<%= submit_tag l(:button_delete), :class => 'button-small' %>
|
|
|
|
<%= end_form_tag %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
|
|
|
|
(<%= human_size attachment.filesize %>)<br />
|
|
|
|
<em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br />
|
|
|
|
<%= lwr(:label_download, attachment.downloads) %>
|
|
|
|
</li>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|
2006-12-01 01:00:35 +03:00
|
|
|
</ul>
|
2006-06-28 22:11:03 +04:00
|
|
|
<br />
|
|
|
|
|
2006-12-01 01:00:35 +03:00
|
|
|
|
2006-06-28 22:11:03 +04:00
|
|
|
<% if authorize_for('documents', 'add_attachment') %>
|
|
|
|
<%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true) %>
|
2006-12-01 01:00:35 +03:00
|
|
|
<label><%=l(:label_attachment_new)%></label>
|
|
|
|
<%= file_field 'attachment', 'file' %>
|
2006-07-29 23:54:22 +04:00
|
|
|
<%= submit_tag l(:button_add) %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<%= end_form_tag %>
|
|
|
|
<% end %>
|