@@ -1,37 +1,38 | |||
|
1 | 1 | <div class="contextual"> |
|
2 | 2 | <%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit' %> |
|
3 | 3 | <%= 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' %> |
|
4 | 4 | </div> |
|
5 | 5 | |
|
6 | 6 | <h2><%= @document.title %></h2> |
|
7 | 7 | |
|
8 | 8 | <p><em><%= @document.category.name %><br /> |
|
9 | 9 | <%= format_date @document.created_on %></em></p> |
|
10 | 10 | <%= textilizable @document.description %> |
|
11 | 11 | <br /> |
|
12 | 12 | |
|
13 | 13 | <h3><%= l(:label_attachment_plural) %></h3> |
|
14 | 14 | <ul class="documents"> |
|
15 | 15 | <% for attachment in @attachments %> |
|
16 | 16 | <li> |
|
17 | 17 | <div class="contextual"> |
|
18 | 18 | <%= 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' %> |
|
19 | 19 | </div> |
|
20 | 20 | <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> |
|
21 | 21 | (<%= number_to_human_size attachment.filesize %>)<br /> |
|
22 | 22 | <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br /> |
|
23 | 23 | <%= lwr(:label_download, attachment.downloads) %> |
|
24 | 24 | </li> |
|
25 | 25 | <% end %> |
|
26 | 26 | </ul> |
|
27 | 27 | <br /> |
|
28 | 28 | |
|
29 | 29 | |
|
30 | 30 | <% if authorize_for('documents', 'add_attachment') %> |
|
31 | <% form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") do %> | |
|
31 | <p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p> | |
|
32 | <% form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %> | |
|
32 | 33 | <p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%> |
|
33 | 34 | <%= image_to_function "add.png", "addFileField();return false" %></label> |
|
34 | 35 | <%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p> |
|
35 | 36 | <%= submit_tag l(:button_add) %> |
|
36 | 37 | <% end %> |
|
37 | 38 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now