1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

github UI tidy

This commit is contained in:
Harvey Kandola 2016-09-10 16:24:24 -07:00
parent 9e39153108
commit bf1b75a527
8 changed files with 214 additions and 247 deletions

View file

@ -13,81 +13,82 @@ package github
const commitsTemplate = `
<div class="section-github-render">
{{if .HasAuthorStats}}
<h3>Contributors</h3>
{{if .HasAuthorStats}}
<div class="heading">Contributors</div>
<p>
There
{{if eq 1 .NumContributors}}is{{else}}are{{end}}
{{.NumContributors}}
{{if eq 1 .NumContributors}}contributor{{else}}contributors{{end}}
across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p>
<p>
There
{{if eq 1 .NumContributors}}is{{else}}are{{end}}
{{.NumContributors}}
{{if eq 1 .NumContributors}}contributor{{else}}contributors{{end}}
across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p>
<div class="margin-top-20"></div>
<table class="github-table no-width">
<tbody>
{{range $stats := .AuthorStats}}
<tr>
<td class="no-width">
<img class="github-avatar" alt="@{{$stats.Author}}" src="{{$stats.Avatar}}" />
</td>
<td>
<div class="contributor-name">{{$stats.Author}}</div>
<div class="contributor-meta">
{{if gt $stats.OpenIssues 0}}
assigned {{$stats.OpenIssues}}
{{if eq 1 $stats.OpenIssues}} issue
{{else}} issues {{end}}
{{end}}
{{if gt $stats.ClosedIssues 0}}
&middot; {{$stats.ClosedIssues}} closed
{{end}}
{{if gt $stats.CommitCount 0}}
{{if gt $stats.OpenIssues 0}} &middot; {{end}}
{{if gt $stats.ClosedIssues 0}} &middot; {{end}}
made {{$stats.CommitCount}}
{{if eq 1 $stats.CommitCount}} commit {{else}} commits {{end}}
on {{len $stats.Repos}} {{if eq 1 (len $stats.Repos)}} branch {{else}} branches {{end}}
{{range $repo := $stats.Repos}} &middot; {{$repo}} {{end}}
{{end}}
</div>
<div class="margin-top-10"></div>
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
<table class="contributor-table" style="width:100%;">
<tbody class="github">
{{range $stats := .AuthorStats}}
<tr>
<td class="width-5">
<img class="github-avatar" alt="@{{$stats.Author}}" src="{{$stats.Avatar}}" height="36" width="36">
</td>
<td class="width-95">
<h6>{{$stats.Author}}</h6>
{{if gt $stats.OpenIssues 0}}
has been assigned {{$stats.OpenIssues}}
{{if eq 1 $stats.OpenIssues}} issue,
{{else}} issues, {{end}}
{{end}}
{{if gt $stats.ClosedIssues 0}}
{{$stats.ClosedIssues}} have been closed,
{{end}}
{{if gt $stats.CommitCount 0}}
has made {{$stats.CommitCount}}
{{if eq 1 $stats.CommitCount}} commit {{else}} commits {{end}}
on {{len $stats.Repos}} {{if eq 1 (len $stats.Repos)}} branch. {{else}} branches. {{end}}
<br>
{{range $repo := $stats.Repos}} {{$repo}}, {{end}}
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
{{if .HasCommits}}
<h3>Commits</h3>
<p> There are {{len .BranchCommits}} commits by {{.NumContributors}} contributors
across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p>
<table class="contributor-table" style="width:100%;">
<tbody class="github">
{{range $commit := .BranchCommits}}
<tr>
<td style="width:5%;">
<img class="github-avatar" alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" height="36" width="36">
</td>
<td style="width:45%;">
{{if $commit.ShowUser}}
<h6>{{$commit.Name}}</h6>
{{end}}
<a class="link" href="{{$commit.URL}}">{{$commit.Message}}</a><br>
<span class="date-meta">{{if $commit.ShowDate}}{{$commit.Date}}{{end}}</span>
</td>
<td style="width:55%;">
{{if $commit.ShowBranch}}{{$commit.Repo}}:<span class="branch">{{$commit.Branch}}</span>{{end}}
<br>
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
{{if .HasCommits}}
<div class="heading">Commits</div>
<p>There are {{len .BranchCommits}} commits by {{.NumContributors}} contributors across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p>
<div class="margin-top-20"></div>
<table class="github-table no-width">
<tbody>
{{range $commit := .BranchCommits}}
<tr>
<td style="no-width">
<img class="github-avatar" alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" />
</td>
<td>
{{if $commit.ShowUser}}
<div class="contributor-name"><a href="{{$commit.URL}}">{{$commit.Message}}</a></div>
{{end}}
<div class="contributor-meta">
{{$commit.Name}}
{{if $commit.ShowDate}} &middot; {{$commit.Date}} {{end}}
{{if $commit.ShowBranch}} &middot; {{$commit.Repo}}:<span class="bold">{{$commit.Branch}}</span>{{end}}
</div>
<div class="margin-top-10"></div>
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
</div>
`