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>
|
2006-12-26 13:11:55 +03:00
|
|
|
<ul class="documents">
|
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') %>
|
2007-01-01 14:26:56 +03:00
|
|
|
<%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") %>
|
|
|
|
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
|
|
|
<%= link_to_function image_tag('add'), "addFileField()" %></label>
|
2007-01-01 15:09:09 +03:00
|
|
|
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
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 %>
|