diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 4e5c96cd0fa7..bb7a3476f29b 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 := `` for _, label := range labels { - html = fmt.Sprintf("%s
%s
", - html, label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) + html += fmt.Sprintf("
%s
", + label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) } - + html += "
" return template.HTML(html) }, }} diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl index bf6f98c88860..1d61ecf3df5b 100644 --- a/templates/repo/issue/labels/labels_sidebar.tmpl +++ b/templates/repo/issue/labels/labels_sidebar.tmpl @@ -1,9 +1,11 @@
{{.ctx.i18n.Tr "repo.issues.new.no_label"}} - {{range .ctx.Labels}} - {{template "repo/issue/labels/label" dict "root" $ "label" .}} - {{end}} - {{range .ctx.OrgLabels}} - {{template "repo/issue/labels/label" dict "root" $ "label" .}} - {{end}} + + {{range .ctx.Labels}} + {{template "repo/issue/labels/label" dict "root" $ "label" .}} + {{end}} + {{range .ctx.OrgLabels}} + {{template "repo/issue/labels/label" dict "root" $ "label" .}} + {{end}} +
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 93935838628e..beb78a54914b 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -37,9 +37,11 @@ {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}} {{end}} {{end}} - {{range .Labels}} - {{.Name | RenderEmoji}} - {{end}} + + {{range .Labels}} + {{.Name | RenderEmoji}} + {{end}} +
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 1f39cc565982..e77e9719c350 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -2856,35 +2856,20 @@ } } -.labels.list { - display: flex; +.labels-list { + display: inline-flex; flex-wrap: wrap; } -.labels.list .item, -.timeline-item .label { - padding: .3em .5em !important; - margin-left: 0; - margin-right: 0; - margin-bottom: 3px; -} - -.issue-item-top-row .label { - margin-left: 0; - margin-right: 0; +.labels-list .label { margin-top: 1.5px; margin-bottom: 1.5px; -} - -.labels.list .item, -.timeline-item .label, -.issue-item-top-row .label { margin-right: 3px; - display: inline !important; + margin-left: 0; + display: inline-block !important; } -.timeline-item .label:last-of-type, -.issue-item-top-row .label:last-of-type { +.labels-list .label:last-of-type { margin-right: 0; }