summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-09-20 02:45:38 -0300
committertechknowlogick <techknowlogick@gitea.io>2019-09-20 01:45:38 -0400
commit2a2b46c62ee0ac2b42b8bd0f28e05642d0cee25b (patch)
tree1b71938c5d9931808c336062859f6c1fb82b9c7a /templates
parent8a0379d68aa723be9cf1b304068e6b0d098b8a6d (diff)
downloadgitea-2a2b46c62ee0ac2b42b8bd0f28e05642d0cee25b.tar.gz
gitea-2a2b46c62ee0ac2b42b8bd0f28e05642d0cee25b.zip
Reference issues from pull requests and other issues (#8137)
* Update ref comment * Generate comment on simple ref * Make fmt + remove unneeded repo load * Add TODO comments * Add ref-check in issue creation; re-arrange template * Make unit tests pass; rearrange code * Make fmt * Filter out xref comment if user can't see the referencing issue * Add TODOs * Add cross reference * Rearrange code; add cross-repository references * Striketrhough obsolete references * Remove unnecesary TODO * Add "not supported" note * Support for edits and deletes, and issue title * Revert changes to go.mod * Fix fmt * Add support for xref from API * Add first integration test * Add integration tests * Correct formatting * Fix add comment test * Add migration * Remove outdated comments; fix typo * Some code refactoring and rearranging * Rename findCrossReferences to createCrossReferences * Delete xrefs when repository is deleted * Corrections as suggested by @lafriks * Prepare for merge * Fix log for errors
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/issue/view_content/comments.tmpl28
1 files changed, 28 insertions, 0 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 70de314c91..a5f25954c7 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -96,6 +96,34 @@
</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)}}
+ <div class="event">
+ <span class="octicon octicon-bookmark"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </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}}
+ </span>
+ {{if eq .RefAction 3}}</del>{{end}}
+
+ <div class="detail">
+ <span class="text grey"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle | Str2html}}</b> {{.RefIssueIdent | Str2html}}</a></span>
+ </div>
+ </div>
{{else if eq .Type 4}}
<div class="event">
<span class="octicon octicon-bookmark"></span>