summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-03-22 11:43:54 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-22 18:43:54 +0800
commit14fe9010ae8aecc0bcd38059b4c71256524b5341 (patch)
tree6a4740387d288ea8cd433412d36624e30912d5ee /templates
parent9224405155322e096e7f2d0f9eed35633b937951 (diff)
downloadgitea-14fe9010ae8aecc0bcd38059b4c71256524b5341.tar.gz
gitea-14fe9010ae8aecc0bcd38059b4c71256524b5341.zip
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
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/commits_table.tmpl19
-rw-r--r--templates/repo/diff/page.tmpl19
2 files changed, 33 insertions, 5 deletions
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 @@
<thead>
<tr>
<th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
- <th class="nine wide message"><span class="sha">SHA1</span> {{.i18n.Tr "repo.commits.message"}}</th>
+ <th class="two wide sha">SHA1</th>
+ <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
<th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
</tr>
</thead>
@@ -40,9 +41,21 @@
<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
{{end}}
</td>
-
+ <td class="sha">
+ <a rel="nofollow" class="ui sha label {{if .Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">
+ {{ShortSha .ID.String}}
+ {{if .Signature}}
+ <div class="ui detail icon button">
+ {{if .Verification.Verified}}
+ <i title="{{.Verification.Reason}}" class="lock green icon"></i>
+ {{else}}
+ <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
+ {{end}}
+ </div>
+ {{end}}
+ </a>
+ </td>
<td class="message collapsing">
- <a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a>
<span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
</td>
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
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}}
- <div class="ui top attached info clearing segment">
+ <div class="ui top attached info clearing segment {{if .Commit.Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}">
<a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
{{.i18n.Tr "repo.diff.browse_source"}}
</a>
{{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
</div>
- <div class="ui attached info segment">
+ <div class="ui attached info segment {{if .Commit.Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}">
{{if .Author}}
<img class="ui avatar image" src="{{.Author.RelAvatarLink}}" />
{{if .Author.FullName}}
@@ -41,6 +41,21 @@
</div>
</div>
</div>
+ {{if .Commit.Signature}}
+ {{if .Verification.Verified }}
+ <div class="ui bottom attached positive message" style="text-align: initial;color: black;">
+ <i class="green lock icon"></i>
+ <span style="color: #2C662D;">Signed by :</span>
+ <a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> <{{.Commit.Committer.Email}}>
+ <span class="pull-right"><span style="color: #2C662D;">GPG key ID:</span> {{.Verification.SigningKey.KeyID}}</span>
+ </div>
+ {{else}}
+ <div class="ui bottom attached message" style="text-align: initial;color: black;">
+ <i class="grey unlock icon"></i>
+ {{.i18n.Tr .Verification.Reason}}
+ </div>
+ {{end}}
+ {{end}}
{{end}}
{{template "repo/diff/box" .}}