Browse Source

Fixes new setting name.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2504 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.9.0
Jean-Philippe Lang 15 years ago
parent
commit
79c074dbe5

+ 1
- 1
app/controllers/attachments_controller.rb View File

@@ -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

+ 1
- 1
app/views/settings/_general.rhtml View File

@@ -34,7 +34,7 @@
<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>

<p><label><%= l(:setting_file_max_size_displayed) %></label>
<%= text_field_tag 'settings[setting_file_max_size_displayed]', Setting.setting_file_max_size_displayed, :size => 6 %> KB</p>
<%= text_field_tag 'settings[file_max_size_displayed]', Setting.file_max_size_displayed, :size => 6 %> KB</p>

<p><label><%= l(:setting_diff_max_lines_displayed) %></label>
<%= text_field_tag 'settings[diff_max_lines_displayed]', Setting.diff_max_lines_displayed, :size => 6 %></p>

+ 1
- 1
config/settings.yml View File

@@ -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:

+ 1
- 1
test/functional/attachments_controller_test.rb View File

@@ -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

Loading…
Cancel
Save