mirror of
https://github.com/documize/community.git
synced 2025-07-22 14:49:42 +02:00
Make label board names clickable
This commit is contained in:
parent
308f117cca
commit
93a11200b4
3 changed files with 10 additions and 4 deletions
|
@ -25,7 +25,7 @@ const labelsTemplate = `
|
|||
<span class="trello-label" style="background-color: {{ $l.Color }}">{{ $l.Name }} ({{len $l.Boards}})</span>
|
||||
</td>
|
||||
<td>
|
||||
{{range $idx, $brd := $l.Boards}}{{if gt $idx 0}}, {{end}}<a class="link" href="#">{{ $brd }}</a>{{end}}.
|
||||
{{range $idx, $brd := $l.Boards}}{{if gt $idx 0}}, {{end}}{{ $brd }}{{end}}.
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
package trello
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -249,7 +250,7 @@ type trelloRenderBoard struct {
|
|||
type trelloSharedLabel struct {
|
||||
Name string
|
||||
Color string
|
||||
Boards []string
|
||||
Boards []template.HTML
|
||||
}
|
||||
|
||||
type trelloBoardAssignCount struct {
|
||||
|
|
|
@ -543,7 +543,8 @@ func buildPayloadAnalysis(config *trelloConfig, render *trelloRender) {
|
|||
if _, exists := labels[lab.Name]; !exists {
|
||||
labels[lab.Name] = labT{color: lab.Color, boards: make(map[string]bool)}
|
||||
}
|
||||
labels[lab.Name].boards[brd.Board.Name] = true
|
||||
labels[lab.Name].boards[fmt.Sprintf(`<a class="link" href="%s">%s</a>`,
|
||||
brd.Board.URL, brd.Board.Name)] = true
|
||||
}
|
||||
|
||||
// process member stats
|
||||
|
@ -588,8 +589,12 @@ func buildPayloadAnalysis(config *trelloConfig, render *trelloRender) {
|
|||
brds = append(brds, bname)
|
||||
}
|
||||
sort.Strings(brds)
|
||||
htm := []template.HTML{}
|
||||
for _, h := range brds {
|
||||
htm = append(htm, template.HTML(h))
|
||||
}
|
||||
render.SharedLabels = append(render.SharedLabels, trelloSharedLabel{
|
||||
Name: lname, Color: labels[lname].color, Boards: brds,
|
||||
Name: lname, Color: labels[lname].color, Boards: htm,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue