summaryrefslogtreecommitdiffstats
path: root/app/controllers/messages_controller.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-06-02 13:29:54 +0000
committerGo MAEDA <maeda@farend.jp>2019-06-02 13:29:54 +0000
commit2d475288e4b79bea7f3beefd5f0be151510b0274 (patch)
treeacb70f3c9b295b1839587dd400b895d51d007dc4 /app/controllers/messages_controller.rb
parent748e8725d6c93dadfebc94440a0600cdfb890f9a (diff)
downloadredmine-2d475288e4b79bea7f3beefd5f0be151510b0274.tar.gz
redmine-2d475288e4b79bea7f3beefd5f0be151510b0274.zip
Insert a link to the source to the attribution line when quoting a note or a message (#31427).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18217 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/messages_controller.rb')
-rw-r--r--app/controllers/messages_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index f0830fcdb..b6bcb2839 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -117,7 +117,11 @@ class MessagesController < ApplicationController
@subject = @message.subject
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
- @content = +"#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
+ if @message.root == @message
+ @content = +"#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
+ else
+ @content = +"#{ll(Setting.default_language, :text_user_wrote_in, {:value => @message.author, :link => "message##{@message.id}"})}\n> "
+ end
@content << @message.content.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
end