summaryrefslogtreecommitdiffstats
path: root/app/controllers/journals_controller.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-10-09 21:51:52 +0000
committerGo MAEDA <maeda@farend.jp>2024-10-09 21:51:52 +0000
commit8ca5d2fa1a77ccbb0773e15f56afb5003c34ad30 (patch)
treeb007a2a365ef5f1ff64fe9def38ce3229f859d78 /app/controllers/journals_controller.rb
parent52d215de4386c3c8db1f3435aaf6df4bbdbaab9c (diff)
downloadredmine-8ca5d2fa1a77ccbb0773e15f56afb5003c34ad30.tar.gz
redmine-8ca5d2fa1a77ccbb0773e15f56afb5003c34ad30.zip
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
Diffstat (limited to 'app/controllers/journals_controller.rb')
-rw-r--r--app/controllers/journals_controller.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index cbf545187..dd75b99a5 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -31,6 +31,7 @@ class JournalsController < ApplicationController
helper :queries
helper :attachments
include QueriesHelper
+ include Redmine::QuoteReply::Builder
def index
retrieve_query
@@ -65,18 +66,11 @@ class JournalsController < ApplicationController
def new
@journal = Journal.visible.find(params[:journal_id]) if params[:journal_id]
- if @journal
- user = @journal.user
- text = @journal.notes
- @content = "#{ll(Setting.default_language, :text_user_wrote_in, {:value => user, :link => "#note-#{params[:journal_indice]}"})}\n> "
- else
- user = @issue.author
- text = @issue.description
- @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
- end
- # Replaces pre blocks with [...]
- text = text.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]')
- @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
+ @content = if @journal
+ quote_issue_journal(@journal, indice: params[:journal_indice], partial_quote: params[:quote])
+ else
+ quote_issue(@issue, partial_quote: params[:quote])
+ end
rescue ActiveRecord::RecordNotFound
render_404
end