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

Strip github tables from design

This commit is contained in:
EnesAlili 2016-09-05 08:59:34 +01:00
parent 2c76644b23
commit 8183af4bb2
6 changed files with 87 additions and 118 deletions

View file

@ -42,7 +42,7 @@
.section-github-render { .section-github-render {
h3 { h3 {
margin-bottom: 0px; margin-bottom: 0px;
} }
p { p {
@ -55,6 +55,7 @@
table { table {
margin-left: 0px!important; margin-left: 0px!important;
border: none!important;
} }
thead.github th { thead.github th {
@ -67,8 +68,7 @@
tbody.github td { tbody.github td {
border: none !important; border: none !important;
border-bottom: 1px solid #e1e1e1 !important; padding: 15px 30px !important;
padding: 15px 30px !important;
} }
span.label-private { span.label-private {
@ -88,33 +88,45 @@
} }
table.milestone-table { table.milestone-table {
td a.link {
}
}
/*
table.milestone-table td a.link {
font-size: 18px; font-size: 18px;
} }
td span.milestone { td span.milestone {
color: #3c3c3c; color: #3c3c3c;
font-size: 18px; font-size: 18px;
} }
td span.date-meta { td span.date-meta {
margin-right: 10px; margin-right: 10px;
font-size: 14px; font-size: 14px;
color: #767676; color: #767676;
}
img { td span.date-meta img {
height: 14px; height: 14px;
margin-right: 10px; margin-right: 10px;
}
} }
progress[value] { progress[value] {
background-color: #eeeeee; background-color: #eeeeee;
border-radius: 3px; border-radius: 3px;
height: 10px; height: 10px;
width: 50%; width: 50%;
}
} }
table.contributor-table { table.contributor-table {
@ -141,8 +153,9 @@
line-height: 22px; line-height: 22px;
} }
table.issue-table {
td a.link {
table.issue-table td a.link {
font-size: 18px; font-size: 18px;
} }
@ -204,6 +217,4 @@
} }
} }
} }
} */
}
}

View file

@ -16,33 +16,23 @@ const commitsTemplate = `
{{if .HasAuthorStats}} {{if .HasAuthorStats}}
<h3>Contributor activity</h3> <h3>Contributors</h3>
<p>There are 3 contributors across 6 repositories.</p>
<table class="contributor-table" style="width: 100%;"> <table class="contributor-table" style="width: 100%;">
<thead class="github">
<tr>
<th class="title">Contributor</th>
<th class="title">Assigned/Closed</th>
<th class="title">#Commits</th>
<th class="title">Branches</th>
</tr>
</thead>
<tbody class="github"> <tbody class="github">
{{range $stats := .AuthorStats}} {{range $stats := .AuthorStats}}
<tr> <tr>
<td style="width: 20%;"> <td style="width: 5%;">
<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>
{{$stats.Author}}
</td> </td>
<td style="width: 15%;">{{$stats.OpenIssues}} / {{$stats.ClosedIssues}}</td>
<td style="width: 15%;">{{$stats.CommitCount}}</td> <td style="width:50%;">
<td style="width: 50%;"> {{$stats.Author}} has been assigned {{$stats.OpenIssues}} issues, {{$stats.ClosedIssues}} are now closed, has made {{$stats.CommitCount}} commit on 6 branches.
{{range $repo := $stats.Repos}} <br>
{{$repo}}<br> {{range $repo := $stats.Repos}} {{$repo}}, {{end}}
{{end}}
</td> </td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>
@ -50,7 +40,7 @@ const commitsTemplate = `
{{end}} {{end}}
{{if .HasCommits}} {{if .HasCommits}}
<h3>Commits activity</h3> <h3>Commits</h3>
<table class="contributor-table" style="width: 100%;"> <table class="contributor-table" style="width: 100%;">
<thead class="github"> <thead class="github">

View file

@ -14,14 +14,14 @@ package github
const ( const (
openIsvg = ` openIsvg = `
<span title="Open issue"> <span title="Open issue">
<svg height="16" version="1.1" viewBox="0 0 14 16" width="14" class="color: #6cc644;"> <svg height="16" version="1.1" viewBox="0 0 14 16" width="14" class="color:#6cc644;">
<path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path> <path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path>
</svg> </svg>
</span> </span>
` `
closedIsvg = ` closedIsvg = `
<span title="Closed issue"> <span title="Closed issue">
<svg height="16" version="1.1" viewBox="0 0 16 16" width="16" class="color: #bd2c00;"> <svg height="16" version="1.1" viewBox="0 0 16 16" width="16" class="color:#bd2c00;">
<path d="M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z"></path> <path d="M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z"></path>
</svg> </svg>
</span> </span>
@ -30,7 +30,7 @@ const (
<div class="section-github-render"> <div class="section-github-render">
{{if .HasIssues}} {{if .HasIssues}}
<h3>Issues</h3> <h3>Issues</h3>
<p>There are {{.ClosedIssues}} closed and {{.OpenIssues}} open</p> <p>There are {{.ClosedIssues}} closed and {{.OpenIssues}} open across 6 repositories.</p>
<p> <p>
{{if .ShowList}} {{if .ShowList}}
Including issues labelled Including issues labelled
@ -46,38 +46,31 @@ const (
<table class="issue-table" style="width: 100%;"> <table class="issue-table" style="width: 100%;">
<thead class="github">
<tr>
<th class="title">Repository / Milestone</th>
<th class="title">Issues</th>
</tr>
</thead>
<tbody class="github"> <tbody class="github">
{{range $data := .Issues}} {{range $data := .Issues}}
<tr> <tr>
<td style="width: 30%;"> <td style="width: 5%;">
<span><a class="link" href="{{$data.URL}}">{{$data.Repo}}</a></span>{{if $data.Private}}<span class="label-private">Private</span>{{end}}</br> <div class="issue-avatar">
<span class="milestone">{{$data.Milestone}}</span> {{if $data.IsOpen}}
` + openIsvg + `
{{else}}
` + closedIsvg + `
{{end}}
</div>
</td> </td>
<td style="width: 70%;">
<li class="github-commit-item"> <td style="width: 35%;">
<a class="link" href="{{$data.URL}}"> {{$data.Message}}</br>
<div class="issue-avatar"> <span class="milestone">{{$data.Milestone}}</span> {{$data.Labels}}
{{if $data.IsOpen}} </td>
` + openIsvg + `
{{else}} <td style="width:60%;">
` + closedIsvg + ` <span><a class="link" href="{{$data.URL}}">{{$data.Repo}}</a></span>
{{end}} <div class="github-commit-body">
<div class="github-commit-meta">
#{{$data.ID}} opened on {{$data.Date}} by {{$data.Name}}
</div> </div>
<div class="github-commit-body"> </div>
<div class="github-commit-title"><span class="label-name">{{$data.Message}}</span> {{$data.Labels}}</div>
<div class="github-commit-meta">
#{{$data.ID}} opened on {{$data.Date}} by {{$data.Name}}, last updated {{$data.Updated}}
</div>
</div>
</a>
</li>
</td> </td>
</tr> </tr>
{{end}} {{end}}

View file

@ -114,7 +114,7 @@ func getMilestones(client *gogithub.Client, config *githubConfig) ([]githubMiles
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) + ""
} }
up := "" up := ""
if v.UpdatedAt != nil { if v.UpdatedAt != nil {

View file

@ -32,40 +32,12 @@ const (
{{if .HasMilestones}} {{if .HasMilestones}}
<h3>Milestones</h3> <h3>Milestones</h3>
<p>There are {{.ClosedMS}} closed and {{.OpenMS}} open</p> <p>There is {{.ClosedMS}} milestone closed and {{.OpenMS}} milestone open across #number repositories.</p>
<div class="github-board"> <div class="github-board">
<table class="milestone-table" style="width: 100%;"> <table class="milestone-table" style="width: 100%;">
<thead class="github">
<tr>
<th class="title">Repository</th>
<th class="title">Milestone</th>
<th class="title">Progress</th>
<th class="title"></th>
</tr>
</thead>
<tbody class="github"> <tbody class="github">
{{range $data := .Milestones}} {{range $data := .Milestones}}
<tr> <tr>
<td style="width: 30%;">
<span><a class="link" href="{{$data.URL}}">{{$data.Repo}}</a></span>
{{if $data.Private}}<span class="label-private">Private</span>{{end}}
</td>
<td style="width: 35%;">
<span class="milestone">{{$data.Name}}</span><br>
{{if $data.IsMilestone}}
<span class="date-meta">{{$data.DueDate}}</span>
<span class="date-meta"><img src="assets/img/github/icon-last-updated.png" alt="Last Updated">Last updated {{$data.UpdatedAt}}</span>
{{end}}
</td>
<td style="width: 30%;">
{{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: 5%;"> <td style="width: 5%;">
{{if $data.IsOpen}} {{if $data.IsOpen}}
` + openMSsvg + ` ` + openMSsvg + `
@ -73,6 +45,21 @@ const (
` + closedMSsvg + ` ` + closedMSsvg + `
{{end}} {{end}}
</td> </td>
<td style="width: 35%;">
<span class="milestone">{{$data.Name}}</span>
{{if $data.IsMilestone}}
<span class="date-meta">{{$data.DueDate}}</span>
{{end}}<br>
<span><a class="link" href="{{$data.URL}}">{{$data.Repo}}</a></span>
</td>
<td style="width: 60%;">
{{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>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View file

@ -14,7 +14,7 @@ package github
const summaryTemplate = ` const summaryTemplate = `
<div class="section-github-render"> <div class="section-github-render">
<h5> <p>
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}}
{{if $data.Included}} {{if $data.Included}}
@ -23,28 +23,16 @@ const summaryTemplate = `
</a> </a>
{{end}} {{end}}
{{end}} {{end}}
</h5> </p>
{{if .HasSharedLabels}} {{if .HasSharedLabels}}
<h3> <h3>Common Labels</h3>
Common Labels <br> <p>There is 1 shared label across the repositories.</p>
</h3> <table style="width:100%;">
<table class="label-table" style="width: 100%;">
<thead class="github">
<tr>
<th class="title">Label</th>
<th class="title">Count</th>
<th class="title">Repositories</th>
</tr>
</thead>
<tbody class="github"> <tbody class="github">
{{range $slabel := .SharedLabels}} {{range $slabel := .SharedLabels}}
<tr> <tr>
<td style="width: 15%;">{{$slabel.Name}}</td> <td style="width:100%;">{{$slabel.Name}} ({{$slabel.Count}}) in {{$slabel.Repos}}</td>
<td style="width: 15%;">{{$slabel.Count}}</td>
<td style="width: 70%;">{{$slabel.Repos}}</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>