diff --git a/core/section/trello/archive_template.go b/core/section/trello/archive_template.go index d690e2d3..8b6c6aa3 100644 --- a/core/section/trello/archive_template.go +++ b/core/section/trello/archive_template.go @@ -12,34 +12,46 @@ package trello const archiveTemplate = ` -

Deleted and Archived Cards

-

Changes since {{.Since}}.

-
- - - {{range $b := .Boards}} - - - + + {{end}} + +
- - {{$b.Board.Name}} - - - {{range $act := $b.Actions}} - {{if eq $act.Type "deleteCard" }} - Deleted: - {{$act.Data.List.Name}} : {{$act.Data.Card.Name}} - {{$act.Data.Text}} +{{if gt (len .Boards) 0}} +
Deleted and Archived Cards
+

Changes since {{.Since}}.

+
+ + + {{range $b := .Boards}} + + + - - {{end}} - -
+ + {{$b.Board.Name}} + + + {{range $act := $b.Actions}} + {{if eq $act.Type "deleteCard" }} + Deleted: + {{$act.Data.List.Name}} + {{if ne $act.Data.Card.Name ""}} + : {{$act.Data.Card.Name}} + {{if ne $act.Data.Text ""}} + - {{$act.Data.Text}} + {{end}} + {{end}} +
+ {{end}} {{end}} - {{end}} - {{range $arch := $b.Archived}} - Archived: - {{$arch.Name}} - {{$arch.Desc}} -
- {{end}} -
-
+ {{range $arch := $b.Archived}} + Archived: + {{$arch.Name}} + {{if ne $arch.Desc ""}} + - {{$arch.Desc}} + {{end}} +
+ {{end}} +
+
+{{end}} ` diff --git a/core/section/trello/boards_template.go b/core/section/trello/boards_template.go index a963106c..7add14f8 100644 --- a/core/section/trello/boards_template.go +++ b/core/section/trello/boards_template.go @@ -12,52 +12,55 @@ package trello const boardsTemplate = ` - -

Boards

-

Changes since {{.Since}}.

-
- - - - - - - - - -
- {{len .Boards}} Boards - - {{.ListTotal}} Lists - - {{.CardTotal}} Cards - - {{len .MemberBoardAssign}} Members -
- - - {{range $b := .Boards}} - - - + + {{end}} + +
- - {{$b.Board.Name}} - - -
There are {{ len $b.Actions }} actions for this board.
-

- {{range $act, $tot := $b.ActionSummary}} - {{$act}} ({{$tot}}), - {{end}} - {{if gt (len $b.Archived) 0}} - archive card ({{len $b.Archived}}). +{{if gt (len .Boards) 0}} +

Boards
+

Changes since {{.Since}}.

+
+ + + + + + + + + +
+ {{len .Boards}} Boards + + {{.ListTotal}} Lists + + {{.CardTotal}} Cards + + {{len .MemberBoardAssign}} Members +
+ + + {{range $b := .Boards}} + + + - - {{end}} - -
+ + {{$b.Board.Name}} + + +
There are {{ len $b.Actions }} actions for this board.
+

+ {{range $act, $tot := $b.ActionSummary}} + {{$act}} ({{$tot}}), + {{end}} + {{if gt (len $b.Archived) 0}} + archive card ({{len $b.Archived}}). + {{else}} + no cards archived. + {{end}}
- {{end}} -

-
-
+

+
+
+{{end}} ` diff --git a/core/section/trello/graphs_template.go b/core/section/trello/graphs_template.go index 3bb41687..cd1971ca 100644 --- a/core/section/trello/graphs_template.go +++ b/core/section/trello/graphs_template.go @@ -14,7 +14,7 @@ package trello const graphsTemplate = ` {{if false}} - Single Boards (graphs)
+
Single Boards (graphs)
{{range $b := .Boards}}

There are {{ $b.CardCount }} cards across {{ $b.ListCount }} lists for board {{$b.Board.Name}}.

diff --git a/core/section/trello/labels_template.go b/core/section/trello/labels_template.go index e34a3882..91e811b6 100644 --- a/core/section/trello/labels_template.go +++ b/core/section/trello/labels_template.go @@ -13,7 +13,7 @@ package trello const labelsTemplate = ` {{if gt (len .SharedLabels) 0}} -

Labels

+
Labels

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

@@ -24,9 +24,7 @@ const labelsTemplate = ` {{ $l.Name }} ({{len $l.Boards}}) {{end}} diff --git a/core/section/trello/members_template.go b/core/section/trello/members_template.go index 9e24671c..22c72c1d 100644 --- a/core/section/trello/members_template.go +++ b/core/section/trello/members_template.go @@ -12,32 +12,31 @@ package trello const membersTemplate = ` -

