1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 14:49: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

@ -40,77 +40,26 @@
} }
.section-github-render { .section-github-render {
.github-table {
h3 { margin: 0 !important;
margin-bottom: 0px; border: none !important;
} line-height: 30px;
h6 { td {
font-size: 18px;
margin: 0;
display: inline;
}
h6 a {
color: inherit;
}
p {
margin-top: 5px;
}
.github-board {
margin-top: 30px;
}
table {
margin-left: 0px!important;
border: none!important;
}
thead.github th {
background-color: #f8f8f8;
text-align: left;
padding: 4px 30px;
font-family: "open_sanssemibold";
border-bottom: 1px solid #e1e1e1 !important;
}
tbody.github td {
border: none !important; border: none !important;
padding: 8px 30px !important;
vertical-align: top; vertical-align: top;
} }
span.label-private {
font-weight: normal;
color: #4c4a42;
background-color: #ffefc6;
padding: 3px 4px;
font-size: 12px;
border-radius: 2px;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
line-height: 1;
margin-left: 10px;
} }
table.label-table { .heading {
margin-top:30px !important; font-size: 1.6rem;
margin: 30px 0 0 0;
} }
table.milestone-table { .issue-label {
progress[value] {
background-color: #eeeeee;
border-radius: 3px;
height: 15px;
width: 50%;
}
}
.github-issue-label {
font-size: 11px; font-size: 11px;
color: white; color: $color-white;
padding: 0px 4px; padding: 0px 8px;
margin-right: 5px; margin-right: 5px;
border-radius: 2px; border-radius: 2px;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
@ -118,29 +67,63 @@
line-height: 22px; line-height: 22px;
} }
.date-meta { progress[value] {
color: #767676; background-color: $color-off-white;
font-size: 13px; border-radius: 3px;
} height: 15px;
.dataid { width: 150px;
color: #767676;
font-size: 13px;
} }
.repo { .progress-meta {
font-size: 16px; color: $color-gray;
font-size: 1rem;
font-family: "arial";
}
.contributor-name {
line-height: 15px;
}
.milestone-name, .issue-name, .contributor-name {
font-size: 1.2rem;
}
.milestone-symbol {
padding-top: 3px;
}
.issue-symbol {
padding-top: 3px;
}
.contributor-meta {
line-height: 30px;
}
.milestone-meta, .issue-meta, .contributor-meta {
color: $color-gray;
font-size: 1rem;
}
.github-avatar {
border-radius: 4px;
width: 36px;
height: 36px;
} }
.branch { .branch {
font-family: "open_sanssemibold"; font-family: "open_sanssemibold";
} }
.milestone { // span.label-private {
font-size: 15px; // font-weight: normal;
} // color: #4c4a42;
// background-color: #ffefc6;
.github-avatar { // padding: 3px 4px;
border-radius: 4px; // font-size: 12px;
} // border-radius: 2px;
// box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
// line-height: 1;
// margin-left: 10px;
// }
} }

View file

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

View file

@ -99,7 +99,7 @@ func wrapLabels(labels []gogithub.Label) (l string, labelNames []string, labelCo
for _, ll := range labels { for _, ll := range labels {
labelNames = append(labelNames, *ll.Name) labelNames = append(labelNames, *ll.Name)
labelColors = append(labelColors, *ll.Color) labelColors = append(labelColors, *ll.Color)
l += `<span class="github-issue-label" style="background-color:#` + *ll.Color + `">` + *ll.Name + `</span> ` l += `<span class="issue-label" style="background-color:#` + *ll.Color + `">` + *ll.Name + `</span> `
} }
return l, labelNames, labelColors return l, labelNames, labelColors
} }

View file

