diff options
author | guillep2k <18600385+guillep2k@users.noreply.github.com> | 2019-11-18 10:13:07 -0300 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-11-18 15:13:07 +0200 |
commit | b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6 (patch) | |
tree | 14e4b0e743605f25da792c96c6deb2d5e8200155 /templates/repo/issue | |
parent | 08ae6bb7edb9582c38edb8a0dba1b1be10fb00fc (diff) | |
download | gitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.tar.gz gitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.zip |
Close/reopen issues by keywords in titles and comments (#8866)
* Add close/reopen from comment functionality
* Fix comment
* Rewrite closing/reopening template
* Check xref permissions, move action to services/pull
* Fix RefIsPull field
* Add xref tests
* Fix xref unique filter
* Only highlight keywords for actionable xrefs
* Fix xref neuter filter
* Fix check return status
* Restart CI
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 5a3d4026c6..86860fe8f4 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -88,7 +88,20 @@ </a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}</span> </div> - {{else if or (eq .Type 3) (eq .Type 5) (eq .Type 6)}} + {{else if eq .Type 3 5 6}} + {{ $refFrom:= "" }} + {{if ne .RefRepoID .Issue.RepoID}} + {{ $refFrom = $.i18n.Tr "repo.issues.ref_from" .RefRepo.FullName }} + {{end}} + {{ $refTr := "repo.issues.ref_issue_from" }} + {{if .Issue.IsPull}} + {{ $refTr = "repo.issues.ref_pull_from" }} + {{else if eq .RefAction 1 }} + {{ $refTr = "repo.issues.ref_closing_from" }} + {{else if eq .RefAction 2 }} + {{ $refTr = "repo.issues.ref_reopening_from" }} + {{end}} + {{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }} <div class="event" id="{{.HashTag}}"> <span class="octicon octicon-bookmark"></span> <a class="ui avatar image" href="{{.Poster.HomeLink}}"> @@ -96,19 +109,7 @@ </a> {{if eq .RefAction 3}}<del>{{end}} <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> - {{if (eq .RefRepoID .Issue.RepoID)}} - {{if .Issue.IsPull}} - <a href="{{.RefCommentHTMLURL}}">{{$.i18n.Tr "repo.issues.ref_pull_at" $createdStr | Safe}}</a> - {{else}} - <a href="{{.RefCommentHTMLURL}}">{{$.i18n.Tr "repo.issues.ref_issue_at" $createdStr | Safe}}</a> - {{end}} - {{else}} - {{if .Issue.IsPull}} - <a href="{{.RefCommentHTMLURL}}">{{$.i18n.Tr "repo.issues.ref_pull_ext_at" .RefRepo.FullName $createdStr | Safe}}</a> - {{else}} - <a href="{{.RefCommentHTMLURL}}">{{$.i18n.Tr "repo.issues.ref_issue_ext_at" .RefRepo.FullName $createdStr | Safe}}</a> - {{end}} - {{end}} + {{$.i18n.Tr $refTr .EventTag $createdStr .RefCommentHTMLURL $refFrom | Safe}} </span> {{if eq .RefAction 3}}</del>{{end}} |