Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sha1 hash display in repository table #1678

Merged
merged 1 commit into from
May 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,9 @@ footer .ui.language .menu {
padding-top: 8px;
padding-bottom: 8px;
}
.repository.file.list #repo-files-table td.message .isSigned {
cursor: default;
}
.repository.file.list #repo-files-table tr:hover {
background-color: #ffffEE;
}
Expand Down Expand Up @@ -1933,27 +1936,31 @@ footer .ui.language .menu {
.repository #commits-table td.sha .sha.label {
margin: 0;
}
.repository #commits-table td.sha .sha.label.isSigned {
.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n) {
background-color: rgba(0, 0, 0, 0.02) !important;
}
.repository #commits-table td.sha .sha.label.isSigned,
.repository #repo-files-table .sha.label.isSigned {
border: 1px solid #BBB;
}
.repository #commits-table td.sha .sha.label.isSigned .detail.icon {
.repository #commits-table td.sha .sha.label.isSigned .detail.icon,
.repository #repo-files-table .sha.label.isSigned .detail.icon {
background: #FAFAFA;
margin: -6px -10px -4px 0px;
padding: 5px 3px 5px 6px;
border-left: 1px solid #BBB;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.repository #commits-table td.sha .sha.label.isSigned.isVerified {
.repository #commits-table td.sha .sha.label.isSigned.isVerified,
.repository #repo-files-table .sha.label.isSigned.isVerified {
border: 1px solid #21BA45;
background: #21BA4518;
}
.repository #commits-table td.sha .sha.label.isSigned.isVerified .detail.icon {
.repository #commits-table td.sha .sha.label.isSigned.isVerified .detail.icon,
.repository #repo-files-table .sha.label.isSigned.isVerified .detail.icon {
border-left: 1px solid #21BA4580;
}
.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n) {
background-color: rgba(0, 0, 0, 0.02) !important;
}
.repository .diff-detail-box {
margin: 15px 0;
line-height: 30px;
Expand Down
50 changes: 27 additions & 23 deletions public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@
padding-top: 8px;
padding-bottom: 8px;
}
td.message .isSigned {
cursor: default;
}
tr:hover {
background-color: #ffffEE;
}
Expand Down Expand Up @@ -804,34 +807,35 @@
width: 140px;
}
}
td.sha{
.sha.label{
margin: 0;
&.isSigned{
border: 1px solid #BBB;
.detail.icon{
background: #FAFAFA;
margin: -6px -10px -4px 0px;
padding: 5px 3px 5px 6px;
border-left: 1px solid #BBB;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
&.isSigned.isVerified{
border: 1px solid #21BA45;
background: #21BA4518;
.detail.icon{
border-left: 1px solid #21BA4580;
}
}
}
}
td.sha .sha.label {
margin: 0;
}
&.ui.basic.striped.table tbody tr:nth-child(2n) {
background-color: rgba(0, 0, 0, .02)!important;
}
}

#commits-table td.sha .sha.label, #repo-files-table .sha.label{
&.isSigned{
border: 1px solid #BBB;
.detail.icon{
background: #FAFAFA;
margin: -6px -10px -4px 0px;
padding: 5px 3px 5px 6px;
border-left: 1px solid #BBB;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
&.isSigned.isVerified{
border: 1px solid #21BA45;
background: #21BA4518;
.detail.icon{
border-left: 1px solid #21BA4580;
}
}
}

.diff-detail-box {
margin: 15px 0;
line-height: 30px;
Expand Down
1 change: 1 addition & 0 deletions routers/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
}
}
ctx.Data["LatestCommit"] = latestCommit
ctx.Data["LatestCommitVerification"] = models.ParseCommitWithSignature(latestCommit)
ctx.Data["LatestCommitUser"] = models.ValidateCommitWithEmail(latestCommit)

// Check permission to add or upload new file.
Expand Down
18 changes: 15 additions & 3 deletions templates/repo/view_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@
<img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
<strong>{{.LatestCommit.Author.Name}}</strong>
{{end}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}" rel="nofollow">{{ShortSha .LatestCommit.ID.String}}</a>
<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}}
{{if .LatestCommit.Signature}}
<div class="ui detail icon button">
{{if .LatestCommitVerification.Verified}}
<i title="{{.LatestCommitVerification.Reason}}" class="lock green icon"></i>
{{else}}
<i title="{{$.i18n.Tr .LatestCommitVerification.Reason}}" class="unlock icon"></i>
{{end}}
</div>
{{end}}
</a>
<span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
</th>
<th class="nine wide">
Expand Down Expand Up @@ -61,8 +72,9 @@
</td>
{{end}}
<td class="message collapsing has-emoji">
<a rel="nofollow" class="ui sha label" href="{{$.RepoLink}}/commit/{{$commit.ID}}">{{ShortSha $commit.ID.String}}</a>
{{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas}}
<a rel="nofollow" href="{{$.RepoLink}}/commit/{{$commit.ID}}">
{{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas}}
</a>
</td>
<td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
</tr>
Expand Down