diff options
author | Go MAEDA <maeda@farend.jp> | 2021-01-13 06:30:49 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-01-13 06:30:49 +0000 |
commit | ac015d49f9c6778420a9e5cac78ac44f5845a346 (patch) | |
tree | 2f198f9118cf7f1b672a333f2f207c274525de10 /app/views | |
parent | ea08c3aa8174c04a75f9f64eb7dab21fcd728a8c (diff) | |
download | redmine-ac015d49f9c6778420a9e5cac78ac44f5845a346.tar.gz redmine-ac015d49f9c6778420a9e5cac78ac44f5845a346.zip |
Drag and drop file upload to file type custom field (#30776).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@20712 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/attachments/_form.html.erb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 6dd07a9d4..7bda59c95 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -1,9 +1,10 @@ <% attachment_param ||= 'attachments' %> +<% attachment_format_custom_field ||= false %> <% saved_attachments ||= container.saved_attachments if defined?(container) && container %> <% multiple = true unless defined?(multiple) && multiple == false %> <% show_add = multiple || saved_attachments.blank? %> <% description = (defined?(description) && description == false ? false : true) %> -<% css_class = (defined?(filedrop) && filedrop == false ? '' : 'filedrop') %> +<% css_class = (defined?(filedrop) && filedrop == false ? '' : (attachment_format_custom_field ? 'custom-field-filedrop' : 'filedrop')) %> <span class="attachments_form"> <span class="attachments_fields"> @@ -30,7 +31,7 @@ :multiple => multiple, :onchange => 'addInputFiles(this);', :data => { - :max_number_of_files_message => l(:error_attachments_too_many, :max_number_of_files => 10), + :max_number_of_files_message => l(:error_attachments_too_many, :max_number_of_files => (multiple ? 10 : 1)), :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, |