Better handling of attachments when issue validation fails (#10253).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8891 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-02-16 21:00:11 +00:00
parent a8f98bb749
commit d4e6355eb3
11 changed files with 265 additions and 49 deletions
+8
View File
@@ -1,3 +1,11 @@
<% if defined?(container) && container && container.saved_attachments %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span class="icon icon-attachment" style="display:block; line-height:1.5em;">
<%= h(attachment.filename) %> (<%= number_to_human_size(attachment.filesize) %>)
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.id}.#{attachment.digest}" %>
</span>
<% end %>
<% end %>
<span id="attachments_fields">
<span>
<%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil, :class => 'file',
+1 -1
View File
@@ -31,7 +31,7 @@
<%= wikitoolbar_for 'notes' %>
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
<p><%=l(:label_attachment_plural)%><br /><%= render :partial => 'attachments/form' %></p>
<p><%=l(:label_attachment_plural)%><br /><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
</fieldset>
</div>
+1 -1
View File
@@ -18,7 +18,7 @@
</p>
<% end %>
<p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p>
<p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
<% if @issue.safe_attribute? 'watcher_user_ids' -%>
<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>