summaryrefslogtreecommitdiffstats
path: root/models/issue_label.go
diff options
context:
space:
mode:
authorjaqra <48099350+jaqra@users.noreply.github.com>2019-10-23 19:29:14 +0300
committerzeripath <art27@cantab.net>2019-10-23 17:29:14 +0100
commitdbd9d8dd54fd3b0ff7b02ae7b7da8369654e3725 (patch)
tree972d334a1a6d98b8186c99511ad03234d32e6b8c /models/issue_label.go
parent637e3219ab477a554567ec2ecbf0050b61942a50 (diff)
downloadgitea-dbd9d8dd54fd3b0ff7b02ae7b7da8369654e3725.tar.gz
gitea-dbd9d8dd54fd3b0ff7b02ae7b7da8369654e3725.zip
Add 'Alt + click' feature to exclude labels (#8199)
Add 'Alt + click' and 'Alt +enter' feature to exclude particular labels on searching for issues.
Diffstat (limited to 'models/issue_label.go')
-rw-r--r--models/issue_label.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/issue_label.go b/models/issue_label.go
index 9efc7fd51f..1fc873cfd4 100644
--- a/models/issue_label.go
+++ b/models/issue_label.go
@@ -72,6 +72,7 @@ type Label struct {
IsChecked bool `xorm:"-"`
QueryString string `xorm:"-"`
IsSelected bool `xorm:"-"`
+ IsExcluded bool `xorm:"-"`
}
// APIFormat converts a Label to the api.Label format
@@ -97,7 +98,10 @@ func (label *Label) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64)
for _, s := range currentSelectedLabels {
if s == label.ID {
labelSelected = true
- } else if s > 0 {
+ } else if -s == label.ID {
+ labelSelected = true
+ label.IsExcluded = true
+ } else if s != 0 {
labelQuerySlice = append(labelQuerySlice, strconv.FormatInt(s, 10))
}
}