fix(admin-invites): create card uses form-card style, align save/delete with select via align-self flex-end
This commit is contained in:
@@ -289,7 +289,7 @@ code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; font-si
|
||||
/* Admin invite form */
|
||||
.admin-invite-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
|
||||
.aif-row { display: flex; flex-direction: column; gap: .3rem; }
|
||||
.aif-field { display: flex; flex-direction: column; gap: .15rem; justify-content: flex-end; }
|
||||
.aif-field { display: flex; flex-direction: column; gap: .15rem; }
|
||||
.aif-grow { flex: 1 1 200px; min-width: 0; }
|
||||
.aif-label { font-size: .8rem; color: var(--text-muted); line-height: 1.2; }
|
||||
.aif-input, .aif-select { width: 100%; padding: .45rem .65rem; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; background: #fff; line-height: 1.3; }
|
||||
|
||||
@@ -13,31 +13,31 @@
|
||||
{% endif %}
|
||||
|
||||
<!-- Add new code -->
|
||||
<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>
|
||||
<form method="post" action="/admin/invites/add" class="admin-invite-form" style="flex-direction:column;gap:.85rem">
|
||||
<div class="aif-row">
|
||||
<label class="aif-label">邀请码(留空自动生成)</label>
|
||||
<input type="text" name="code" maxlength="8" placeholder="自动生成" class="aif-input" style="text-transform:uppercase">
|
||||
<div class="form-card" style="margin-bottom:1.5rem">
|
||||
<h3 style="margin-bottom:.75rem">创建邀请码</h3>
|
||||
<form method="post" action="/admin/invites/add" style="display:flex;flex-direction:column;gap:.85rem">
|
||||
<div>
|
||||
<label>邀请码(留空自动生成)</label>
|
||||
<input type="text" name="code" maxlength="8" placeholder="自动生成" style="text-transform:uppercase">
|
||||
</div>
|
||||
<div class="aif-row">
|
||||
<label class="aif-label">限制类型</label>
|
||||
<select name="limit_type" id="limit_type" onchange="toggleLimitFields()" class="aif-select">
|
||||
<div>
|
||||
<label>限制类型</label>
|
||||
<select name="limit_type" id="limit_type" onchange="toggleLimitFields()">
|
||||
<option value="unlimited">无限制</option>
|
||||
<option value="uses">使用次数</option>
|
||||
<option value="expires">有效期</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="aif-row" id="max_uses_field" style="display:none">
|
||||
<label class="aif-label">最大使用次数</label>
|
||||
<input type="number" name="max_uses" min="1" value="1" class="aif-input">
|
||||
<div id="max_uses_field" style="display:none">
|
||||
<label>最大使用次数</label>
|
||||
<input type="number" name="max_uses" min="1" value="1">
|
||||
</div>
|
||||
<div class="aif-row" id="expires_field" style="display:none">
|
||||
<label class="aif-label">过期时间</label>
|
||||
<input type="datetime-local" name="expires_at" class="aif-input">
|
||||
<div id="expires_field" style="display:none">
|
||||
<label>过期时间</label>
|
||||
<input type="datetime-local" name="expires_at">
|
||||
</div>
|
||||
<div class="aif-row" style="margin-top:.35rem">
|
||||
<button type="submit" class="btn btn-primary" style="width:fit-content">创建</button>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">创建</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -76,12 +76,9 @@
|
||||
<div class="aif-field aif-edit-date" style="display:{% if c.expires_at %}flex{% else %}none{% endif %}">
|
||||
<input type="datetime-local" name="expires_at" value="{{ c.expires_at|to_local|strftime('%Y-%m-%dT%H:%M') if c.expires_at else '' }}" class="aif-input aif-date">
|
||||
</div>
|
||||
<div class="aif-field aif-btn-wrap">
|
||||
<span class="aif-label" style="visibility:hidden">.</span>
|
||||
<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 style="display:flex;gap:.4rem;align-self:flex-end">
|
||||
<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>
|
||||
</form>
|
||||
<form method="post" action="/admin/invites/{{ c.id }}/delete" style="display:none"></form>
|
||||
|
||||
Reference in New Issue
Block a user