Add search form to user list page

This commit is contained in:
Kitaiti Makoto 2023-03-20 01:00:17 +09:00
parent 3e9d9a459f
commit 98c73bb6df

View File

@ -3,7 +3,7 @@
@use crate::template_utils::*;
@use crate::routes::*;
@(ctx: BaseContext, users: Vec<User>, page: i32, n_pages: i32)
@(ctx: BaseContext, users: Vec<User>, user: Option<&str>, page: i32, n_pages: i32)
@:base(ctx, i18n!(ctx.1, "Users"), {}, {}, {
<h1>@i18n!(ctx.1, "Users")</h1>
@ -15,6 +15,12 @@
(&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), false)
])
<form method="get" action="@uri!(instance::admin_search_users: page = _, user = user.unwrap_or(""))">
<input type="search" name="user" value="@user.unwrap_or("")">
<input type="hidden" name="page" value="@page">
<input type="submit" value="@i18n!(ctx.1, "Search users")">
</form>
<form method="post" action="@uri!(instance::edit_users)">
<header>
<select name="action">