1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

Fixed copy render for plural and singular data

This commit is contained in:
EnesAlili 2016-09-12 11:47:30 +01:00
parent a2cc971821
commit 308f117cca
5 changed files with 15 additions and 12 deletions

View file

@ -8,18 +8,18 @@
<div class="color-error">You have no team boards to share - personal boards are never shown.</div> <div class="color-error">You have no team boards to share - personal boards are never shown.</div>
</div> </div>
{{else}} {{else}}
<div class="pull-left width-50"> <div class="pull-left width-50">
<div class="input-form"> <div class="input-form">
<div class="heading"> <div class="heading">
<div class="title">Select Board & Lists</div> <div class="title">Select Board &amp; Lists</div>
<div class="tip">Choose lists to include from board</div> <div class="tip">Choose lists to include from board</div>
</div> </div>
<div class="input-control"> <div class="input-control">
<label>Show summary from (default 7 days ago)</label> <label>Show summary from (default 7 days ago)</label>
{{input id="trello-since" value=config.since type="text" }}<br> {{input id="trello-since" value=config.since type="text" }}<br>
</div> </div>
<div class="input-control"> <div class="input-control">
<label>Select which boards you want to see</label> <label>Select which boards you want to see</label>
<div class="tip">All boards are selectd by default</div> <div class="tip">All boards are selectd by default</div>
@ -32,7 +32,7 @@
{{else}} {{else}}
<i class="material-icons widget-checkbox checkbox-gray github-list-checkbox">check_box_outline_blank</i> <i class="material-icons widget-checkbox checkbox-gray github-list-checkbox">check_box_outline_blank</i>
{{/if}} {{/if}}
<span style="background-color: {{board.prefs.backgroundColor}}">{{board.name}}</span> <span style="background-color: {{board.prefs.backgroundColor}}">{{board.idOrganization}} / {{board.name}}</span>
</div> </div>
{{/if}} {{/if}}
{{/each}} {{/each}}
@ -71,7 +71,7 @@
</div> </div>
</div> </div>
{{/if}} {{/if}}
{{else}} {{else}}
<div class="pull-left width-50"> <div class="pull-left width-50">

View file

@ -45,7 +45,12 @@ const boardsTemplate = `
</a> </a>
</td> </td>
<td> <td>
<div class="board-summary">There are {{ len $b.Actions }} actions for this board.</div> <div class="board-summary">There
{{if eq 1 (len $b.Actions)}} is {{else}} are {{end}}
{{ len $b.Actions }}
{{if eq 1 (len $b.Actions)}}action {{else}} actions {{end}}
for this board.
</div>
<span class="board-meta"> <span class="board-meta">
{{range $act, $tot := $b.ActionSummary}} {{range $act, $tot := $b.ActionSummary}}
{{$act}} ({{$tot}}), {{$act}} ({{$tot}}),

View file

@ -13,9 +13,6 @@ package trello
const labelsTemplate = ` const labelsTemplate = `
<div class="section-trello-render"> <div class="section-trello-render">
<p>Activity since #date for team Documize boards: <a class="link" href="#">Board Name</a></p>
{{if gt (len .SharedLabels) 0}} {{if gt (len .SharedLabels) 0}}
<div class="heading">Labels</div> <div class="heading">Labels</div>
<p>There are {{len .SharedLabels}} common labels across the boards.</p> <p>There are {{len .SharedLabels}} common labels across the boards.</p>
@ -28,7 +25,7 @@ const labelsTemplate = `
<span class="trello-label" style="background-color: {{ $l.Color }}">{{ $l.Name }} ({{len $l.Boards}})</span> <span class="trello-label" style="background-color: {{ $l.Color }}">{{ $l.Name }} ({{len $l.Boards}})</span>
</td> </td>
<td> <td>
<a class="link" href="#">{{range $idx, $brd := $l.Boards}}{{if gt $idx 0}}</a>, {{end}}{{ $brd }}{{end}}. {{range $idx, $brd := $l.Boards}}{{if gt $idx 0}}, {{end}}<a class="link" href="#">{{ $brd }}</a>{{end}}.
</td> </td>
</tr> </tr>
{{end}} {{end}}

View file

@ -11,7 +11,8 @@
package trello package trello
const renderTemplate = `` + const renderTemplate = `<p>Activity since {{.Since}} for boards:
{{range $idx, $brd := .Boards}}{{if gt $idx 0}}, {{end}}<a class="link" href="{{$brd.Board.URL}}">{{$brd.Board.Name}}</a>{{end}}.</p>` +
labelsTemplate + labelsTemplate +
boardsTemplate + boardsTemplate +
graphsTemplate + graphsTemplate +

View file

@ -16,7 +16,7 @@ const membersTemplate = `
{{if gt (len .Boards) 0}} {{if gt (len .Boards) 0}}
<div class="heading">Member Stats</div> <div class="heading">Member Stats</div>
<p> <p>
There are {{len .MemberBoardAssign}} members assigned to {{.CardAssignTotal}} cards of the total {{.CardTotal}} cards across {{len .Boards}} boards. There {{if eq 1 (len .MemberBoardAssign)}} is one member {{else}} are {{len .MemberBoardAssign}} members {{end}} assigned to {{.CardAssignTotal}} cards of the total {{.CardTotal}} cards across {{len .Boards}} boards.
</p> </p>
<div class="section-trello-render"> <div class="section-trello-render">