feat: initial postcard manager - FastAPI + Jinja2 + SQLite
This commit is contained in:
33
app/templates/profiles.html
Normal file
33
app/templates/profiles.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Profiles - Postcard Manager{% endblock %}
|
||||
{% block content %}
|
||||
<div class="section-header">
|
||||
<h1>Profiles</h1>
|
||||
</div>
|
||||
<div class="inline-form">
|
||||
<form method="post" action="/profiles" class="form-row">
|
||||
<input type="text" name="nickname" placeholder="新 Profile 昵称" required>
|
||||
<button type="submit" class="btn btn-primary">添加</button>
|
||||
</form>
|
||||
</div>
|
||||
{% if profiles %}
|
||||
<table>
|
||||
<thead><tr><th>昵称</th><th>创建时间</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
{% for p in profiles %}
|
||||
<tr>
|
||||
<td><a href="/profiles/{{ p.id }}/postcards">{{ p.nickname }}</a></td>
|
||||
<td>{{ p.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||||
<td>
|
||||
<form method="post" action="/profiles/{{ p.id }}/delete" class="inline">
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定删除该 Profile 及其所有明信片?')">删除</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="empty">还没有 Profile。</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user