diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 8c6346a5..445ae3d1 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -26,7 +26,7 @@ class AttachmentsController < ApplicationController if @attachment.is_diff? @diff = File.new(@attachment.diskfile, "rb").read render :action => 'diff' - elsif @attachment.is_text? && @attachment.filesize <= Setting.setting_file_max_size_displayed.to_i.kilobyte + elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte @content = File.new(@attachment.diskfile, "rb").read render :action => 'file' else diff --git a/app/views/settings/_general.rhtml b/app/views/settings/_general.rhtml index b6e570ba..f34161fc 100644 --- a/app/views/settings/_general.rhtml +++ b/app/views/settings/_general.rhtml @@ -34,7 +34,7 @@ <%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %>
-<%= text_field_tag 'settings[setting_file_max_size_displayed]', Setting.setting_file_max_size_displayed, :size => 6 %> KB
+<%= text_field_tag 'settings[file_max_size_displayed]', Setting.file_max_size_displayed, :size => 6 %> KB<%= text_field_tag 'settings[diff_max_lines_displayed]', Setting.diff_max_lines_displayed, :size => 6 %>
diff --git a/config/settings.yml b/config/settings.yml index fad3ef5f..38b0a44c 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -63,7 +63,7 @@ feeds_limit: default: 15 # Maximum size of files that can be displayed # inline through the file viewer (in KB) -setting_file_max_size_displayed: +file_max_size_displayed: format: int default: 512 diff_max_lines_displayed: diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index 0639de8d..6738afbc 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -64,7 +64,7 @@ class AttachmentsControllerTest < Test::Unit::TestCase end def test_show_text_file_should_send_if_too_big - Setting.setting_file_max_size_displayed = 512 + Setting.file_max_size_displayed = 512 Attachment.find(4).update_attribute :filesize, 754.kilobyte get :show, :id => 4