show.rhtml
36 lines
| 1.8 KiB
| text/html+ruby
|
RhtmlLexer
|
r330 | <div class="contextual"> | ||
|
r793 | <%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %> | ||
|
r330 | <%= 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> | ||||
|
r549 | <%= textilizable @document.description, :attachments => @document.attachments %> | ||
|
r330 | <br /> | ||
<h3><%= l(:label_attachment_plural) %></h3> | ||||
|
r114 | <ul class="documents"> | ||
|
r22 | <% for attachment in @attachments %> | ||
|
r330 | <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 /> | ||||
|
r721 | <span class="author"><%= authoring attachment.created_on, attachment.author %></span><br /> | ||
|
r330 | <%= lwr(:label_download, attachment.downloads) %> | ||
</li> | ||||
<% end %> | ||||
</ul> | ||||
<br /> | ||||
<% if authorize_for('documents', 'add_attachment') %> | ||||
|
r434 | <p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p> | ||
|
r466 | <% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %> | ||
|
r545 | <%= render :partial => 'attachments/form' %> | ||
|
r330 | <%= submit_tag l(:button_add) %> | ||
<% end %> | ||||
|
r2 | <% end %> | ||