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