summaryrefslogtreecommitdiffstats
path: root/app/views/issues
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 15:42:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 15:42:37 +0000
commitf8ef65e8f64111b5bfa45abd42e0e684afd61f07 (patch)
treef38d893e289b9eb42f7732eeb33c225b8379ad41 /app/views/issues
parent6446c312beab7e23162827a79bd9ab6f9e4d7958 (diff)
downloadredmine-f8ef65e8f64111b5bfa45abd42e0e684afd61f07.tar.gz
redmine-f8ef65e8f64111b5bfa45abd42e0e684afd61f07.zip
Attachments can now be added to wiki pages (original patch by Pavol Murin). Only authorized users can add/delete attachments.
Attached images can be displayed inline, using textile image tag (for wiki pages, issue descriptions and forum messages). git-svn-id: http://redmine.rubyforge.org/svn/trunk@541 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/issues')
-rw-r--r--app/views/issues/show.rhtml26
1 files changed, 8 insertions, 18 deletions
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index 1895e7cef..2c4905e9d 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -52,7 +52,7 @@ end %>
<% end %>
<b><%=l(:field_description)%> :</b><br /><br />
-<%= textilizable @issue.description %>
+<%= textilizable @issue.description, :attachments => @issue.attachments %>
<br />
<div class="contextual">
@@ -92,24 +92,14 @@ end %>
<div class="box">
<h3><%=l(:label_attachment_plural)%></h3>
-<table width="100%">
-<% for attachment in @issue.attachments %>
-<tr>
-<td><%= link_to attachment.filename, { :action => 'download', :id => @issue, :attachment_id => attachment }, :class => 'icon icon-attachment' %> (<%= number_to_human_size(attachment.filesize) %>)</td>
-<td><%= format_date(attachment.created_on) %></td>
-<td><%= attachment.author.display_name %></td>
-<td><div class="contextual"><%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy_attachment', :id => @issue, :attachment_id => attachment }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></div></td>
-</tr>
-<% end %>
-</table>
-<br />
+<%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %>
+
<% if authorize_for('issues', 'add_attachment') %>
- <% form_tag({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") do %>
- <p id="attachments_p"><label><%=l(:label_attachment_new)%>
- <%= image_to_function "add.png", "addFileField();return false" %></label>
- <%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
- <%= submit_tag l(:button_add) %>
- <% end %>
+<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
+<% form_tag({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
+ <%= render :partial => 'attachments/form' %>
+<%= submit_tag l(:button_add) %>
+<% end %>
<% end %>
</div>