From e468a21e42f3989156977db8d07cb87e7e32d49f Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Sun, 31 May 2020 02:40:55 +0200 Subject: [PATCH 1/3] Show full GPG commit status on PR commit history --- templates/repo/commits_list_small.tmpl | 38 ++++++++++++++----- .../repo/issue/view_content/comments.tmpl | 2 +- web_src/less/_repository.less | 3 +- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index e5634bbad2a97..1e6b1a9d16c8a 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -1,8 +1,8 @@ -{{ $r:= List .Commits}} +{{ $r:= List $.comment.Commits}} {{ $index := 0}}
{{range $r}} - {{ $tag := printf "%s-%d" $.HashTag $index }} + {{ $tag := printf "%s-%d" $.comment.HashTag $index }} {{ $index = Add $index 1}}
{{svg "octicon-git-commit" 16}} @@ -31,13 +31,33 @@ {{$class = (printf "%s%s" $class " isWarning")}} {{end}} {{end}} - {{if $.Issue.PullRequest.BaseRepo.Name}} - + {{if $.comment.Issue.PullRequest.BaseRepo.Name}} + {{else}} {{end}} - {{ShortSha .ID.String}} - {{if $.Issue.PullRequest.BaseRepo.Name}} + {{ShortSha .ID.String}} + {{if .Signature}} +
+ {{if .Verification.Verified}} +
+ {{if ne .Verification.SigningUser.ID 0}} + + + {{else}} + + + + + + {{end}} +
+ {{else}} + + {{end}} +
+ {{end}} + {{if $.comment.Issue.PullRequest.BaseRepo.Name}}
{{else}} @@ -45,14 +65,14 @@ - {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Issue.PullRequest.BaseRepo.OwnerName $.Issue.PullRequest.BaseRepo.Name .ID }} - {{RenderCommitMessageLinkSubject .Message ($.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.Issue.PullRequest.BaseRepo.ComposeMetas}} + {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.comment.Issue.PullRequest.BaseRepo.OwnerName $.comment.Issue.PullRequest.BaseRepo.Name .ID }} + {{RenderCommitMessageLinkSubject .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}} {{if IsMultilineCommitMessage .Message}} {{end}} {{if IsMultilineCommitMessage .Message}} - + {{end}}
{{end}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index fcec8f6bae2dd..b2270611095bd 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -608,7 +608,7 @@
{{if not .IsForcePush}} - {{template "repo/commits_list_small" .}} + {{template "repo/commits_list_small" dict "comment" . "root" $}} {{end}} {{end}} {{end}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index efb89d5adffaa..b387d160796f5 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1427,7 +1427,8 @@ } #commits-table td.sha .sha.label, - #repo-files-table .sha.label { + #repo-files-table .sha.label, + .timeline-item.commits-list .singular-commit .sha.label { border: 1px solid #bbbbbb; .ui.signature.avatar { From a000992e155158b505a449d0a9b27481456612de Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Sun, 31 May 2020 10:49:27 +0200 Subject: [PATCH 2/3] move shabox badge to separate template --- templates/repo/commits_list.tmpl | 19 +------------------ templates/repo/commits_list_small.tmpl | 19 +------------------ templates/repo/shabox_badge.tmpl | 18 ++++++++++++++++++ templates/repo/view_list.tmpl | 19 +------------------ 4 files changed, 21 insertions(+), 54 deletions(-) create mode 100644 templates/repo/shabox_badge.tmpl diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index ad2369c042de7..e5c4c7488d91f 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -48,24 +48,7 @@ {{end}} {{ShortSha .ID.String}} {{if .Signature}} -
- {{if .Verification.Verified}} -
- {{if ne .Verification.SigningUser.ID 0}} - - - {{else}} - - - - - - {{end}} -
- {{else}} - - {{end}} -
+ {{template "repo/shabox_badge" dict "root" $ "verification" .Verification}} {{end}} {{if $.Reponame}} diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 1e6b1a9d16c8a..1e4a3973c662f 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -38,24 +38,7 @@ {{end}} {{ShortSha .ID.String}} {{if .Signature}} -
- {{if .Verification.Verified}} -
- {{if ne .Verification.SigningUser.ID 0}} - - - {{else}} - - - - - - {{end}} -
- {{else}} - - {{end}} -
+ {{template "repo/shabox_badge" dict "root" $.root "verification" .Verification}} {{end}} {{if $.comment.Issue.PullRequest.BaseRepo.Name}} diff --git a/templates/repo/shabox_badge.tmpl b/templates/repo/shabox_badge.tmpl new file mode 100644 index 0000000000000..f4bd30fdb14fc --- /dev/null +++ b/templates/repo/shabox_badge.tmpl @@ -0,0 +1,18 @@ +
+ {{if .verification.Verified}} +
+ {{if ne .verification.SigningUser.ID 0}} + + + {{else}} + + + + + + {{end}} +
+ {{else}} + + {{end}} +
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 2add12577d8cf..3362e2893938d 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -18,24 +18,7 @@ {{ShortSha .LatestCommit.ID.String}} {{if .LatestCommit.Signature}} -
- {{if .LatestCommitVerification.Verified}} -
- {{if ne .LatestCommitVerification.SigningUser.ID 0}} - - - {{else}} - - - - - - {{end}} -
- {{else}} - - {{end}} -
+ {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}} {{end}}
{{template "repo/commit_status" .LatestCommitStatus}} From 903580bb461299cded34e21be74599fcf768a242 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Sun, 31 May 2020 10:51:40 +0200 Subject: [PATCH 3/3] unnecessary $ --- templates/repo/commits_list_small.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 1e4a3973c662f..26b6aa211c9cd 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -1,4 +1,4 @@ -{{ $r:= List $.comment.Commits}} +{{ $r:= List .comment.Commits}} {{ $index := 0}}
{{range $r}}