diff --git a/modules/templates/util_render.go b/modules/templates/util_render.go index da186f87f21..9d05bb2a0b6 100644 --- a/modules/templates/util_render.go +++ b/modules/templates/util_render.go @@ -121,23 +121,7 @@ func (ut *RenderUtils) RenderIssueSimpleTitle(text string) template.HTML { return ret } -func (ut *RenderUtils) RenderLabelWithLink(label *issues_model.Label, link any) template.HTML { - var attrHref template.HTML - switch link.(type) { - case template.URL, string: - attrHref = htmlutil.HTMLFormat(`href="%s"`, link) - default: - panic(fmt.Sprintf("unexpected type %T for link", link)) - } - return ut.renderLabelWithTag(label, "a", attrHref) -} - func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML { - return ut.renderLabelWithTag(label, "span", "") -} - -// RenderLabel renders a label -func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, tagAttrs template.HTML) template.HTML { locale := ut.ctx.Value(translation.ContextKey).(translation.Locale) var extraCSSClasses string textColor := util.ContrastColor(label.Color) @@ -151,8 +135,8 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta if labelScope == "" { // Regular label - return htmlutil.HTMLFormat(`<%s %s class="ui label %s" style="color: %s !important; background-color: %s !important;" data-tooltip-content title="%s">%s`, - tagName, tagAttrs, extraCSSClasses, textColor, label.Color, descriptionText, ut.RenderEmoji(label.Name), tagName) + return htmlutil.HTMLFormat(`%s`, + extraCSSClasses, textColor, label.Color, descriptionText, ut.RenderEmoji(label.Name)) } // Scoped label @@ -187,29 +171,25 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta if label.ExclusiveOrder > 0 { // |