2007-03-12 20:59:02 +03:00
|
|
|
<div class="contextual">
|
|
|
|
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit' %>
|
|
|
|
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%= @document.title %></h2>
|
|
|
|
|
|
|
|
<p><em><%= @document.category.name %><br />
|
|
|
|
<%= format_date @document.created_on %></em></p>
|
2007-05-28 16:15:19 +04:00
|
|
|
<%= textilizable @document.description, :attachments => @document.attachments %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<br />
|
|
|
|
|
|
|
|
<h3><%= l(:label_attachment_plural) %></h3>
|
2006-12-26 13:11:55 +03:00
|
|
|
<ul class="documents">
|
2006-10-08 14:42:50 +04:00
|
|
|
<% for attachment in @attachments %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<li>
|
|
|
|
<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), :method => :post, :class => 'icon icon-del' %>
|
|
|
|
</div>
|
|
|
|
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
|
|
|
|
(<%= number_to_human_size attachment.filesize %>)<br />
|
2007-09-15 19:20:08 +04:00
|
|
|
<span class="author"><%= authoring attachment.created_on, attachment.author %></span><br />
|
2007-03-12 20:59:02 +03:00
|
|
|
<%= lwr(:label_download, attachment.downloads) %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
|
|
<% if authorize_for('documents', 'add_attachment') %>
|
2007-04-09 21:59:31 +04:00
|
|
|
<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
|
2007-04-23 01:19:16 +04:00
|
|
|
<% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
|
2007-05-27 16:38:29 +04:00
|
|
|
<%= render :partial => 'attachments/form' %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<%= submit_tag l(:button_add) %>
|
|
|
|
<% end %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|