summaryrefslogtreecommitdiffstats
path: root/app/views/attachments
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/attachments
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/attachments')
-rw-r--r--app/views/attachments/_form.rhtml4
-rw-r--r--app/views/attachments/_links.rhtml13
2 files changed, 17 insertions, 0 deletions
diff --git a/app/views/attachments/_form.rhtml b/app/views/attachments/_form.rhtml
new file mode 100644
index 000000000..18f08c6be
--- /dev/null
+++ b/app/views/attachments/_form.rhtml
@@ -0,0 +1,4 @@
+<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
+<%= 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>
diff --git a/app/views/attachments/_links.rhtml b/app/views/attachments/_links.rhtml
new file mode 100644
index 000000000..93d6b2a7d
--- /dev/null
+++ b/app/views/attachments/_links.rhtml
@@ -0,0 +1,13 @@
+<div class="attachments">
+<% for attachment in attachments %>
+ <p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'download', :id => attachment }, :class => 'icon icon-attachment' %>
+ (<%= number_to_human_size attachment.filesize %>)
+ <% unless options[:no_author] %>
+ <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em>
+ <% end %>
+ <% if options[:delete_url] %>
+ <%= link_to image_tag('delete.png'), options[:delete_url].update({:attachment_id => attachment}), :confirm => l(:text_are_you_sure), :method => :post %>
+ <% end %>
+ </p>
+<% end %>
+</div>