mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 12:37:14 -04:00 
			
		
		
		
	Improve display of Labels/Projects/Assignees sort options (#25886)
Labels: Before: (no highlights)  After:   Projects: Before: (no highlights)  After:   Assignee: Before: (no highlights)  After:  
This commit is contained in:
		| @@ -1384,7 +1384,7 @@ issues.delete_branch_at = `deleted branch <b>%s</b> %s` | |||||||
| issues.filter_label = Label | issues.filter_label = Label | ||||||
| issues.filter_label_exclude = `Use <code>alt</code> + <code>click/enter</code> to exclude labels` | issues.filter_label_exclude = `Use <code>alt</code> + <code>click/enter</code> to exclude labels` | ||||||
| issues.filter_label_no_select = All labels | issues.filter_label_no_select = All labels | ||||||
| issues.filter_label_select_no_label = No Label | issues.filter_label_select_no_label = No label | ||||||
| issues.filter_milestone = Milestone | issues.filter_milestone = Milestone | ||||||
| issues.filter_milestone_all = All milestones | issues.filter_milestone_all = All milestones | ||||||
| issues.filter_milestone_none = No milestones | issues.filter_milestone_none = No milestones | ||||||
|   | |||||||
| @@ -174,7 +174,11 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti | |||||||
| 	// 0 means issues with no label | 	// 0 means issues with no label | ||||||
| 	// blank means labels will not be filtered for issues | 	// blank means labels will not be filtered for issues | ||||||
| 	selectLabels := ctx.FormString("labels") | 	selectLabels := ctx.FormString("labels") | ||||||
| 	if len(selectLabels) > 0 { | 	if selectLabels == "" { | ||||||
|  | 		ctx.Data["AllLabels"] = true | ||||||
|  | 	} else if selectLabels == "0" { | ||||||
|  | 		ctx.Data["NoLabel"] = true | ||||||
|  | 	} else if len(selectLabels) > 0 { | ||||||
| 		labelIDs, err = base.StringsToInt64s(strings.Split(selectLabels, ",")) | 		labelIDs, err = base.StringsToInt64s(strings.Split(selectLabels, ",")) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			ctx.ServerError("StringsToInt64s", err) | 			ctx.ServerError("StringsToInt64s", err) | ||||||
|   | |||||||
| @@ -20,8 +20,8 @@ | |||||||
| 					</div> | 					</div> | ||||||
| 					<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> | 					<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> | ||||||
| 					<div class="divider"></div> | 					<div class="divider"></div> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a> | 					<a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a> | 					<a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a> | ||||||
| 					{{$previousExclusiveScope := "_no_scope"}} | 					{{$previousExclusiveScope := "_no_scope"}} | ||||||
| 					{{range .Labels}} | 					{{range .Labels}} | ||||||
| 						{{$exclusiveScope := .ExclusiveScope}} | 						{{$exclusiveScope := .ExclusiveScope}} | ||||||
| @@ -84,8 +84,8 @@ | |||||||
| 						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | 						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||||||
| 						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}"> | 						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}"> | ||||||
| 					</div> | 					</div> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a> | 					<a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a> | 					<a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a> | ||||||
| 					{{if .OpenProjects}} | 					{{if .OpenProjects}} | ||||||
| 						<div class="divider"></div> | 						<div class="divider"></div> | ||||||
| 						<div class="header"> | 						<div class="header"> | ||||||
| @@ -141,8 +141,8 @@ | |||||||
| 						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | 						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||||||
| 						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}"> | 						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}"> | ||||||
| 					</div> | 					</div> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> | 					<a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a> | ||||||
| 					<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a> | 					<a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> | ||||||
| 					<div class="divider"></div> | 					<div class="divider"></div> | ||||||
| 					{{range .Assignees}} | 					{{range .Assignees}} | ||||||
| 						<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> | 						<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user