Skip to content

Commit 6e03264

Browse files
committed
Show sort order on the rendered label.
1 parent 83078ed commit 6e03264

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

modules/templates/util_render.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"math"
1212
"net/url"
1313
"regexp"
14+
"strconv"
1415
"strings"
1516
"unicode"
1617

@@ -143,6 +144,7 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML {
143144
// Scoped label
144145
scopeHTML := ut.RenderEmoji(labelScope)
145146
itemHTML := ut.RenderEmoji(label.Name[len(labelScope)+1:])
147+
orderHTML := ut.RenderEmoji(strconv.Itoa(label.ExclusiveOrder))
146148

147149
// Make scope and item background colors slightly darker and lighter respectively.
148150
// More contrast needed with higher luminance, empirically tweaked.
@@ -172,11 +174,13 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML {
172174

173175
return htmlutil.HTMLFormat(`<span class="ui label %s scope-parent" data-tooltip-content title="%s">`+
174176
`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+
175-
`<div class="ui label scope-right" 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>`+
176179
`</span>`,
177180
extraCSSClasses, descriptionText,
178181
textColor, scopeColor, scopeHTML,
179-
textColor, itemColor, itemHTML)
182+
textColor, itemColor, itemHTML,
183+
orderHTML)
180184
}
181185

182186
// RenderEmoji renders html text with emoji post processors

options/label/Advanced.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ labels:
2222
description: Breaking change that won't be backward compatible
2323
- name: "Reviewed/Duplicate"
2424
exclusive: true
25-
exclusive_order: 50
25+
exclusive_order: 1
2626
color: 616161
2727
description: This issue or pull request already exists
2828
- name: "Reviewed/Invalid"
2929
exclusive: true
30-
exclusive_order: 100
30+
exclusive_order: 2
3131
color: 546e7a
3232
description: Invalid issue
3333
- name: "Reviewed/Confirmed"
@@ -37,12 +37,12 @@ labels:
3737
description: Issue has been confirmed
3838
- name: "Reviewed/Won't Fix"
3939
exclusive: true
40-
exclusive_order: 75
40+
exclusive_order: 3
4141
color: eeeeee
4242
description: This issue won't be fixed
4343
- name: "Status/Need More Info"
4444
exclusive: true
45-
exclusive_order: 25
45+
exclusive_order: 1
4646
color: 424242
4747
description: Feedback is required to reproduce issue or to continue work
4848
- name: "Status/Blocked"
@@ -52,7 +52,7 @@ labels:
5252
description: Something is blocking this issue or pull request
5353
- name: "Status/Abandoned"
5454
exclusive: true
55-
exclusive_order: 100
55+
exclusive_order: 2
5656
color: "222222"
5757
description: Somebody has started to work on this but abandoned work
5858
- name: "Priority/Critical"

web_src/css/repo.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,12 @@ td .commit-summary {
16041604
margin-right: 0;
16051605
}
16061606

1607+
.ui.label.scope-middle {
1608+
border-radius: 0;
1609+
margin-left: 0;
1610+
margin-right: 0;
1611+
}
1612+
16071613
.ui.label.scope-right {
16081614
border-bottom-left-radius: 0;
16091615
border-top-left-radius: 0;

0 commit comments

Comments
 (0)