aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorVladimir Panteleev <CyberShadow@users.noreply.github.com>2019-05-24 10:52:05 +0300
committerLauris BH <lauris@nix.lv>2019-05-24 10:52:05 +0300
commita98e085031bedb53a9776031afde7073af81feaf (patch)
tree3e460d74b7fec8729c8c7422799d485cb7c908ad /templates
parentd5a98a29690e13f717fb72e8635fbea57e58f546 (diff)
downloadgitea-a98e085031bedb53a9776031afde7073af81feaf.tar.gz
gitea-a98e085031bedb53a9776031afde7073af81feaf.zip
Show git-notes (#6984)
* Show git-notes * Make git-notes heading text localizable * Refactor git-notes data fetching to a separate function * Display the author and time of git notes * Move note bubble inside the commit bubble * Revert "Move note bubble inside the commit bubble" This reverts commit c0951fe0e3b4dea38064515546b1825c1bcf19e1. * Add test for git-notes * testing ui * Polish CSS * Apply suggestions from code review Co-Authored-By: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff/page.tmpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl
index c8f5a3d9f0..c35e2a415b 100644
--- a/templates/repo/diff/page.tmpl
+++ b/templates/repo/diff/page.tmpl
@@ -65,6 +65,27 @@
</div>
{{end}}
{{end}}
+ {{if .Note}}
+ <div class="ui top attached info segment message git-notes">
+ <i class="sticky note icon"></i>
+ {{.i18n.Tr "repo.diff.git-notes"}}:
+ {{if .NoteAuthor}}
+ <a href="{{.NoteAuthor.HomeLink}}">
+ {{if .NoteAuthor.FullName}}
+ <strong>{{.NoteAuthor.FullName}}</strong>
+ {{else}}
+ <strong>{{.NoteCommit.Author.Name}}</strong>
+ {{end}}
+ </a>
+ {{else}}
+ <strong>{{.NoteCommit.Author.Name}}</strong>
+ {{end}}
+ <span class="text grey" id="note-authored-time">{{TimeSince .NoteCommit.Author.When $.Lang}}</span>
+ </div>
+ <div class="ui bottom attached info segment git-notes">
+ <pre class="commit-body">{{RenderNote .Note $.RepoLink $.Repository.ComposeMetas}}</pre>
+ </div>
+ {{end}}
{{end}}
{{template "repo/diff/box" .}}