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

tokarchuk/v1.18
aceArt-GmbH 2 years ago committed by GitHub
parent c36a1bc766
commit 1409b348c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      routers/web/explore/user.go
  2. 4
      templates/admin/user/list.tmpl

@ -69,6 +69,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"

@ -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>

Loading…
Cancel
Save