fix(admin-invites): add margin-top to create button, align save/delete buttons bottom with select via invisible label

This commit is contained in:
2026-07-06 08:18:51 +08:00
parent fd7e700e7d
commit 1354032914
2 changed files with 8 additions and 5 deletions

View File

@@ -296,7 +296,7 @@ code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; font-si
.aif-input:focus, .aif-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); } .aif-input:focus, .aif-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.aif-short { width: 80px; } .aif-short { width: 80px; }
.aif-date { width: 180px; } .aif-date { width: 180px; }
.aif-btn-wrap { flex-direction: row; align-items: flex-end; gap: .4rem; padding-bottom: 1px; } .aif-btn-wrap { flex-direction: row; align-items: center; gap: .4rem; }
.aif-btn { height: 2rem; } .aif-btn { height: 2rem; }
.aif-edit-num, .aif-edit-date { flex-direction: row; align-items: center; gap: .35rem; } .aif-edit-num, .aif-edit-date { flex-direction: row; align-items: center; gap: .35rem; }
.aif-edit-num .aif-input, .aif-edit-date .aif-input { width: 80px; flex: none; } .aif-edit-num .aif-input, .aif-edit-date .aif-input { width: 80px; flex: none; }

View File

@@ -15,7 +15,7 @@
<!-- Add new code --> <!-- Add new code -->
<div style="margin-bottom:2rem;padding:1.5rem;background:var(--card-bg);border-radius:var(--radius);border:1px solid var(--border)"> <div style="margin-bottom:2rem;padding:1.5rem;background:var(--card-bg);border-radius:var(--radius);border:1px solid var(--border)">
<h3 style="margin-bottom:1rem;font-size:1rem">创建邀请码</h3> <h3 style="margin-bottom:1rem;font-size:1rem">创建邀请码</h3>
<form method="post" action="/admin/invites/add" class="admin-invite-form" style="flex-direction:column;gap:1.1rem"> <form method="post" action="/admin/invites/add" class="admin-invite-form" style="flex-direction:column;gap:.85rem">
<div class="aif-row"> <div class="aif-row">
<label class="aif-label">邀请码(留空自动生成)</label> <label class="aif-label">邀请码(留空自动生成)</label>
<input type="text" name="code" maxlength="8" placeholder="自动生成" class="aif-input" style="text-transform:uppercase"> <input type="text" name="code" maxlength="8" placeholder="自动生成" class="aif-input" style="text-transform:uppercase">
@@ -36,7 +36,7 @@
<label class="aif-label">过期时间</label> <label class="aif-label">过期时间</label>
<input type="datetime-local" name="expires_at" class="aif-input"> <input type="datetime-local" name="expires_at" class="aif-input">
</div> </div>
<div class="aif-row"> <div class="aif-row" style="margin-top:.35rem">
<button type="submit" class="btn btn-primary" style="width:fit-content">创建</button> <button type="submit" class="btn btn-primary" style="width:fit-content">创建</button>
</div> </div>
</form> </form>
@@ -77,8 +77,11 @@
<input type="datetime-local" name="expires_at" value="{{ c.expires_at.strftime('%Y-%m-%dT%H:%M') if c.expires_at else '' }}" class="aif-input aif-date"> <input type="datetime-local" name="expires_at" value="{{ c.expires_at.strftime('%Y-%m-%dT%H:%M') if c.expires_at else '' }}" class="aif-input aif-date">
</div> </div>
<div class="aif-field aif-btn-wrap"> <div class="aif-field aif-btn-wrap">
<button type="submit" class="btn btn-sm">保存</button> <span class="aif-label" style="visibility:hidden">.</span>
<button type="button" class="btn btn-danger btn-sm" onclick="if(confirm('确定删除?'))this.closest('form').nextElementSibling.submit()">删除</button> <div style="display:flex;gap:.4rem">
<button type="submit" class="btn btn-sm">保存</button>
<button type="button" class="btn btn-danger btn-sm" onclick="if(confirm('确定删除?'))this.closest('form').nextElementSibling.submit()">删除</button>
</div>
</div> </div>
</form> </form>
<form method="post" action="/admin/invites/{{ c.id }}/delete" style="display:none"></form> <form method="post" action="/admin/invites/{{ c.id }}/delete" style="display:none"></form>