diff options
author | aceArt-GmbH <33117017+aceArt-GmbH@users.noreply.github.com> | 2022-12-12 01:00:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-11 18:00:17 -0600 |
commit | 352a50d65f02e81bb06b07fd6cd11e83f5d64cb0 (patch) | |
tree | f6a2ae58d909692fa1bb0f2d5bde661f242c0b56 | |
parent | c9ef03af65b5e6253b91ca8ff712222dbf738fd4 (diff) | |
download | gitea-352a50d65f02e81bb06b07fd6cd11e83f5d64cb0.tar.gz gitea-352a50d65f02e81bb06b07fd6cd11e83f5d64cb0.zip |
Fix sorting admin user list by last login (#22081)
Admin User Account list sort
`updated_unix` is not the same as "Last Sign-In"
-rw-r--r-- | routers/web/explore/user.go | 4 | ||||
-rw-r--r-- | templates/admin/user/list.tmpl | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/routers/web/explore/user.go b/routers/web/explore/user.go index bb6aa3dc77..e00493c87b 100644 --- a/routers/web/explore/user.go +++ b/routers/web/explore/user.go @@ -68,6 +68,10 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions, orderBy = "`user`.updated_unix ASC" case "reversealphabetically": orderBy = "`user`.name DESC" + case "lastlogin": + orderBy = "`user`.last_login_unix ASC" + case "reverselastlogin": + orderBy = "`user`.last_login_unix DESC" case UserSearchDefaultSortType: // "alphabetically" default: orderBy = "`user`.name ASC" diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 56f6eaa3ad..67a726eb3f 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -76,9 +76,9 @@ <th>{{.locale.Tr "admin.users.2fa"}}</th> <th>{{.locale.Tr "admin.users.repos"}}</th> <th>{{.locale.Tr "admin.users.created"}}</th> - <th data-sortt-asc="leastupdate" data-sortt-desc="recentupdate"> + <th data-sortt-asc="lastlogin" data-sortt-desc="reverselastlogin"> {{.locale.Tr "admin.users.last_login"}} - {{SortArrow "leastupdate" "recentupdate" $.SortType false}} + {{SortArrow "lastlogin" "reverselastlogin" $.SortType false}} </th> <th>{{.locale.Tr "admin.users.edit"}}</th> </tr> |