Partial quoting feature for Issues and Forums (#41294).

Patch by Katsuya HIDAKA (user:hidakatsuya).


git-svn-id: https://svn.redmine.org/redmine/trunk@23107 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-10-09 21:51:52 +00:00
parent 52d215de43
commit 8ca5d2fa1a
16 changed files with 830 additions and 51 deletions

View File

@@ -29,6 +29,7 @@ class MessagesController < ApplicationController
helper :watchers
helper :attachments
include AttachmentsHelper
include Redmine::QuoteReply::Builder
REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
@@ -119,12 +120,11 @@ class MessagesController < ApplicationController
@subject = @message.subject
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
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"
@content = if @message.root == @message
quote_root_message(@message, partial_quote: params[:quote])
else
quote_message(@message, partial_quote: params[:quote])
end
respond_to do |format|
format.html { render_404 }