From ee655be7d49faf5013dce08545d3baf3bc66d271 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Sun, 5 Jul 2026 19:03:48 +0800 Subject: [PATCH] feat: inline rename for profiles, dashboard stats grid UI --- app/static/style.css | 14 +++++++++++++- app/templates/dashboard.html | 28 +++++++++++++++++++++------- app/templates/profiles.html | 27 ++++++++++++++++++++++----- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/app/static/style.css b/app/static/style.css index 72c485d..d0f21f0 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -54,7 +54,9 @@ input[type="text"] + label, input[type="password"] + label, input[type="datetime .filter-bar .form-row select { flex: 0 0 auto; width: auto; } .inline-form { margin-bottom: 1.25rem; } .rename-form { display: inline-flex; gap: .35rem; align-items: center; margin-right: .5rem; } -.rename-form input[type="text"] { width: 120px; flex: none; } +.nickname-display { display: inline; } +.nickname-edit { display: inline-flex; gap: .35rem; align-items: center; } +.nickname-edit input[type="text"] { width: 140px; flex: none; } /* Buttons */ .btn { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: .9rem; text-align: center; white-space: nowrap; } @@ -89,6 +91,16 @@ code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; font-si .stats { display: flex; gap: .75rem; font-size: .85rem; color: var(--text-muted); flex-wrap: wrap; } .stat { white-space: nowrap; } +/* Dashboard cards */ +.dashboard-card { padding: 1.25rem; } +.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .75rem; } +.stat-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; } +.stat-num { font-size: 1.3rem; font-weight: 700; color: var(--text); } +.stat-label { font-size: .75rem; color: var(--text-muted); } +.stat-sent { color: var(--sent); } +.stat-delivered { color: var(--delivered); } +.stat-received { color: var(--received); } + /* Postcard grid */ .postcard-card { display: flex; gap: 1rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem; transition: box-shadow .15s; } .postcard-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); text-decoration: none; } diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index ec85045..9cb51c1 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -2,20 +2,34 @@ {% block title %}Dashboard - Postcard Manager{% endblock %} {% block content %}

👋 欢迎,{{ user.username }}

+
-

Profiles

+

我的 Profiles

+ 管理 Profiles
{% if profiles %}
{% for p in profiles %} - +

{{ p.nickname }}

-
- 📬 {{ stats[p.id].total }} - 寄出 {{ stats[p.id].sent }} - 送达 {{ stats[p.id].delivered }} - 收到 {{ stats[p.id].received }} +
+
+ {{ stats[p.id].total }} + 总计 +
+
+ {{ stats[p.id].sent }} + 寄出 +
+
+ {{ stats[p.id].delivered }} + 送达 +
+
+ {{ stats[p.id].received }} + 收到 +
{% endfor %} diff --git a/app/templates/profiles.html b/app/templates/profiles.html index beaf5c3..189c958 100644 --- a/app/templates/profiles.html +++ b/app/templates/profiles.html @@ -16,13 +16,18 @@ {% for p in profiles %} - {{ p.nickname }} + + {{ p.nickname }} + + {{ p.created_at.strftime('%Y-%m-%d %H:%M') }} -
- - -
+ 查看 +
@@ -34,4 +39,16 @@ {% else %}

还没有 Profile。

{% endif %} + {% endblock %}