@ -29,7 +29,7 @@ const (
issuesTemplate = ` issuesTemplate = `
<div class="section-github-render"> <div class="section-github-render">
{{if .HasIssues}} {{if .HasIssues}}
<h3>Issues</h3> <div class="heading">Issues</div>
<p> <p>
There are {{.ClosedIssues}} closed There are {{.ClosedIssues}} closed
{{if eq 1 .ClosedIssues}}issue{{else}}issues{{end}} {{if eq 1 .ClosedIssues}}issue{{else}}issues{{end}}
@ -38,24 +38,14 @@ const (
across {{.RepoCount}} across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}} {{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p> </p>
<p>
{{if .ShowList}}
Including issues labelled
{{range $label := .List}}
{{if $label.Included}}
<span class="github-issue-label" style="background-color:#{{$label.Color}}">{{$label.Name}}</span>
{{end}}
{{end}}
{{end}}
</p>
<div class="github-board">
<table class="issue-table width-100"> <div class="margin-top-20"></div>
<tbody class="github"> <table class="github-table no-width">
<tbody>
{{range $data := .Issues}} {{range $data := .Issues}}
<tr> <tr>
<td class="width-5"> <td class="no-width">
<div class="issue-avatar"> <div class="issue-symbol">
{{if $data.IsOpen}} {{if $data.IsOpen}}
` + openIsvg + ` ` + openIsvg + `
{{else}} {{else}}
@ -63,22 +53,16 @@ const (
{{end}} {{end}}
</div> </div>
</td> </td>
<td><div class="margin-left-10"></div></td>
<td class="width-55"> <td class="no-width">
<h6><a class="link" href="{{$data.URL}}">{{$data.Message}} <span class="dataid">#{{$data.ID}}</span></a></h6> </br> <div class="issue-name"><a href="{{$data.URL}}">{{$data.Message}} <span class="dataid"></span></a></div>
<span class="milestone">{{$data.Milestone}}</span> <span class="issue-label">{{$data.Labels}}</span> <span class="milestone-meta">#{{$data.ID}} &middot; {{$data.Repo}} &middot; {{$data.Milestone}} &middot; {{$data.Creator}} opened on {{$data.Date}}</span>
</td> <div>{{$data.Labels}}</div>
<td class="width-40">
<h6>{{$data.Repo}}</h6> <br>
<span class="date-meta">{{$data.Creator}} opened on {{$data.Date}}</span>
</td> </td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>
</table> </table>
</div>
{{end}} {{end}}
</div> </div>
` `

View file

@ -111,7 +111,7 @@ func getMilestones(client *gogithub.Client, config *githubConfig) ([]githubMiles
} }
} }
if include { if include {
dd := "No due date." dd := "no due date"
if v.DueOn != nil { if v.DueOn != nil {
// TODO refactor to add message in red if the milestone is overdue // TODO refactor to add message in red if the milestone is overdue
dd = "due on " + (*v.DueOn).Format(milestonesTimeFormat) + "" dd = "due on " + (*v.DueOn).Format(milestonesTimeFormat) + ""

View file

@ -28,10 +28,9 @@ const (
</span> </span>
` `
milestonesTemplate = ` milestonesTemplate = `
<div class="section-github-render">
<div class="section-github-render">
{{if .HasMilestones}} {{if .HasMilestones}}
<h3>Milestones</h3> <div class="heading">Milestones</div>
<p> <p>
There are There are
{{.ClosedMS}} {{.ClosedMS}}
@ -41,12 +40,13 @@ const (
open across {{.RepoCount}} open across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}} {{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p> </p>
<div class="github-board"> <div class="margin-top-20"></div>
<table class="milestone-table width-100"> <table class="github-table no-width">
<tbody class="github"> <tbody>
{{range $data := .Milestones}} {{range $data := .Milestones}}
<tr> <tr>
<td style="width:5%;"> <td class="no-width">
<div class="milestone-symbol">
{{if $data.IsMilestone}} {{if $data.IsMilestone}}
{{if $data.IsOpen}} {{if $data.IsOpen}}
` + openMSsvg + ` ` + openMSsvg + `
@ -54,27 +54,29 @@ const (
` + closedMSsvg + ` ` + closedMSsvg + `
{{end}} {{end}}
{{end}} {{end}}
</div>
</td> </td>
<td class="width-55"> <td><div class="margin-left-10"></div></td>
<h6>{{$data.Name}}</h6> <td class="no-width">
<div class="milestone-name"><a class="link" href="{{$data.URL}}">{{$data.Name}}</a></div>
<span class="milestone-meta">{{$data.Repo}}</span>
{{if $data.IsMilestone}} {{if $data.IsMilestone}}
<span class="date-meta">{{$data.DueDate}}</span> <span class="milestone-meta">&middot; {{$data.DueDate}}</span>
{{end}}<br> {{end}}
<span class="repo"><a class="link" href="{{$data.URL}}">{{$data.Repo}}</a></span>
</td> </td>
<td class="width-40"> <td><div class="margin-left-150"></div></td>
<td class="no-width">
{{if $data.IsMilestone}} {{if $data.IsMilestone}}
<progress value="{{$data.Progress}}" max="100"></progress> <br> <progress value="{{$data.Progress}}" max="100"></progress>
{{$data.CompleteMsg}} complete {{$data.OpenIssues}} open {{$data.ClosedIssues}} closed <div class="progress-meta"><span class="bold color-off-black">{{$data.CompleteMsg}}</span> complete &nbsp;&nbsp;&nbsp;<span class="bold color-off-black">{{$data.OpenIssues}}</span> open &nbsp;&nbsp;&nbsp;<span class="bold color-off-black">{{$data.ClosedIssues}}</span> closed</div>
{{else}} {{else}}
{{$data.OpenIssues}} open {{$data.ClosedIssues}} closed <div class="progress-meta"><span class="bold color-off-black">{{$data.OpenIssues}}</span> open <span class="bold color-off-black">{{$data.ClosedIssues}}</span> closed</div>
{{end}} {{end}}
</td> </td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>
</table> </table>
</div>
{{end}} {{end}}
</div> </div>
` `

View file

@ -13,9 +13,7 @@ package github
const summaryTemplate = ` const summaryTemplate = `
<div class="section-github-render"> <div class="section-github-render">
<p>Activity since {{.Config.Since}}{{.Config.DateMessage}} for {{.Config.Owner}} repositories:
<p>
Activity since {{.Config.Since}}{{.Config.DateMessage}} for {{.Config.Owner}} repositories:
{{range $data := .Config.Lists}} {{range $data := .Config.Lists}}
{{if $data.Included}} {{if $data.Included}}
<a class="link" href="{{$data.URL}}"> <a class="link" href="{{$data.URL}}">
@ -26,20 +24,19 @@ const summaryTemplate = `
</p> </p>
{{if .HasSharedLabels}} {{if .HasSharedLabels}}
<h3>Common Labels</h3> <div class="heading">Labels</div>
<p>There <p>There
{{if eq 1 (len .SharedLabels)}} is {{else}} are {{end}} {{if eq 1 (len .SharedLabels)}} is {{else}} are {{end}}
{{len .SharedLabels}} {{len .SharedLabels}}
shared shared
{{if eq 1 (len .SharedLabels)}} label {{else}} labels {{end}} {{if eq 1 (len .SharedLabels)}} label {{else}} labels {{end}}
across the repositories.</p> across the repositories.</p>
<table class="width-100"> <table class="github-table">
<tbody class="github"> <tbody>
{{range $slabel := .SharedLabels}} {{range $slabel := .SharedLabels}}
<tr> <tr>
<td class="width-100"> <td class="no-width"><span class="issue-label" style="background-color:#{{$slabel.Color}}">{{$slabel.Name}} ({{$slabel.Count}})</span></td>
<span class="github-issue-label" style="background-color:#{{$slabel.Color}}">{{$slabel.Name}} ({{$slabel.Count}})</span> in {{$slabel.Repos}} <td>{{$slabel.Repos}}</td>
</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>