From c40df54e28fe1a1cfd0fc5f834451996d96028f3 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 25 Oct 2020 21:49:48 +0000 Subject: Group Label Changed Comments in timeline (#13304) * Create function to group label comments * Combine multiple label additions into one * Group removed and added labels in the same comment * Fix indentation on comments.tmpl Co-authored-by: zeripath Co-authored-by: zeripath --- modules/templates/helper.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules') 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
%s
", + html, label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) + } + + return template.HTML(html) + }, }} } -- cgit v1.2.3