summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorAlexey Terentyev <terentyev.alexey@gmail.com>2018-05-24 04:03:42 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2018-05-24 09:03:42 +0800
commitb908ac9fab141b72f38db3d40a9f6054bb701982 (patch)
tree11a91f0a12fa32b0fa834d0388949fb59d13f4a2 /models/user.go
parentea2a938e8a25588634364b3bc6ce8d6634ae4c60 (diff)
downloadgitea-b908ac9fab141b72f38db3d40a9f6054bb701982.tar.gz
gitea-b908ac9fab141b72f38db3d40a9f6054bb701982.zip
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>
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go
index 8f5ee6e5a7..d642054979 100644
--- a/models/user.go
+++ b/models/user.go
@@ -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)
}