diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index d6cbb72fe..16de21226 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -3,7 +3,7 @@ <% container.attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> <%= l(:field_is_public)%>: <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <%= if attachment.id.nil? diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 1b60b370e..c20617ce5 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -22,7 +22,7 @@ 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': 255, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), + $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), $('公开:').attr({ 'class': 'ispublic-label' }) , $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public]', checked:'checked' } ).toggle(!eagerUpload), $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload),