Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed repo link in generated comment for cross repository dependency #9863

Merged
merged 7 commits into from
Jan 21, 2020
5 changes: 5 additions & 0 deletions models/issue_comment_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ func (comments CommentList) loadDependentIssues(e Engine) error {
for _, comment := range comments {
if comment.DependentIssue == nil {
comment.DependentIssue = issues[comment.DependentIssueID]
if comment.DependentIssue != nil {
if err := comment.DependentIssue.loadRepo(e); err != nil {
return err
}
}
}
}
return nil
Expand Down
36 changes: 28 additions & 8 deletions templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,20 @@
<span class="text grey">
{{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
</span>
<div class="detail">
<span class="octicon octicon-plus"></span>
<span class="text grey"><a href="{{$.RepoLink}}/issues/{{.DependentIssue.Index}}">#{{.DependentIssue.Index}} {{.DependentIssue.Title}}</a></span>
</div>
{{if .DependentIssue}}
<div class="detail">
<span class="octicon octicon-plus"></span>
<span class="text grey">
<a href="{{.DependentIssue.HTMLURL}}">
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
{{else}}
{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
{{end}}
</a>
</span>
</div>
{{end}}
</div>
{{else if eq .Type 20}}
<div class="event" id="{{.HashTag}}">
Expand All @@ -291,10 +301,20 @@
<span class="text grey">
{{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
</span>
<div class="detail">
<span class="text grey octicon octicon-trashcan"></span>
<span class="text grey"><a href="{{$.RepoLink}}/issues/{{.DependentIssue.Index}}">#{{.DependentIssue.Index}} {{.DependentIssue.Title}}</a></span>
</div>
{{if .DependentIssue}}
<div class="detail">
<span class="text grey octicon octicon-trashcan"></span>
<span class="text grey">
<a href="{{.DependentIssue.HTMLURL}}">
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
{{else}}
{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
{{end}}
</a>
</span>
</div>
{{end}}
</div>
{{else if eq .Type 22}}
<div class="event" id="{{.HashTag}}">
Expand Down