diff options
author | zeripath <art27@cantab.net> | 2020-02-27 19:20:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 16:20:55 -0300 |
commit | 90919bb37e2bcc62440e393439825fe0e1e1f343 (patch) | |
tree | 1e89ce6ec5a3c90399a1621e6d11dae2417c11ef /templates/repo/view_list.tmpl | |
parent | 858aebc2d8561803c4dc3f8a427ca82662ee96c7 (diff) | |
download | gitea-90919bb37e2bcc62440e393439825fe0e1e1f343.tar.gz gitea-90919bb37e2bcc62440e393439825fe0e1e1f343.zip |
Show Signer in commit lists and add basic trust (#10425)
* Show Signer in commit lists and add basic trust
Show the avatar of the signer in the commit list pages as we do not
enforce that the signer is an author or committer. This makes it
clearer who has signed the commit.
Also display commits signed by non-members differently from
members and in particular make it clear when a non-member signer
is different from the committer to help reduce the risk of
spoofing.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* ensure orange text and background is available
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update gpg_key.go
* Update models/gpg_key.go
* Apply suggestions from code review
* Require team collaborators to have access to UnitTypeCode
* as per @6543
* fix position of sha as per @silverwind
* as per @guillep2k
Diffstat (limited to 'templates/repo/view_list.tmpl')
-rw-r--r-- | templates/repo/view_list.tmpl | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index e8163787f5..c296eb7bee 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -15,16 +15,27 @@ <strong>{{.LatestCommit.Author.Name}}</strong> {{end}} {{end}} - <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified {{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}"> - {{ShortSha .LatestCommit.ID.String}} + <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/{{.LatestCommit.ID}}"> + <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span> {{if .LatestCommit.Signature}} - <div class="ui detail icon button"> - {{if .LatestCommitVerification.Verified}} - <i title="{{.LatestCommitVerification.Reason}}" class="lock green icon"></i> - {{else}} + {{if .LatestCommitVerification.Verified}} + <div class="ui detail icon button" title="{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.LatestCommitVerification.Reason}}"> + {{if ne .LatestCommitVerification.SigningUser.ID 0}} + <i class="lock icon"></i> + <img class="ui signature avatar image" src="{{.LatestCommitVerification.SigningUser.RelAvatarLink}}" /> + {{else}} + <i title="{{.LatestCommitVerification.Reason}}" class="icons"> + <i class="lock icon"></i> + <i class="tiny inverted cog icon centerlock"></i> + </i> + <img class="ui signature avatar image" src="{{AvatarLink .LatestCommitVerification.SigningEmail}}" /> + {{end}} + </div> + {{else}} + <div class="ui detail icon button"> <i title="{{$.i18n.Tr .LatestCommitVerification.Reason}}" class="unlock icon"></i> - {{end}} - </div> + </div> + {{end}} {{end}} </a> {{template "repo/commit_status" .LatestCommitStatus}} |