2006-12-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
|
|
|
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'pic picEdit' %>
|
|
|
|
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
|
|
</div>
|
|
|
|
|
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 %>
|
|
|
|
<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-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
|
|
|
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
|
|
</div>
|
2006-12-01 01:00:35 +03:00
|
|
|
<%= 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 %>
|