summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-03-23 05:52:40 +0000
committerGo MAEDA <maeda@farend.jp>2020-03-23 05:52:40 +0000
commit4a7bc593afad704a75ca662c8bec167305c66909 (patch)
treec0fb9793648b4ced60a6cb72077731f3538843c3 /app
parent12318cff4d2d1ca7a3dde2d139815d7d8ce0a3bd (diff)
downloadredmine-4a7bc593afad704a75ca662c8bec167305c66909.tar.gz
redmine-4a7bc593afad704a75ca662c8bec167305c66909.zip
Display bulk_download_max_size in human-readable representation (#7056).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19609 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/attachments_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 7e198d0bb..a41476f80 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AttachmentsController < ApplicationController
+ include ActionView::Helpers::NumberHelper
+
before_action :find_attachment, :only => [:show, :download, :thumbnail, :update, :destroy]
before_action :find_container, :only => [:edit_all, :update_all, :download_all]
before_action :find_downloadable_attachments, :only => :download_all
@@ -239,7 +241,7 @@ class AttachmentsController < ApplicationController
bulk_download_max_size = Setting.bulk_download_max_size.to_i.kilobytes
if @attachments.sum(&:filesize) > bulk_download_max_size
flash[:error] = l(:error_bulk_download_size_too_big,
- :max_size => bulk_download_max_size.to_i.kilobytes)
+ :max_size => number_to_human_size(bulk_download_max_size.to_i))
redirect_to back_url
return
end