0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-18 14:44:11 +01:00

Fix sorting admin user list by last login (#22081)

Admin User Account list sort

`updated_unix` is not the same as "Last Sign-In"
This commit is contained in:
aceArt-GmbH 2022-12-12 01:00:17 +01:00 committed by GitHub
parent c9ef03af65
commit 352a50d65f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -68,6 +68,10 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions,
orderBy = "`user`.updated_unix ASC" orderBy = "`user`.updated_unix ASC"
case "reversealphabetically": case "reversealphabetically":
orderBy = "`user`.name DESC" orderBy = "`user`.name DESC"
case "lastlogin":
orderBy = "`user`.last_login_unix ASC"
case "reverselastlogin":
orderBy = "`user`.last_login_unix DESC"
case UserSearchDefaultSortType: // "alphabetically" case UserSearchDefaultSortType: // "alphabetically"
default: default:
orderBy = "`user`.name ASC" orderBy = "`user`.name ASC"

View file

@ -76,9 +76,9 @@
<th>{{.locale.Tr "admin.users.2fa"}}</th> <th>{{.locale.Tr "admin.users.2fa"}}</th>
<th>{{.locale.Tr "admin.users.repos"}}</th> <th>{{.locale.Tr "admin.users.repos"}}</th>
<th>{{.locale.Tr "admin.users.created"}}</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"}} {{.locale.Tr "admin.users.last_login"}}
{{SortArrow "leastupdate" "recentupdate" $.SortType false}} {{SortArrow "lastlogin" "reverselastlogin" $.SortType false}}
</th> </th>
<th>{{.locale.Tr "admin.users.edit"}}</th> <th>{{.locale.Tr "admin.users.edit"}}</th>
</tr> </tr>