diff --git a/models/user.go b/models/user.go index 7b114172cdb1d..849cad531b0b0 100644 --- a/models/user.go +++ b/models/user.go @@ -1669,7 +1669,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond { } cond = cond.And(twoFactorCond) } else { - log.Critical("Unknown admin user search filter: %v=%v", filterKey, filterValue) + log.Error("Unknown admin user search filter: %v=%v", filterKey, filterValue) } } } diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index e9f96ca038df6..c9f1761ee8f85 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -63,8 +63,7 @@ diff --git a/web_src/js/features/admin-users.js b/web_src/js/features/admin-users.js index d2679c9b095cc..2354f67fc709d 100644 --- a/web_src/js/features/admin-users.js +++ b/web_src/js/features/admin-users.js @@ -1,12 +1,10 @@ export function initAdminUserListSearchForm() { - if (!$('.admin').length) return; - if (!window.giteaContext || !window.giteaContext.adminUserListSearchForm) return; + const searchForm = window.config.PageData.adminUserListSearchForm; + if (!searchForm) return; const $form = $('#user-list-search-form'); if (!$form.length) return; - const searchForm = window.giteaContext.adminUserListSearchForm; - $form.find(`button[name=sort][value=${searchForm.sortType}]`).addClass('active'); if (searchForm.statusFilterMap) { diff --git a/web_src/js/index.js b/web_src/js/index.js index 51248817ea9f5..ddc02ba82e5c3 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -27,7 +27,7 @@ import {initMarkupContent, initCommentContent} from './markup/content.js'; import {stripTags, mqBinarySearch} from './utils.js'; import {svg, svgs} from './svg.js'; -const {AppSubUrl, AssetUrlPrefix, csrf} = window.config; +const {AppSubUrl, AssetUrlPrefix, csrf, PageData} = window.config; let previewFileModes; const commentMDEditors = {}; @@ -3439,7 +3439,7 @@ function initVueApp() { searchLimit: Number((document.querySelector('meta[name=_search_limit]') || {}).content), suburl: AppSubUrl, uid: Number((document.querySelector('meta[name=_context_uid]') || {}).content), - activityTopAuthors: window.ActivityTopAuthors || [], + activityTopAuthors: PageData.ActivityTopAuthors || [], }; }, });