1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 06:39:43 +02:00

New github design changes

This commit is contained in:
EnesAlili 2016-08-24 11:40:56 +01:00
parent b42fc1f84d
commit cf007f8006
4 changed files with 148 additions and 79 deletions

View file

@ -12,58 +12,69 @@
package github package github
const commitsTemplate = ` const commitsTemplate = `
<h3>Contributor activity since {{.Config.Since}}{{.Config.DateMessage}}</h3>
<div class="section-github-render"> <div class="section-github-render">
<table style="width:80%">
<tr> {{if .HasAuthorStats}}
<th></th>
    <th>Author</th> <h3>Contributor activity since {{.Config.Since}}{{.Config.DateMessage}}</h3>
<th>Open Issues</th> <table class="contributor-table" style="width: 100%;">
<th>Closed Issues</th> <thead>
    <th>#commits</th> <tr>
    <th>Branches</th> <th class="title">Contributor</th>
  </tr> <th class="title">Assigned/Closed</th>
<th class="title">#Commits</th>
<th class="title">Branches</th>
</tr>
</thead>
<tbody>
{{range $stats := .AuthorStats}} {{range $stats := .AuthorStats}}
<tr> <tr>
<td> <td style="width: 20%;">
<div class="github-avatar"> <div class="github-avatar">
<img alt="@{{$stats.Author}}" src="{{$stats.Avatar}}" height="36" width="36"> <img alt="@{{$stats.Author}}" src="{{$stats.Avatar}}" height="36" width="36">
</div> </div>
{{$stats.Author}}
</td> </td>
<td>{{$stats.Author}}</td> <td style="width: 15%;">{{$stats.OpenIssues}} / {{$stats.ClosedIssues}}</td>
<td>{{$stats.OpenIssues}}</td> <td style="width: 15%;">{{$stats.CommitCount}}</td>
<td>{{$stats.ClosedIssues}}</td> <td style="width: 50%;">
<td>{{$stats.CommitCount}}</td>
<td>
{{range $repo := $stats.Repos}} {{range $repo := $stats.Repos}}
{{$repo}}<br> {{$repo}}<br>
{{end}} {{end}}
</td> </td>
</tr> </tr>
{{end}} {{end}}
</tbody>
</table> </table>
<table> {{end}}
{{range $commit := .BranchCommits}}
<tr> {{if .HasCommits}}
<td> <h3>Commits activity since {{.Config.Since}}{{.Config.DateMessage}}</h3>
{{if $commit.ShowRepo}}{{$commit.Repo}}{{end}} <table>
</td> {{range $commit := .BranchCommits}}
<td> <tr>
{{if $commit.ShowBranch}}{{$commit.Branch}}{{end}} <td>
</td> {{if $commit.ShowRepo}}{{$commit.Repo}}{{end}}
<td> </td>
{{if $commit.ShowDate}}{{$commit.Date}}{{end}} <td>
</td> {{if $commit.ShowBranch}}{{$commit.Branch}}{{end}}
<td> </td>
{{if $commit.ShowUser}} <td>
<img alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" height="36" width="36"> {{$commit.Name}} {{if $commit.ShowDate}}{{$commit.Date}}{{end}}
{{end}} </td>
</td> <td>
<td> {{if $commit.ShowUser}}
<a class="link" href="{{$commit.URL}}">{{$commit.Message}}</a> <img alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" height="36" width="36"> {{$commit.Name}}
</td> {{end}}
</tr> </td>
{{end}} <td>
</table> <a class="link" href="{{$commit.URL}}">{{$commit.Message}}</a>
</td>
</tr>
{{end}}
</table>
{{end}}
</div> </div>
` `

View file

