summaryrefslogtreecommitdiffstats
path: root/templates/repo/latest_commit.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
commitdd136858f1ea40ad3c94191d647487fa4f31926c (patch)
tree58fec94a7b2a12510c9664b21793f1ed560c6518 /templates/repo/latest_commit.tmpl
parentInitial commit. (diff)
downloadforgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.tar.xz
forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.zip
Adding upstream version 9.0.0.HEADupstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/repo/latest_commit.tmpl')
-rw-r--r--templates/repo/latest_commit.tmpl31
1 files changed, 31 insertions, 0 deletions
diff --git a/templates/repo/latest_commit.tmpl b/templates/repo/latest_commit.tmpl
new file mode 100644
index 0000000..222d582
--- /dev/null
+++ b/templates/repo/latest_commit.tmpl
@@ -0,0 +1,31 @@
+{{if not .LatestCommit}}
+ <div class="ui active tiny slow centered inline">…</div>
+{{else}}
+ {{if .LatestCommitUser}}
+ {{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "tw-mr-2"}}
+ {{if and .LatestCommitUser.FullName DefaultShowFullName}}
+ <a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
+ {{else}}
+ <a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
+ {{end}}
+ {{else}}
+ {{if .LatestCommit.Author}}
+ {{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "tw-mr-2"}}
+ <span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
+ {{end}}
+ {{end}}
+ <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}">
+ <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
+ {{if .LatestCommit.Signature}}
+ {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}}
+ {{end}}
+ </a>
+ {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}}
+ {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
+ <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
+ {{if IsMultilineCommitMessage .LatestCommit.Message}}
+ <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
+ <pre class="commit-body tw-hidden">{{RenderCommitBody $.Context .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}</pre>
+ {{end}}
+ </span>
+{{end}}