Fixes new setting name.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2504 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-02-21 15:44:00 +00:00
parent 66afc8c054
commit 79c074dbe5
4 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ class AttachmentsController < ApplicationController
if @attachment.is_diff? if @attachment.is_diff?
@diff = File.new(@attachment.diskfile, "rb").read @diff = File.new(@attachment.diskfile, "rb").read
render :action => 'diff' 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 @content = File.new(@attachment.diskfile, "rb").read
render :action => 'file' render :action => 'file'
else else

View File

@ -34,7 +34,7 @@
<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p> <%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
<p><label><%= l(:setting_file_max_size_displayed) %></label> <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> <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> <%= text_field_tag 'settings[diff_max_lines_displayed]', Setting.diff_max_lines_displayed, :size => 6 %></p>

View File

@ -63,7 +63,7 @@ feeds_limit:
default: 15 default: 15
# Maximum size of files that can be displayed # Maximum size of files that can be displayed
# inline through the file viewer (in KB) # inline through the file viewer (in KB)
setting_file_max_size_displayed: file_max_size_displayed:
format: int format: int
default: 512 default: 512
diff_max_lines_displayed: diff_max_lines_displayed:

View File

@ -64,7 +64,7 @@ class AttachmentsControllerTest < Test::Unit::TestCase
end end
def test_show_text_file_should_send_if_too_big 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 Attachment.find(4).update_attribute :filesize, 754.kilobyte
get :show, :id => 4 get :show, :id => 4