From 14fe9010ae8aecc0bcd38059b4c71256524b5341 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Wed, 22 Mar 2017 11:43:54 +0100 Subject: GPG commit validation (#1150) * GPG commit validation * Add translation + some little fix * Move hash calc after retrieving of potential key + missing translation * Add some little test --- templates/repo/commits_table.tmpl | 19 ++++++++++++++++--- templates/repo/diff/page.tmpl | 19 +++++++++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index a2c2c352c7..8e473f22da 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -21,7 +21,8 @@ {{.i18n.Tr "repo.commits.author"}} - SHA1 {{.i18n.Tr "repo.commits.message"}} + SHA1 + {{.i18n.Tr "repo.commits.message"}} {{.i18n.Tr "repo.commits.date"}} @@ -40,9 +41,21 @@   {{.Author.Name}} {{end}} - + + + {{ShortSha .ID.String}} + {{if .Signature}} +
+ {{if .Verification.Verified}} + + {{else}} + + {{end}} +
+ {{end}} +
+ - {{ShortSha .ID.String}} {{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}} {{TimeSince .Author.When $.Lang}} diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl index 90ee680576..d4a9d72dbe 100644 --- a/templates/repo/diff/page.tmpl +++ b/templates/repo/diff/page.tmpl @@ -5,13 +5,13 @@ {{if .IsDiffCompare }} {{template "repo/commits_table" .}} {{else}} -
+
{{.i18n.Tr "repo.diff.browse_source"}} {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
-
+
{{if .Author}} {{if .Author.FullName}} @@ -41,6 +41,21 @@
+ {{if .Commit.Signature}} + {{if .Verification.Verified }} +
+ + Signed by : + {{.Commit.Committer.Name}} <{{.Commit.Committer.Email}}> + GPG key ID: {{.Verification.SigningKey.KeyID}} +
+ {{else}} +
+ + {{.i18n.Tr .Verification.Reason}} +
+ {{end}} + {{end}} {{end}} {{template "repo/diff/box" .}} -- cgit v1.2.3