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

New GitHub wip

This commit is contained in:
EnesAlili 2016-09-29 14:20:43 +01:00
parent cbbfd8f381
commit 48dbc0b196
7 changed files with 109 additions and 112 deletions

View file

@ -40,6 +40,11 @@
}
.section-github-render {
a:hover {
text-decoration: underline;
}
.github-table {
margin: 0 !important;
border: none !important;
@ -56,15 +61,36 @@
margin: 30px 0 0 0;
}
.github-table thead tr th {
padding: 15px 0;
border-bottom: 1px solid #e1e1e1;
text-transform: uppercase;
font-size: 14px;
text-align: left;
span {
color:#838d94;
}
}
.github-table tbody tr td {
border: none!important;
padding-left: 20px!important;
padding-bottom: 0!important;
}
span.dataid {
color:#838d94;
}
.issue-label {
color:white;
font-size: 11px;
color: $color-white;
padding: 0px 8px;
margin-right: 5px;
border-radius: 2px;
padding: 4px 6px;
border-radius: 4px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
display: inline-block;
line-height: 22px;
margin-left: 10px;
}
progress[value] {
@ -74,45 +100,15 @@
width: 150px;
}
.progress-meta {
color: $color-gray;
font-size: 1rem;
font-family: "arial";
span.issue-state {
float: left;
margin-right: 10px;
margin-top: 3px;
}
.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 {
img.github-avatar {
width: 24px;
border-radius: 4px;
width: 36px;
height: 36px;
margin-right: 5px;
}
.branch {
font-family: "open_sanssemibold";
margin-right: 10px;
}
}

View file

@ -59,11 +59,9 @@
}
.heading {
padding: 10px 20px;
color: white!important;
a {
color: white!important;
color: #3c3c3c!important;
}
h3 {

View file

@ -25,8 +25,15 @@ const commitsTemplate = `
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p>
<div class="margin-top-20"></div>
<table class="github-table">
<thead>
<tr>
<th class="title">Contributors</th>
<th></th>
</tr>
</thead>
<tbody>
{{range $stats := .AuthorStats}}
<tr>
@ -52,7 +59,6 @@ const commitsTemplate = `
{{range $repo := $stats.Repos}} &middot; {{$repo}} {{end}}
{{end}}
</div>
<div class="margin-top-10"></div>
</td>
</tr>
{{end}}
@ -62,26 +68,27 @@ const commitsTemplate = `
-->
{{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">
<table class="github-table" style="width: 100%;">
<thead>
<tr>
<th class="title">Commits <span>{{len .BranchCommits}} commits by {{.NumContributors}} contributors</span>
</th>
<th></th>
</tr>
</thead>
<tbody>
{{range $commit := .BranchCommits}}
<tr>
<td style="no-width">
<img class="github-avatar" alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" />
<a href="{{$commit.URL}}">{{$commit.Message}}</a>
</td>
<td>
<div class="contributor-name"><a href="{{$commit.URL}}">{{$commit.Message}}</a></div>
<td style="text-align:right;">
<div class="contributor-meta">
<img class="github-avatar" alt="@{{$commit.Name}}" src="{{$commit.Avatar}}" />
{{$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}}

View file

@ -235,6 +235,9 @@ func (p *Provider) Render(ctx *provider.Context, config, data string) string {
if err != nil {
log.Error("github render template.Parse error:", err)
for k,v := range strings.Split(resp.template,"\n"){
fmt.Println("DEBUG",k+1,v)
}
return "Documize internal github template.Parse error: " + err.Error()
}

View file

@ -13,14 +13,14 @@ package github
const (
openIsvg = `
<span title="Open issue">
<span class="issue-state" title="Open Issue">
<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>
</svg>
</span>
`
closedIsvg = `
<span title="Closed issue">
<span class="issue-state" title="Closed Issue">
<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>
</svg>
@ -29,35 +29,35 @@ const (
issuesTemplate = `
<div class="section-github-render">
{{if .HasIssues}}
<div class="heading">Issues</div>
<!-- <p>
There are {{.ClosedIssues}} closed
{{if eq 1 .ClosedIssues}}issue{{else}}issues{{end}}
and {{.OpenIssues}} open
{{if eq 1 .OpenIssues}}issue{{else}}issues{{end}}
across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p> -->
<table class="github-table" style="width: 100%;">
<thead>
<tr>
<th class="title">
Issues <span>{{.ClosedIssues}} closed {{if eq 1 .ClosedIssues}}{{else}}issues{{end}} and {{.OpenIssues}} open
{{if eq 1 .OpenIssues}}issue{{else}}{{end}}</span>
</th>
<th></th>
</tr>
</thead>
<div class="margin-top-20"></div>
<table class="github-table">
<tbody>
{{range $data := .Issues}}
<tr>
<td class="no-width">
<div class="issue-symbol">
<td>
{{if $data.IsOpen}}
` + openIsvg + `
{{else}}
` + closedIsvg + `
{{end}}
</div>
<a href="{{$data.URL}}">{{$data.Message}}</a> <span class="dataid">#{{$data.ID}}</span>
{{$data.Labels}}
</td>
<td><div class="margin-left-10"></div></td>
<td>
<div class="issue-name"><a href="{{$data.URL}}">{{$data.Message}} <span class="dataid"></span></a></div>
<span class="milestone-meta">#{{$data.ID}} &middot; {{$data.Repo}} &middot; {{$data.Milestone}} &middot; {{$data.Creator}} opened on {{$data.Date}}</span>
<div>{{$data.Labels}}</div>
<td style="text-align:right;">
<div class="milestone-meta">
<span class="meta-milestone">{{$data.Milestone}}</span> &middot;
<span class="meta-creator">{{$data.Creator}}</span> &middot; <span class="meta-date">{{$data.Date}}</span>
</div>
</td>
</tr>
{{end}}

View file

@ -30,23 +30,19 @@ const (
milestonesTemplate = `
<div class="section-github-render">
{{if .HasMilestones}}
<div class="heading">Milestones</div>
<!-- <p>
There are
{{.ClosedMS}}
{{if eq 1 .ClosedMS}} milestone {{else}} milestones {{end}}
closed and {{.OpenMS}}
{{if eq 1 .OpenMS}} milestone {{else}} milestones {{end}}
open across {{.RepoCount}}
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
</p> -->
<div class="margin-top-20"></div>
<table class="github-table">
<table class="github-table" style="width: 100%;">
<thead>
<tr>
<th class="title">Milestones <span> {{.ClosedMS}} {{if eq 1 .ClosedMS}} closed and {{.OpenMS}} {{if eq 1 .OpenMS}} open </span>
</th>
<th></th>
</tr>
</thead>
<tbody>
{{range $data := .Milestones}}
<tr>
<td class="no-width">
<div class="milestone-symbol">
<td>
{{if $data.IsMilestone}}
{{if $data.IsOpen}}
` + openMSsvg + `
@ -54,9 +50,7 @@ const (
` + closedMSsvg + `
{{end}}
{{end}}
</div>
</td>
<td><div class="margin-left-10"></div></td>
<td>
<div class="milestone-name"><a class="link" href="{{$data.URL}}">{{$data.Name}}</a></div>
<span class="milestone-meta">{{$data.Repo}}</span>
@ -64,7 +58,6 @@ const (
<span class="milestone-meta"> &middot; {{$data.DueDate}}</span>
{{end}}
</td>
<td><div class="margin-left-150"></div></td>
<td class="no-width">
{{if $data.IsMilestone}}
<progress value="{{$data.Progress}}" max="100"></progress>

View file

@ -14,7 +14,7 @@ package trello
const tradTemplate = `
<div class="section-trello-render">
{{if ne .Detail.Board.ID ""}}
<div class="heading" style="background-color:{{.Detail.Board.Prefs.BackgroundColor}};">
<div class="heading">
<h3><a href="{{ .Detail.Board.URL }}">{{.Detail.Board.Name}} Board</a></h3>
<p>There are {{ .Detail.CardCount }} cards across {{ .Detail.ListCount }} lists</p>
</div>