annotate .svn/pristine/ca/ca8b0f9fbdc1a332f4c2f4861ef22155d5ef176c.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents b450a9d58aed
children
rev   line source
Chris@1516 1 <span id="attachments_fields">
Chris@1516 2 <% if defined?(container) && container && container.saved_attachments %>
Chris@1516 3 <% container.saved_attachments.each_with_index do |attachment, i| %>
Chris@1516 4 <span id="attachments_p<%= i %>">
Chris@1516 5 <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename') +
Chris@1516 6 text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') +
Chris@1516 7 link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
Chris@1516 8 <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
Chris@1516 9 </span>
Chris@1516 10 <% end %>
Chris@1516 11 <% end %>
Chris@1516 12 </span>
Chris@1516 13 <span class="add_attachment">
Chris@1516 14 <%= file_field_tag 'attachments[dummy][file]',
Chris@1516 15 :id => nil,
Chris@1516 16 :class => 'file_selector',
Chris@1516 17 :multiple => true,
Chris@1516 18 :data => {
Chris@1516 19 :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
Chris@1516 20 :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
Chris@1516 21 :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
Chris@1516 22 :upload_path => uploads_path(:format => 'js'),
Chris@1516 23 :description_placeholder => l(:label_optional_description)
Chris@1516 24 } %>
Chris@1516 25 (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
Chris@1516 26 </span>
Chris@1516 27 <%= javascript_tag do %>
Chris@1516 28 $('input.file_selector').on('change', function(){addInputFiles(this);});
Chris@1516 29 <% end %>
Chris@1516 30
Chris@1516 31 <% content_for :header_tags do %>
Chris@1516 32 <%= javascript_include_tag 'attachments' %>
Chris@1516 33 <% end %>