mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
Send the journal_indice as param in order to get rid of extra queries (#31427).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18218 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -66,8 +66,7 @@ class JournalsController < ApplicationController
|
|||||||
if @journal
|
if @journal
|
||||||
user = @journal.user
|
user = @journal.user
|
||||||
text = @journal.notes
|
text = @journal.notes
|
||||||
indice = @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
|
@content = +"#{ll(Setting.default_language, :text_user_wrote_in, {:value => user, :link => "#note-#{params[:journal_indice]}"})}\n> "
|
||||||
@content = +"#{ll(Setting.default_language, :text_user_wrote_in, {:value => user, :link => "#note-#{indice}"})}\n> "
|
|
||||||
else
|
else
|
||||||
user = @issue.author
|
user = @issue.author
|
||||||
text = @issue.description
|
text = @issue.description
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module JournalsHelper
|
|||||||
if journal.notes.present?
|
if journal.notes.present?
|
||||||
if options[:reply_links]
|
if options[:reply_links]
|
||||||
links << link_to(l(:button_quote),
|
links << link_to(l(:button_quote),
|
||||||
quoted_issue_path(issue, :journal_id => journal),
|
quoted_issue_path(issue, :journal_id => journal, :journal_indice => journal.indice),
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:method => 'post',
|
:method => 'post',
|
||||||
:title => l(:button_quote),
|
:title => l(:button_quote),
|
||||||
|
|||||||
@@ -180,7 +180,8 @@ class JournalsControllerTest < Redmine::ControllerTest
|
|||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
get :new, :params => {
|
get :new, :params => {
|
||||||
:id => 6,
|
:id => 6,
|
||||||
:journal_id => 4
|
:journal_id => 4,
|
||||||
|
:journal_indice => 1
|
||||||
},
|
},
|
||||||
:xhr => true
|
:xhr => true
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|||||||
Reference in New Issue
Block a user