ux refine

This commit is contained in:
2026-04-19 14:06:31 +02:00
parent e7a2719fa1
commit bda23909bf
10 changed files with 257 additions and 95 deletions
+26 -25
View File
@@ -13,33 +13,44 @@
<p class="muted">查看这个箱子的基本信息,以及它下面的直接物品。</p>
</div>
<div class="actions">
<a href="/boxes">返回箱子列表</a>
<a href="/search">去搜索</a>
<a class="button" href="/boxes/{{ box.id }}/items/new">添加物品</a>
<a class="button button-secondary button-small" href="/boxes">返回箱子列表</a>
<a class="button button-secondary button-small" href="/search">去搜索</a>
<a class="button button-primary" href="/boxes/{{ box.id }}/items/new">添加物品</a>
</div>
</div>
<section class="card">
<section class="card detail-card detail-card-compact">
{% if box.image_blob %}
<img src="/boxes/{{ box.id }}/image" alt="{{ box.name }}" class="detail-image">
<img src="/boxes/{{ box.id }}/image" alt="{{ box.name }}" class="detail-image detail-image-compact">
{% endif %}
<p><strong>房间:</strong> {{ box.room or '-' }}</p>
<p><strong>状态</strong> {{ box.status or '-' }}</p>
<p><strong>备注</strong> {{ box.note or '-' }}</p>
<div class="detail-meta-grid">
<p><strong>房间</strong> {{ box.room or '-' }}</p>
<p><strong>状态</strong> {{ box.status or '-' }}</p>
<p class="detail-note"><strong>备注:</strong> {{ box.note or '-' }}</p>
</div>
<div class="actions">
<a href="/boxes/{{ box.id }}/edit">编辑箱子</a>
<a class="button button-secondary button-small" href="/boxes/{{ box.id }}/edit">编辑箱子</a>
<form method="post" action="/boxes/{{ box.id }}/delete">
<button type="submit" class="link-button">删除箱子</button>
<button type="submit" class="button button-danger button-small">删除箱子</button>
</form>
</div>
</section>
<section class="stack">
<h2>物品</h2>
<div class="section-heading">
<h2>内部物品</h2>
<p class="muted">重点浏览区域,点击任意一行可进入物品详情。</p>
</div>
{% if box.items %}
<div class="dense-list">
<div class="overview-grid">
{% for item in box.items %}
<article class="compact-row {{ 'compact-row-container' if item.is_container else 'compact-row-item' }}">
<article
class="compact-row clickable-card overview-card {{ 'compact-row-container' if item.is_container else 'compact-row-item' }}"
data-href="/items/{{ item.id }}"
tabindex="0"
role="link"
aria-label="查看物品 {{ item.name }}"
>
{% if item.image_blob %}
<img src="/items/{{ item.id }}/image" alt="{{ item.name }}" class="thumb-image compact-thumb">
{% endif %}
@@ -48,24 +59,14 @@
<span class="type-tag {{ 'type-container' if item.is_container else 'type-item' }}">
{{ "容器型 Item" if item.is_container else "Item" }}
</span>
<h3><a href="/items/{{ item.id }}">{{ item.name }}</a></h3>
<h3>{{ item.name }}</h3>
</div>
<div class="row-meta-grid">
<span>数量:{{ item.quantity if item.quantity is not none else 1 }}</span>
<span>是否容器:{{ "是" if item.is_container else "否" }}</span>
{% if item.note %}<span>有备注</span>{% endif %}
</div>
{% if item.note %}<p class="row-note">{{ item.note }}</p>{% endif %}
</div>
<div class="row-actions">
<a href="/items/{{ item.id }}">查看详情</a>
<a href="/items/{{ item.id }}/edit">编辑</a>
{% if item.is_container %}
<a href="/items/{{ item.id }}">查看内部内容</a>
{% endif %}
<form method="post" action="/items/{{ item.id }}/delete">
<button type="submit" class="link-button">删除</button>
</form>
</div>
</article>
{% endfor %}
</div>