aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/issue_comment_list.go5
-rw-r--r--templates/repo/issue/view_content/comments.tmpl36
2 files changed, 33 insertions, 8 deletions
diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go
index ae2a89a01a..f8739e32a6 100644
--- a/models/issue_comment_list.go
+++ b/models/issue_comment_list.go
@@ -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
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 658494ac30..40db434dec 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -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}}">
@@ -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}}">