Skip to content

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

options/locale/locale_en-US.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ issues.delete_branch_at = `deleted branch <b>%s</b> %s`
13841384
issues.filter_label = Label
13851385
issues.filter_label_exclude = `Use <code>alt</code> + <code>click/enter</code> to exclude labels`
13861386
issues.filter_label_no_select = All labels
1387-
issues.filter_label_select_no_label = No Label
1387+
issues.filter_label_select_no_label = No label
13881388
issues.filter_milestone = Milestone
13891389
issues.filter_milestone_all = All milestones
13901390
issues.filter_milestone_none = No milestones

routers/web/repo/issue.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
174174
// 0 means issues with no label
175175
// blank means labels will not be filtered for issues
176176
selectLabels := ctx.FormString("labels")
177-
if len(selectLabels) > 0 {
177+
if selectLabels == "" {
178+
ctx.Data["AllLabels"] = true
179+
} else if selectLabels == "0" {
180+
ctx.Data["NoLabel"] = true
181+
} else if len(selectLabels) > 0 {
178182
labelIDs, err = base.StringsToInt64s(strings.Split(selectLabels, ","))
179183
if err != nil {
180184
ctx.ServerError("StringsToInt64s", err)

templates/repo/issue/filters.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</div>
2121
<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
2222
<div class="divider"></div>
23-
<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>
24-
<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>
23+
<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>
24+
<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>
2525
{{$previousExclusiveScope := "_no_scope"}}
2626
{{range .Labels}}
2727
{{$exclusiveScope := .ExclusiveScope}}
@@ -84,8 +84,8 @@
8484
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
8585
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}">
8686
</div>
87-
<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>
88-
<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>
87+
<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>
88+
<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>
8989
{{if .OpenProjects}}
9090
<div class="divider"></div>
9191
<div class="header">
@@ -141,8 +141,8 @@
141141
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
142142
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}">
143143
</div>
144-
<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>
145-
<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>
144+
<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>
145+
<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>
146146
<div class="divider"></div>
147147
{{range .Assignees}}
148148
<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}}">

0 commit comments

Comments
 (0)