summaryrefslogtreecommitdiffstats
path: root/app/views/attachments
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-29 13:41:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-29 13:41:53 +0000
commit288c014aa7aa608751dbafeb2c8b358f2fec5c22 (patch)
tree68a5705092edc501641630fa960cee368d27ca88 /app/views/attachments
parent3c7f638a834d6d9717e3d8babe3bab6af5100994 (diff)
downloadredmine-288c014aa7aa608751dbafeb2c8b358f2fec5c22.tar.gz
redmine-288c014aa7aa608751dbafeb2c8b358f2fec5c22.zip
Edit attachments after upload (#1326).
git-svn-id: http://svn.redmine.org/redmine/trunk@13665 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/attachments')
-rw-r--r--app/views/attachments/_links.html.erb3
-rw-r--r--app/views/attachments/edit.html.erb30
2 files changed, 33 insertions, 0 deletions
diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb
index d2ab22ced..a8dbd3584 100644
--- a/app/views/attachments/_links.html.erb
+++ b/app/views/attachments/_links.html.erb
@@ -1,4 +1,7 @@
<div class="attachments">
+<div class="contextual">
+ <%= link_to image_tag('edit.png'), container_attachments_edit_path(container) if attachments.any?(&:editable?) %>
+</div>
<% for attachment in attachments %>
<p><%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %>
diff --git a/app/views/attachments/edit.html.erb b/app/views/attachments/edit.html.erb
new file mode 100644
index 000000000..065488c67
--- /dev/null
+++ b/app/views/attachments/edit.html.erb
@@ -0,0 +1,30 @@
+<h2><%= l(:label_attachment_plural) %></h2>
+
+<%= error_messages_for *@attachments %>
+
+<%= form_tag(container_attachments_path(@container), :method => 'patch') do %>
+ <%= back_url_hidden_field_tag %>
+ <div class="box attachments">
+ <table>
+ <% @attachments.each do |attachment| %>
+ <tr>
+ <td colspan="2">
+ <span class="icon icon-attachment"><%= attachment.filename_was %></span>
+ <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
+ <span class="author"><%= h(attachment.author) %>, <%= format_time(attachment.created_on) %></span>
+ </td>
+ </tr>
+ <tr id="attachment-<%= attachment.id %>">
+ <td><%= text_field_tag "attachments[#{attachment.id}][filename]", attachment.filename, :size => 40 %></td>
+ <td>
+ <%= text_field_tag "attachments[#{attachment.id}][description]", attachment.description, :size => 80, :placeholder => l(:label_optional_description) %>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
+ <p>
+ <%= submit_tag l(:button_save) %>
+ <%= link_to l(:button_cancel), back_url if back_url.present? %>
+ </p>
+<% end %>