diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-20 06:13:26 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-20 06:13:26 +0000 |
commit | 245b534c83abb79ed21b9a2b72f8c4cd0cad1470 (patch) | |
tree | bbbac72a622e9e5a1001c0463d29b8f69aaeea62 /app/controllers/attachments_controller.rb | |
parent | 700c6de3db1be2de08e277f8f0e85a566d5593f8 (diff) | |
download | redmine-245b534c83abb79ed21b9a2b72f8c4cd0cad1470.tar.gz redmine-245b534c83abb79ed21b9a2b72f8c4cd0cad1470.zip |
attachment: add a new feature to switch "side by side" and "inline" for patches (#9612)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7860 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r-- | app/controllers/attachments_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index b0e09cb80..9e6dd4cb8 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -27,6 +27,8 @@ class AttachmentsController < ApplicationController format.html { if @attachment.is_diff? @diff = File.new(@attachment.diskfile, "rb").read + @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline' + @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type) render :action => 'diff' elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte @content = File.new(@attachment.diskfile, "rb").read |