From 370a4795ae05766ec7c620fe422ad08a3b40a8c4 Mon Sep 17 00:00:00 2001 From: Brad Albright Date: Sat, 18 Jan 2020 22:34:28 -0600 Subject: [PATCH 1/3] fixed link to issue in issue comments after adding/removing a dependency, before links assumed the issue was in the same repository. also changed the format of the displayed issue since the issue will not necessarily be in the same repo --- models/issue_comment_list.go | 5 +++++ templates/repo/issue/view_content/comments.tmpl | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go index ae2a89a01ac77..f8739e32a654c 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 658494ac30ccb..fb3b48f7efe3f 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -279,7 +279,7 @@
- #{{.DependentIssue.Index}} {{.DependentIssue.Title}} + {{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
{{else if eq .Type 20}} @@ -293,7 +293,7 @@
- #{{.DependentIssue.Index}} {{.DependentIssue.Title}} + {{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
{{else if eq .Type 22}} From 79c64dd2ca8c769da339d06c2f9acdbcfbbb2aa1 Mon Sep 17 00:00:00 2001 From: Brad Albright Date: Sun, 19 Jan 2020 22:15:59 -0600 Subject: [PATCH 2/3] based on pr comments, changed to use HTMLURL instead of piecing together the issue url, and added an if statement around the issue link display as a nil protection --- .../repo/issue/view_content/comments.tmpl | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index fb3b48f7efe3f..4090bc879b420 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -277,10 +277,12 @@ {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - + {{if .DependentIssue}} + + {{end}} {{else if eq .Type 20}}
@@ -291,10 +293,12 @@ {{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - + {{if .DependentIssue}} + + {{end}}
{{else if eq .Type 22}}
From 547455bb0be2368bae200b7a622e56f84284c9ab Mon Sep 17 00:00:00 2001 From: Brad Albright Date: Mon, 20 Jan 2020 22:31:25 -0600 Subject: [PATCH 3/3] only showing repo name in dependency comment if the issue is from another repo --- .../repo/issue/view_content/comments.tmpl | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 4090bc879b420..40db434dec025 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -280,7 +280,15 @@ {{if .DependentIssue}} {{end}}
@@ -296,7 +304,15 @@ {{if .DependentIssue}} {{end}}