summaryrefslogtreecommitdiffstats
path: root/app/views/attachments/_form.html.erb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-25 22:32:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-25 22:32:07 +0000
commit7ed7d8984ddc30a8db5b55d7fdb5f0cdda6c2efb (patch)
treef3457aa4c2e42d626ec1f1acb53910034e80a6ff /app/views/attachments/_form.html.erb
parentfe452513496040bc8cb693e9cc0e06bd98e61f24 (diff)
downloadredmine-7ed7d8984ddc30a8db5b55d7fdb5f0cdda6c2efb.tar.gz
redmine-7ed7d8984ddc30a8db5b55d7fdb5f0cdda6c2efb.zip
Check attachment size when the user selects a file (#9667).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7926 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/attachments/_form.html.erb')
-rw-r--r--app/views/attachments/_form.html.erb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb
index c14c23aef..33990e8ab 100644
--- a/app/views/attachments/_form.html.erb
+++ b/app/views/attachments/_form.html.erb
@@ -1,6 +1,7 @@
<span id="attachments_fields">
<span>
- <%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil, :class => 'file' -%>
+ <%= 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)))}');" -%>
<label class="inline"><%= l(:label_optional_description) %><%= text_field_tag 'attachments[1][description]', '', :size => 60, :id => nil, :class => 'description' %></label>
<%= link_to_function(image_tag('delete.png'), 'removeFileField(this)', :title => (l(:button_delete))) %>
</span>