]> source.dussan.org Git - redmine.git/commitdiff
Display source project for cross-project associated revisions for issues (#5242).
authorGo MAEDA <maeda@farend.jp>
Tue, 18 Jan 2022 15:03:29 +0000 (15:03 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 18 Jan 2022 15:03:29 +0000 (15:03 +0000)
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
app/views/issues/tabs/_changesets.html.erb
test/functional/issues_controller_test.rb

index 83012b342b7a56ec862470792778c3c101a95cc4..41ee9505132f12602bd13e697a1b8e99d626c233 100644 (file)
@@ -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
 
index b06fd4b7e5e3bf574f650a2efeaec8284cc7494e..bf00dcb7bfb6d9e7fd79cefa4ffa099893fe11ca 100644 (file)
@@ -5,7 +5,9 @@
       <%= avatar(changeset.user, :size => "24") %>
       <%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %>
     </h4>
-    <p><%= link_to_revision(changeset, changeset.repository,
+    <p>
+    <%= "#{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),
index 2af871d54db02b57f567726bdf63658f719d6c91..14b4ea19a1d92f301b2159cb8cf0c68fad3b5c79 100644 (file)
@@ -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