From a5785c8ee69341ed99ff6c4a74dfad0e8b651857 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 18 Jan 2022 15:03:29 +0000 Subject: [PATCH] Display source project for cross-project associated revisions for issues (#5242). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Contributed by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@21368 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 2 +- app/views/issues/tabs/_changesets.html.erb | 4 +++- test/functional/issues_controller_test.rb | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 83012b342..41ee95051 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -239,7 +239,7 @@ class IssuesController < ApplicationController when 'changesets' @changesets = @issue.changesets.visible.preload(:repository, :user).to_a @changesets.reverse! if User.current.wants_comments_in_reverse_order? - render :partial => 'issues/tabs/changesets', :locals => {:changesets => @changesets} + render :partial => 'issues/tabs/changesets', :locals => {:changesets => @changesets, :project => @project} end end diff --git a/app/views/issues/tabs/_changesets.html.erb b/app/views/issues/tabs/_changesets.html.erb index b06fd4b7e..bf00dcb7b 100644 --- a/app/views/issues/tabs/_changesets.html.erb +++ b/app/views/issues/tabs/_changesets.html.erb @@ -5,7 +5,9 @@ <%= avatar(changeset.user, :size => "24") %> <%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %> -

<%= link_to_revision(changeset, changeset.repository, +

+ <%= "#{changeset.project.name} - " unless changeset.project == project %> + <%= link_to_revision(changeset, changeset.repository, :text => "#{l(:label_revision)} #{changeset.format_identifier}") %> <% if changeset.filechanges.any? && User.current.allowed_to?(:browse_repository, changeset.project) %> (<%= link_to(l(:label_diff), diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 2af871d54..14b4ea19a 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2661,6 +2661,7 @@ class IssuesControllerTest < Redmine::ControllerTest :xhr => true ) assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/3' + assert_select 'div.changeset p', :text => /eCookbook - / end def test_show_should_display_watchers -- 2.39.5