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>
This commit is contained in:
parent
b2435af9be
commit
da4bb6fc4e
4 changed files with 23 additions and 35 deletions
|
@ -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)
|
||||
},
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue