diff options
author | silverwind <me@silverwind.io> | 2020-11-29 04:26:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 22:26:03 -0500 |
commit | da4bb6fc4ef552865816303fc9c0db25509ff626 (patch) | |
tree | 04edd31cce1c77c2d7598de5c9d01388416108a1 /modules/templates/helper.go | |
parent | b2435af9be75a0cdeea08881c162e65740225f56 (diff) | |
download | gitea-da4bb6fc4ef552865816303fc9c0db25509ff626.tar.gz gitea-da4bb6fc4ef552865816303fc9c0db25509ff626.zip |
Fix label styles affecting shabox (#13734)
* Fix label styles affecting shabox
Add common parent .labels-list to issue labels lists to prevent
affecting other elements.
Fixes: https://github.com/go-gitea/gitea/issues/13704
* Update templates/shared/issuelist.tmpl
* Update templates/shared/issuelist.tmpl
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r-- | modules/templates/helper.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 4e5c96cd0f..bb7a3476f2 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -364,13 +364,12 @@ func NewFuncMap() []template.FuncMap { return "" }, "RenderLabels": func(labels []*models.Label) template.HTML { - html := "" - + html := `<span class="labels-list">` 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)) + html += fmt.Sprintf("<div class='ui label' style='color: %s; background-color: %s'>%s</div>", + label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) } - + html += "</span>" return template.HTML(html) }, }} |