From a7a2267e5c2d3a4c7018bc27f3d7546e1a619552 Mon Sep 17 00:00:00 2001 From: Elliott Stoneham Date: Fri, 9 Sep 2016 16:56:19 +0100 Subject: [PATCH] hide labels when none shared --- core/section/trello/boards_template.go | 2 +- core/section/trello/labels_template.go | 42 ++++++++++++++------------ core/section/trello/master_template.go | 5 ++- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/core/section/trello/boards_template.go b/core/section/trello/boards_template.go index 062fd4d5..a963106c 100644 --- a/core/section/trello/boards_template.go +++ b/core/section/trello/boards_template.go @@ -13,7 +13,7 @@ package trello const boardsTemplate = ` -

All Boards

+

Boards

Changes since {{.Since}}.

diff --git a/core/section/trello/labels_template.go b/core/section/trello/labels_template.go index 60b809f4..e34a3882 100644 --- a/core/section/trello/labels_template.go +++ b/core/section/trello/labels_template.go @@ -12,24 +12,26 @@ package trello const labelsTemplate = ` -

Labels

-

There are {{len .SharedLabels}} common labels across the boards.

-
-
- - {{range $l := .SharedLabels}} - - - - - {{end}} - -
- {{ $l.Name }} ({{len $l.Boards}}) - - {{range $brd := $l.Boards}} - {{ $brd }}, - {{end}} -
-
+{{if gt (len .SharedLabels) 0}} +

Labels

+

There are {{len .SharedLabels}} common labels across the boards.

+
+ + + {{range $l := .SharedLabels}} + + + + + {{end}} + +
+ {{ $l.Name }} ({{len $l.Boards}}) + + {{range $brd := $l.Boards}} + {{ $brd }}, + {{end}} +
+
+{{end}} ` diff --git a/core/section/trello/master_template.go b/core/section/trello/master_template.go index 0faa6b70..0dc5a2c2 100644 --- a/core/section/trello/master_template.go +++ b/core/section/trello/master_template.go @@ -11,9 +11,8 @@ package trello -const renderTemplate = ` -

Header for Trello Multi-Board Test (in master_template.go)

-` + labelsTemplate + +const renderTemplate = `` + + labelsTemplate + boardsTemplate + graphsTemplate + membersTemplate +