Member Stats

-

- There are {{len .MemberBoardAssign}} members assigned to {{.CardAssignTotal}} cards of the total {{.CardTotal}} cards across {{len .Boards}} boards. -

+{{if gt (len .Boards) 0}} +
Member Stats
+

+ There are {{len .MemberBoardAssign}} members assigned to {{.CardAssignTotal}} cards of the total {{.CardTotal}} cards across {{len .Boards}} boards. +

-
-
- {{range $brd := $l.Boards}} - {{ $brd }}, - {{end}} + {{range $idx, $brd := $l.Boards}}{{if gt $idx 0}}, {{end}}{{ $brd }}{{end}}.
- - - {{range $m := .MemberBoardAssign}} - - - - - {{end}} - -
- Member Avatar - -
{{$m.MemberName}}
-

- {{range $ac := $m.AssignCounts}} - {{$ac.BoardName}} ({{$ac.Count}}), - {{end}} -

-
-
+
+ + + {{range $m := .MemberBoardAssign}} + + + + + {{end}} + +
+ Member Avatar + +
{{$m.MemberName}}
+

+ {{range $idx, $ac := $m.AssignCounts}}{{if gt $idx 0}}, {{end}}{{$ac.BoardName}} ({{$ac.Count}}){{end}}. +

+
+
+{{end}} ` diff --git a/core/section/trello/model.go b/core/section/trello/model.go index 6af968f6..6b83f5e9 100644 --- a/core/section/trello/model.go +++ b/core/section/trello/model.go @@ -264,11 +264,9 @@ type trelloBoardAssign struct { } type trelloRender struct { - Config trelloConfig - Boards []trelloRenderBoard - - Since string + Since string + Detail trelloRenderBoard // items below are generated during the render phase SharedLabels []trelloSharedLabel diff --git a/core/section/trello/trad_template.go b/core/section/trello/trad_template.go index eafdf68b..721cad08 100644 --- a/core/section/trello/trad_template.go +++ b/core/section/trello/trad_template.go @@ -12,27 +12,27 @@ package trello const tradTemplate = ` -{{if false}} - {{range $b := .Boards}} -

Non-printable

-
-

There are {{ $b.CardCount }} cards across {{ $b.ListCount }} lists for board {{$b.Board.Name}}.

-
-
{{$b.Board.Name}}
- {{range $data := $b.Data}} -
-
{{ $data.List.Name }}
- {{range $card := $data.Cards}} - -
- {{ $card.Name }} -
-
- {{end}} -
- {{end}} -
+{{if ne .Detail.Board.ID ""}} +
Board: {{.Detail.Board.Name}}
+

Non-printable

+
+

There are {{ .Detail.CardCount }} cards across {{ .Detail.ListCount }} lists + for board {{.Detail.Board.Name}}.

+
+
{{.Detail.Board.Name}}
+ {{range $data := .Detail.Data}} +
+
{{ $data.List.Name }}
+ {{range $card := $data.Cards}} + +
+ {{ $card.Name }} +
+
+ {{end}} +
+ {{end}}
- {{end}} +
{{end}} ` diff --git a/core/section/trello/trello.go b/core/section/trello/trello.go index 36b6a142..cfc374de 100644 --- a/core/section/trello/trello.go +++ b/core/section/trello/trello.go @@ -186,7 +186,6 @@ func (*Provider) Refresh(ctx *provider.Context, config, data string) string { log.IfErr(json.Unmarshal([]byte(config), &c)) save := trelloRender{} - save.Config = c save.Boards = make([]trelloRenderBoard, 0, len(c.Boards)) if len(c.Since) >= len("yyyy/mm/dd hh:ss") { @@ -211,12 +210,24 @@ func (*Provider) Refresh(ctx *provider.Context, config, data string) string { } save.Since = (*c.SincePtr).Format("January 2, 2006") + dateMessage + c.AppKey = request.ConfigString(meta.ConfigHandle(), "appKey") + + if c.Board.ID != "" { // set up detail board + var err error + save.Detail.Board = c.Board + save.Detail.Data, err = getCards(c) + log.IfErr(err) + save.Detail.ListCount = len(save.Detail.Data) + for _, list := range save.Detail.Data { + save.Detail.CardCount += len(list.Cards) + } + } + for _, board := range c.Boards { if board.Included { var payload = trelloRenderBoard{} c.Board = board - c.AppKey = request.ConfigString(meta.ConfigHandle(), "appKey") lsts, err := getLists(c) log.IfErr(err)