fix: polish authentication and responsive controls

This commit is contained in:
2026-08-05 11:43:43 +08:00
parent f6e36d737d
commit 1245a8ec1e
9 changed files with 102 additions and 29 deletions
+23 -21
View File
@@ -10,28 +10,30 @@
<p class="mt-2 text-sm text-textSub">管理用户账号、注册状态和预测记录。</p>
</div>
<section class="mt-6 rounded-xl border border-line bg-white p-5 shadow-panel">
<h2 class="font-extrabold">用户注册</h2>
<form method="post" action="{{ url_for('main.update_registration_setting') }}" class="mt-3 flex items-center gap-3">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<label class="text-sm">
<input type="checkbox" name="allow_registration" {{ 'checked' if registration_allowed }}>
允许自助注册
</label>
<button class="ui-btn ui-btn-sm ui-btn-primary">保存</button>
</form>
</section>
<div class="mt-6 grid gap-6 xl:grid-cols-2">
<section class="rounded-xl border border-line bg-white p-5 shadow-panel">
<h2 class="font-extrabold">用户注册</h2>
<form method="post" action="{{ url_for('main.update_registration_setting') }}" class="mt-3 flex items-center gap-3">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<label class="text-sm">
<input type="checkbox" name="allow_registration" {{ 'checked' if registration_allowed }}>
允许自助注册
</label>
<button class="ui-btn ui-btn-sm ui-btn-primary">保存</button>
</form>
</section>
<section class="mt-6 rounded-xl border border-line bg-white p-5 shadow-panel">
<h2 class="font-extrabold">邀请注册</h2>
<p class="mt-1 text-sm text-textSub">即使关闭自助注册,也可向指定邮箱发送一次性注册链接。</p>
<form method="post" action="{{ url_for('main.admin_send_registration_invitation') }}" class="mt-4 flex flex-col gap-2 sm:flex-row" novalidate>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<label class="sr-only" for="inviteEmail">受邀邮箱</label>
<input id="inviteEmail" name="email" type="email" required autocomplete="email" class="min-w-0 flex-1 rounded-lg border border-line px-3 py-2 text-sm" placeholder="受邀人的邮箱地址">
<button class="ui-btn ui-btn-sm ui-btn-primary shrink-0">发送注册链接</button>
</form>
</section>
<section class="rounded-xl border border-line bg-white p-5 shadow-panel">
<h2 class="font-extrabold">邀请注册</h2>
<p class="mt-1 text-sm text-textSub">即使关闭自助注册,也可向指定邮箱发送一次性注册链接。</p>
<form method="post" action="{{ url_for('main.admin_send_registration_invitation') }}" class="mt-4 flex flex-col gap-2 sm:flex-row sm:items-center" novalidate>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<label class="sr-only" for="inviteEmail">受邀邮箱</label>
<input id="inviteEmail" name="email" type="email" required autocomplete="email" class="min-w-0 w-full rounded-lg border border-line px-3 py-2 text-sm sm:w-80" placeholder="受邀人的邮箱地址">
<button class="ui-btn ui-btn-sm ui-btn-primary shrink-0">发送注册链接</button>
</form>
</section>
</div>
<section class="mt-6 rounded-xl border border-line bg-white p-5 shadow-panel">
<div class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">