mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	feat: Add sorting by exclusive labels (issue priority) (#33206)
Fix #2616 This PR adds a new sort option for exclusive labels. For exclusive labels, a new property is exposed called "order", while in the UI options are populated automatically in the `Sort` column (see screenshot below) for each exclusive label scope. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -170,13 +170,28 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML { | ||||
| 	itemColor := "#" + hex.EncodeToString(itemBytes) | ||||
| 	scopeColor := "#" + hex.EncodeToString(scopeBytes) | ||||
|  | ||||
| 	if label.ExclusiveOrder > 0 { | ||||
| 		// <scope> | <label> | <order> | ||||
| 		return htmlutil.HTMLFormat(`<span class="ui label %s scope-parent" data-tooltip-content title="%s">`+ | ||||
| 			`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+ | ||||
| 			`<div class="ui label scope-middle" style="color: %s !important; background-color: %s !important">%s</div>`+ | ||||
| 			`<div class="ui label scope-right">%d</div>`+ | ||||
| 			`</span>`, | ||||
| 			extraCSSClasses, descriptionText, | ||||
| 			textColor, scopeColor, scopeHTML, | ||||
| 			textColor, itemColor, itemHTML, | ||||
| 			label.ExclusiveOrder) | ||||
| 	} | ||||
|  | ||||
| 	// <scope> | <label> | ||||
| 	return htmlutil.HTMLFormat(`<span class="ui label %s scope-parent" data-tooltip-content title="%s">`+ | ||||
| 		`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+ | ||||
| 		`<div class="ui label scope-right" style="color: %s !important; background-color: %s !important">%s</div>`+ | ||||
| 		`</span>`, | ||||
| 		extraCSSClasses, descriptionText, | ||||
| 		textColor, scopeColor, scopeHTML, | ||||
| 		textColor, itemColor, itemHTML) | ||||
| 		textColor, itemColor, itemHTML, | ||||
| 	) | ||||
| } | ||||
|  | ||||
| // RenderEmoji renders html text with emoji post processors | ||||
|   | ||||
		Reference in New Issue
	
	Block a user