From 9f7bfe38c2523b1f4e74261f2efffd30cdcb269d Mon Sep 17 00:00:00 2001 From: Cuynu Date: Sun, 30 Nov 2025 14:47:20 +0700 Subject: [PATCH] templates: new commits list by @fukiame Signed-off-by: Cuynu --- templates/repo/commits_list.tmpl | 108 +++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 templates/repo/commits_list.tmpl diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl new file mode 100644 index 0000000..36e834f --- /dev/null +++ b/templates/repo/commits_list.tmpl @@ -0,0 +1,108 @@ +
+ + + + + + + + + + {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} + {{range .Commits}} + + + + + + {{end}} + +
{{ctx.Locale.Tr "repo.commits.message"}}{{StringUtils.ToUpper $.Repository.ObjectFormatName}}
+ + + {{if $.PageIsWiki}} + {{.Summary | RenderEmoji $.Context}} + {{else}} + {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} + {{if $.PageIsPullCommits}} + {{$commitLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} + {{end}} + {{RenderCommitMessageLinkSubject $.Context .Message $commitLink ($.Repository.ComposeMetas ctx)}} + {{end}} + + + {{if IsMultilineCommitMessage .Message}} + + {{end}} + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} + {{if $.CommitTagsMap}} + {{$tags := index $.CommitTagsMap .ID.String}} + {{if $tags}} + {{range $tags}} + {{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}} + {{end}} + {{end}} + {{end}} + {{if IsMultilineCommitMessage .Message}} +
{{RenderCommitBody $.Context .Message ($.Repository.ComposeMetas ctx)}}
+ {{end}} +
+
+ {{$userName := .Author.Name}} + {{if .User}} + {{if and .User.FullName DefaultShowFullName}} + {{$userName = .User.FullName}} + {{end}} + {{ctx.AvatarUtils.Avatar .User 20 "tw-mr-2"}}{{$userName}} + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20 "tw-mr-2"}} + {{$userName}} + {{end}} +   + {{if ne .Committer.Name .Author.Name}} + authored and   + {{ctx.AvatarUtils.AvatarByEmail .Committer.Email .Committer.Name 20 "tw-mr-2"}}{{.Committer.Name}} +   + {{end}} + + {{if .Committer}} + commited {{DateUtils.TimeSince .Committer.When}} + {{else}} + authored {{DateUtils.TimeSince .Author.When}} + {{end}} +
+
+ {{$commitShaLink := ""}} + {{if $.PageIsWiki}} + {{$commitShaLink = (printf "%s/wiki/commit/%s" $commitRepoLink (PathEscape .ID.String))}} + {{else if $.PageIsPullCommits}} + {{$commitShaLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} + {{else if $.Reponame}} + {{$commitShaLink = (printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String))}} + {{end}} + {{template "repo/shabox" (dict + "sha1" .ID.String + "commitLink" $commitShaLink + "signature" .Signature + "verification" .Verification + )}} + + + {{if not $.PageIsWiki}} + {{if $.FileName}} + + {{svg "octicon-file-diff"}} + + {{end}} + + {{svg "octicon-file-code"}} + + {{end}} +
+