@@ -144,7 +144,6 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML {
144144 // Scoped label
145145 scopeHTML := ut .RenderEmoji (labelScope )
146146 itemHTML := ut .RenderEmoji (label .Name [len (labelScope )+ 1 :])
147- orderHTML := ut .RenderEmoji (strconv .Itoa (label .ExclusiveOrder ))
148147
149148 // Make scope and item background colors slightly darker and lighter respectively.
150149 // More contrast needed with higher luminance, empirically tweaked.
@@ -172,15 +171,29 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML {
172171 itemColor := "#" + hex .EncodeToString (itemBytes )
173172 scopeColor := "#" + hex .EncodeToString (scopeBytes )
174173
175- return htmlutil .HTMLFormat (`<span class="ui label %s scope-parent" data-tooltip-content title="%s">` +
176- `<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>` +
177- `<div class="ui label scope-middle" style="color: %s !important; background-color: %s !important">%s</div>` +
178- `<div class="ui label scope-right">%s</div>` +
179- `</span>` ,
180- extraCSSClasses , descriptionText ,
181- textColor , scopeColor , scopeHTML ,
182- textColor , itemColor , itemHTML ,
183- orderHTML )
174+ if label .ExclusiveOrder > 0 {
175+ // <scope> | <label> | <order>
176+ orderHTML := ut .RenderEmoji (strconv .Itoa (label .ExclusiveOrder ))
177+ return htmlutil .HTMLFormat (`<span class="ui label %s scope-parent" data-tooltip-content title="%s">` +
178+ `<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>` +
179+ `<div class="ui label scope-middle" style="color: %s !important; background-color: %s !important">%s</div>` +
180+ `<div class="ui label scope-right">%s</div>` +
181+ `</span>` ,
182+ extraCSSClasses , descriptionText ,
183+ textColor , scopeColor , scopeHTML ,
184+ textColor , itemColor , itemHTML ,
185+ orderHTML )
186+ } else {
187+ // <scope> | <label>
188+ return htmlutil .HTMLFormat (`<span class="ui label %s scope-parent" data-tooltip-content title="%s">` +
189+ `<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>` +
190+ `<div class="ui label scope-right" style="color: %s !important; background-color: %s !important">%s</div>` +
191+ `</span>` ,
192+ extraCSSClasses , descriptionText ,
193+ textColor , scopeColor , scopeHTML ,
194+ textColor , itemColor , itemHTML ,
195+ )
196+ }
184197}
185198
186199// RenderEmoji renders html text with emoji post processors
0 commit comments