diff options
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 63be27d987..03ec80f99c 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -343,6 +343,16 @@ func NewFuncMap() []template.FuncMap { // the table is NOT sorted with this header return "" }, + "RenderLabels": func(labels []*models.Label) template.HTML { + html := "" + + for _, label := range labels { + html = fmt.Sprintf("%s<div class='ui label' style='color: %s; background-color: %s'>%s</div>", + html, label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) + } + + return template.HTML(html) + }, }} } |