Adds maxlength=255 attribute on attachment description input field (#11365).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9982 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-15 14:34:28 +00:00
parent 6c1db9c3a8
commit e0fb60c6b5
2 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@
<span>
<%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil, :class => 'file',
:onchange => "checkFileSize(this, #{Setting.attachment_max_size.to_i.kilobytes}, '#{escape_javascript(l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)))}');" -%>
<%= text_field_tag 'attachments[1][description]', '', :id => nil, :class => 'description', :placeholder => l(:label_optional_description) %>
<%= text_field_tag 'attachments[1][description]', '', :id => nil, :class => 'description', :maxlength => 255, :placeholder => l(:label_optional_description) %>
<%= link_to_function(image_tag('delete.png'), 'removeFileField(this)', :title => (l(:button_delete))) %>
</span>
</span>

View File

@ -1405,6 +1405,7 @@ class IssuesControllerTest < ActionController::TestCase
:tag => 'input',
:attributes => {:type => 'file', :name => 'attachments[1][file]'}
}
assert_select 'input[name=?][maxlength=255]', 'attachments[1][description]'
end
def test_get_new_should_prefill_the_form_from_params