From 7b70369438d7cd340d5c073db46fc8a11a19fe45 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 15:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_new_form.html.erb | 6 +++++- public/javascripts/attachments.js | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb index d138c529f..e0c668368 100644 --- a/app/views/attachments/_new_form.html.erb +++ b/app/views/attachments/_new_form.html.erb @@ -36,7 +36,11 @@ :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, :upload_path => uploads_path(:format => 'js',:project =>project), - :description_placeholder => l(:label_optional_description) + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) } %> <%= l(:label_no_file_uploaded)%> diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index ea385ae28..866d049a5 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -22,10 +22,10 @@ function addFile(inputEl, file, eagerUpload) { fileSpan.append( $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), - $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), - $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , - $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), - $('   ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : $(inputEl).data('areYouSure') }).click(removeFile).toggle(!eagerUpload), + $('', { 'type': 'text', 'class': 'description','style':'margin-left: 9px;', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), + $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label','style':'margin-left: 15px;' }) , + $('', { 'type': 'checkbox','style':'margin-left: 5px;', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), + $('   ').attr({ 'href': "#", 'class': 'remove-upload','style':'margin-left: 3px;', 'data-confirm' : $(inputEl).data('areYouSure') }).click(removeFile).toggle(!eagerUpload), $('
', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} ) ).appendTo('#attachments_fields');