From 48dbc0b1961fd6a4a61f3a9473aba5f9b4ab7c59 Mon Sep 17 00:00:00 2001
From: EnesAlili
Date: Thu, 29 Sep 2016 14:20:43 +0100
Subject: [PATCH] New GitHub wip
---
app/app/styles/section/github.scss | 86 +++++++++++-----------
app/app/styles/section/trello.scss | 4 +-
core/section/github/commits_template.go | 31 +++++---
core/section/github/github.go | 3 +
core/section/github/issues_template.go | 52 ++++++-------
core/section/github/milestones_template.go | 43 +++++------
core/section/trello/trad_template.go | 2 +-
7 files changed, 109 insertions(+), 112 deletions(-)
diff --git a/app/app/styles/section/github.scss b/app/app/styles/section/github.scss
index 3b06d3a6..887debb5 100644
--- a/app/app/styles/section/github.scss
+++ b/app/app/styles/section/github.scss
@@ -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 {
- font-size: 11px;
- color: $color-white;
- padding: 0px 8px;
- margin-right: 5px;
- border-radius: 2px;
- box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
- display: inline-block;
- line-height: 22px;
+ color:white;
+ font-size: 11px;
+ padding: 4px 6px;
+ border-radius: 4px;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
+ 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;
}
}
diff --git a/app/app/styles/section/trello.scss b/app/app/styles/section/trello.scss
index e1a0b6f1..235dfe90 100644
--- a/app/app/styles/section/trello.scss
+++ b/app/app/styles/section/trello.scss
@@ -59,11 +59,9 @@
}
.heading {
- padding: 10px 20px;
- color: white!important;
a {
- color: white!important;
+ color: #3c3c3c!important;
}
h3 {
diff --git a/core/section/github/commits_template.go b/core/section/github/commits_template.go
index a8601a51..20a80333 100644
--- a/core/section/github/commits_template.go
+++ b/core/section/github/commits_template.go
@@ -25,8 +25,15 @@ const commitsTemplate = `
{{if eq 1 .RepoCount}} repository. {{else}} repositories. {{end}}
-
+
+
+
+ Contributors |
+ |
+
+
+
{{range $stats := .AuthorStats}}
@@ -52,7 +59,6 @@ const commitsTemplate = `
{{range $repo := $stats.Repos}} · {{$repo}} {{end}}
{{end}}
-
{{end}}
@@ -62,26 +68,27 @@ const commitsTemplate = `
-->
{{if .HasCommits}}
- Commits
-
-
-
+
+
+
+ Commits {{len .BranchCommits}} commits by {{.NumContributors}} contributors
+ |
+ |
+
+
{{range $commit := .BranchCommits}}
-
+ {{$commit.Message}}
|
-
-
+ |
-
|
{{end}}
diff --git a/core/section/github/github.go b/core/section/github/github.go
index b3c02e73..e072ae4f 100644
--- a/core/section/github/github.go
+++ b/core/section/github/github.go
@@ -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()
}
diff --git a/core/section/github/issues_template.go b/core/section/github/issues_template.go
index 284544cb..a7571e8a 100644
--- a/core/section/github/issues_template.go
+++ b/core/section/github/issues_template.go
@@ -13,14 +13,14 @@ package github
const (
openIsvg = `
-
+
`
closedIsvg = `
-
+
@@ -29,35 +29,35 @@ const (
issuesTemplate = `
{{if .HasIssues}}
-
Issues
-
+
+
+
+
+ Issues {{.ClosedIssues}} closed {{if eq 1 .ClosedIssues}}{{else}}issues{{end}} and {{.OpenIssues}} open
+ {{if eq 1 .OpenIssues}}issue{{else}}{{end}}
+ |
+
+ |
+
+
-
-
{{range $data := .Issues}}
-
-
- {{if $data.IsOpen}}
- ` + openIsvg + `
- {{else}}
- ` + closedIsvg + `
- {{end}}
-
- |
- |
-
- #{{$data.ID}} · {{$data.Repo}} · {{$data.Milestone}} · {{$data.Creator}} opened on {{$data.Date}}
- {{$data.Labels}}
+ {{if $data.IsOpen}}
+ ` + openIsvg + `
+ {{else}}
+ ` + closedIsvg + `
+ {{end}}
+ {{$data.Message}} #{{$data.ID}}
+ {{$data.Labels}}
+ |
+
+
+ {{$data.Milestone}} ·
+ {{$data.Creator}} · {{$data.Date}}
+
|
{{end}}
diff --git a/core/section/github/milestones_template.go b/core/section/github/milestones_template.go
index 06e5de52..653d232b 100644
--- a/core/section/github/milestones_template.go
+++ b/core/section/github/milestones_template.go
@@ -30,41 +30,34 @@ const (
milestonesTemplate = `
{{if .HasMilestones}}
-
Milestones
-
-
-
-
+
+
+
+ Milestones {{.ClosedMS}} {{if eq 1 .ClosedMS}} closed and {{.OpenMS}} {{if eq 1 .OpenMS}} open
+ |
+ |
+
+
+
+
{{range $data := .Milestones}}
-
-
- {{if $data.IsMilestone}}
- {{if $data.IsOpen}}
- ` + openMSsvg + `
- {{else}}
- ` + closedMSsvg + `
- {{end}}
+
+ {{if $data.IsMilestone}}
+ {{if $data.IsOpen}}
+ ` + openMSsvg + `
+ {{else}}
+ ` + closedMSsvg + `
{{end}}
-
+ {{end}}
|
- |
{{$data.Repo}}
{{if $data.IsMilestone}}
- · {{$data.DueDate}}
+ · {{$data.DueDate}}
{{end}}
|
- |
{{if $data.IsMilestone}}
diff --git a/core/section/trello/trad_template.go b/core/section/trello/trad_template.go
index a25dd9d8..72cff5bf 100644
--- a/core/section/trello/trad_template.go
+++ b/core/section/trello/trad_template.go
@@ -14,7 +14,7 @@ package trello
const tradTemplate = `
{{if ne .Detail.Board.ID ""}}
-
+
There are {{ .Detail.CardCount }} cards across {{ .Detail.ListCount }} lists
| |