@ -24,6 +24,7 @@ const (
` `
issuesTemplate = ` issuesTemplate = `
<div class="section-github-render"> <div class="section-github-render">
{{if .HasIssues}}
<h3>Issues: {{.ClosedIssues}} closed, {{.OpenIssues}} open</h3> <h3>Issues: {{.ClosedIssues}} closed, {{.OpenIssues}} open</h3>
<p> <p>
{{if .ShowList}} {{if .ShowList}}
@ -36,9 +37,25 @@ const (
{{end}} {{end}}
</p> </p>
<div class="github-board"> <div class="github-board">
<ul class="github-list">
<table class="issue-table" style="width: 100%;">
<thead>
<tr>
<th class="title">Repository</th>
<th class="title">Milestone</th>
<th class="title">Issues</th>
</tr>
</thead>
<tbody>
{{range $data := .Issues}} {{range $data := .Issues}}
<li class="github-commit-item"> <tr>
<td style="width: 20%;">{{$data.Repo}}</td>
<td style="width: 20%;">{{$data.Milestone}}</td>
<td style="width: 60%;">
<li class="github-commit-item">
<a class="link" href="{{$data.URL}}"> <a class="link" href="{{$data.URL}}">
<div class="issue-avatar"> <div class="issue-avatar">
{{if $data.IsOpen}} {{if $data.IsOpen}}
@ -46,19 +63,23 @@ const (
{{else}} {{else}}
` + closedIsvg + ` ` + closedIsvg + `
{{end}} {{end}}
</div> </div>
<div class="github-commit-body"> <div class="github-commit-body">
<div class="github-commit-title"><span class="label-name">{{$data.Repo}} - {{$data.Message}}</span> :{{$data.Milestone}}: {{$data.Labels}}</div> <div class="github-commit-title"><span class="label-name">{{$data.Message}}</span> {{$data.Labels}}</div>
<div class="github-commit-meta"> <div class="github-commit-meta">
#{{$data.ID}} opened on {{$data.Date}} by {{$data.Name}}, last updated {{$data.Updated}} #{{$data.ID}} opened on {{$data.Date}} by {{$data.Name}}, last updated {{$data.Updated}}
</div> </div>
</div> </div>
</a> </a>
<div class="clearfix" /> </li>
</li> </td>
</tr>
{{end}} {{end}}
</ul> </tbody>
</table>
</div> </div>
{{end}}
</div> </div>
` `
) )

View file

@ -29,36 +29,50 @@ const (
` `
milestonesTemplate = ` milestonesTemplate = `
<div class="section-github-render"> <div class="section-github-render">
<h3>Milestones: {{.ClosedMS}} closed, {{.OpenMS}} open</h3>
<div class="github-board"> {{if .HasMilestones}}
<ul class="github-list"> <h3>Milestones: {{.ClosedMS}} closed, {{.OpenMS}} open</h3>
{{range $data := .Milestones}} <div class="github-board">
<li class="github-commit-item"> <table class="milestone-table" style="width: 100%;">
<a class="link" href="{{$data.URL}}"> <thead>
<div class="issue-avatar"> <tr>
<th class="title">Repository</th>
<th class="title">Milestone</th>
<th class="title">Issue Progress</th>
<th class="title">X</th>
</tr>
</thead>
<tbody>
{{range $data := .Milestones}}
<tr>
<td style="width: 25%;">{{$data.Repo}} </td>
<td style="width: 20%;">{{$data.Name}} <br>
{{if $data.IsMilestone}}
{{$data.DueDate}} Last updated {{$data.UpdatedAt}}.
{{end}}
</td>
<td style="width: 45%;">
{{if $data.IsMilestone}}
<progress value="{{$data.Progress}}" max="100"></progress> <br>
{{$data.CompleteMsg}} complete {{$data.OpenIssues}} open {{$data.ClosedIssues}} closed
{{else}}
{{$data.OpenIssues}} open {{$data.ClosedIssues}} closed
{{end}}
</td>
<td style="width: 10%;">
{{if $data.IsOpen}} {{if $data.IsOpen}}
` + openMSsvg + ` ` + openMSsvg + `
{{else}} {{else}}
` + closedMSsvg + ` ` + closedMSsvg + `
{{end}} {{end}}
</div> </td>
<div class="github-commit-body"> </tr>
<div class="github-commit-title"><span class="label-name">{{$data.Repo}} - {{$data.Name}}</span> {{end}}
{{if $data.IsMilestone}} </tbody>
<progress value="{{$data.Progress}}" max="100"> </table>
{{end}} </div>
</div> {{end}}
<div class="github-commit-meta">
{{$data.DueDate}} Last updated {{$data.UpdatedAt}}.
{{$data.CompleteMsg}} complete {{$data.OpenIssues}} open {{$data.ClosedIssues}} closed
</div>
</div>
</a>
<div class="clearfix" />
</li>
{{end}}
</ul>
</div>
</div> </div>
` `
) )

View file

@ -13,6 +13,7 @@ package github
const summaryTemplate = ` const summaryTemplate = `
<div class="section-github-render"> <div class="section-github-render">
<h3> <h3>
Activity since {{.Config.Since}}{{.Config.DateMessage}} for {{.Config.Owner}} repositories: Activity since {{.Config.Since}}{{.Config.DateMessage}} for {{.Config.Owner}} repositories:
{{range $data := .Config.Lists}} {{range $data := .Config.Lists}}
@ -23,11 +24,33 @@ const summaryTemplate = `
{{end}} {{end}}
{{end}} {{end}}
</h3> </h3>
<h3>
Common Labels: <br> {{if .HasSharedLabels}}
{{range $slabel := .SharedLabels}} <h3>
{{$slabel.Name}} {{$slabel.Count}} {{$slabel.Repos}} <br> Common Labels: <br>
{{end}} </h3>
</h3>
<table class="label-table" style="width: 100%;">
<thead>
<tr>
<th class="title">Label</th>
<th class="title">Count</th>
<th class="title">Repositories</th>
</tr>
</thead>
<tbody>
{{range $slabel := .SharedLabels}}
<tr>
<td style="width: 25%;">{{$slabel.Name}}</td>
<td style="width: 25%;">{{$slabel.Count}}</td>
<td style="width: 50%;">{{$slabel.Repos}}</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
</div> </div>
` `