mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 09:54:24 +01:00
8574a6433f
This PR fixes two problems. One is when filter repository issues, only repository level projects are listed. Another is if you list open issues, only open projects will be displayed in filter options and if you list closed issues, only closed projects will be displayed in filter options. In this PR, both repository level and org/user level projects will be displayed in filter, and both open and closed projects will be listed as filter items. --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package db
|
|
|
|
// SearchOrderBy is used to sort the result
|
|
type SearchOrderBy string
|
|
|
|
func (s SearchOrderBy) String() string {
|
|
return string(s)
|
|
}
|
|
|
|
// Strings for sorting result
|
|
const (
|
|
SearchOrderByAlphabetically SearchOrderBy = "name ASC"
|
|
SearchOrderByAlphabeticallyReverse SearchOrderBy = "name DESC"
|
|
SearchOrderByLeastUpdated SearchOrderBy = "updated_unix ASC"
|
|
SearchOrderByRecentUpdated SearchOrderBy = "updated_unix DESC"
|
|
SearchOrderByOldest SearchOrderBy = "created_unix ASC"
|
|
SearchOrderByNewest SearchOrderBy = "created_unix DESC"
|
|
SearchOrderBySize SearchOrderBy = "size ASC"
|
|
SearchOrderBySizeReverse SearchOrderBy = "size DESC"
|
|
SearchOrderByID SearchOrderBy = "id ASC"
|
|
SearchOrderByIDReverse SearchOrderBy = "id DESC"
|
|
SearchOrderByStars SearchOrderBy = "num_stars ASC"
|
|
SearchOrderByStarsReverse SearchOrderBy = "num_stars DESC"
|
|
SearchOrderByForks SearchOrderBy = "num_forks ASC"
|
|
SearchOrderByForksReverse SearchOrderBy = "num_forks DESC"
|
|
)
|
|
|
|
const (
|
|
// Which means a condition to filter the records which don't match any id.
|
|
// It's different from zero which means the condition could be ignored.
|
|
NoneID = -1
|
|
)
|