mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 02:08:36 +00:00
Added repository search ordered by stars or forks. Forks column in admin repo list. (#3969)
* Added repository search order by stars or forks. Added Forks column to admin repository list. Signed-off-by: Alexey Terentyev <axifnx@gmail.com> * Renamed search repo template Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
This commit is contained in:
committed by
Lunny Xiao
parent
ea2a938e8a
commit
b908ac9fab
@@ -1272,7 +1272,7 @@ func GetUser(user *User) (bool, error) {
|
||||
type SearchUserOptions struct {
|
||||
Keyword string
|
||||
Type UserType
|
||||
OrderBy string
|
||||
OrderBy SearchOrderBy
|
||||
Page int
|
||||
PageSize int // Can be smaller than or equal to setting.UI.ExplorePagingNum
|
||||
IsActive util.OptionalBool
|
||||
@@ -1322,7 +1322,7 @@ func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
|
||||
users = make([]*User, 0, opts.PageSize)
|
||||
return users, count, x.Where(cond).
|
||||
Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).
|
||||
OrderBy(opts.OrderBy).
|
||||
OrderBy(opts.OrderBy.String()).
|
||||
Find(&users)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user