1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-28 01:29:43 +02:00

hide labels when none shared

This commit is contained in:
Elliott Stoneham 2016-09-09 16:56:19 +01:00
parent a0ebb215d9
commit a7a2267e5c
3 changed files with 25 additions and 24 deletions

View file

@ -13,7 +13,7 @@ package trello
const boardsTemplate = ` const boardsTemplate = `
<h3>All Boards</h3> <h3>Boards</h3>
<p>Changes since {{.Since}}.</p> <p>Changes since {{.Since}}.</p>
<div class="section-trello-render"> <div class="section-trello-render">
<table class="trello-table" class="width-100"> <table class="trello-table" class="width-100">

View file

@ -12,24 +12,26 @@
package trello package trello
const labelsTemplate = ` const labelsTemplate = `
<h3>Labels</h3> {{if gt (len .SharedLabels) 0}}
<p>There are {{len .SharedLabels}} common labels across the boards.</p> <h3>Labels</h3>
<div class="section-trello-render"> <p>There are {{len .SharedLabels}} common labels across the boards.</p>
<table class="trello-table" class="width-100"> <div class="section-trello-render">
<tbody class="trello"> <table class="trello-table" class="width-100">
{{range $l := .SharedLabels}} <tbody class="trello">
<tr> {{range $l := .SharedLabels}}
<td class="width-25"> <tr>
<span class="trello-label" style="background-color: {{ $l.Color }}">{{ $l.Name }} ({{len $l.Boards}})</span> <td class="width-25">
</td> <span class="trello-label" style="background-color: {{ $l.Color }}">{{ $l.Name }} ({{len $l.Boards}})</span>
<td class="width-75"> </td>
{{range $brd := $l.Boards}} <td class="width-75">
{{ $brd }}, {{range $brd := $l.Boards}}
{{end}} {{ $brd }},
</td> {{end}}
</tr> </td>
{{end}} </tr>
</tbody> {{end}}
</table> </tbody>
</div> </table>
</div>
{{end}}
` `

View file

@ -11,9 +11,8 @@
package trello package trello
const renderTemplate = ` const renderTemplate = `` +
<h3>Header for Trello Multi-Board Test (in master_template.go)</h3> labelsTemplate +
` + labelsTemplate +
boardsTemplate + boardsTemplate +
graphsTemplate + graphsTemplate +
membersTemplate + membersTemplate +