ux improve
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="breadcrumb">
|
||||
<a href="/boxes">箱子</a>
|
||||
<span>/</span>
|
||||
<a href="/boxes/{{ item.box.id }}">{{ item.box.name }}</a>
|
||||
<span>/</span>
|
||||
<strong>{{ item.name }}</strong>
|
||||
</div>
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<div class="type-tag {{ 'type-container' if item.is_container else 'type-item' }}">
|
||||
{{ "容器型 Item" if item.is_container else "Item" }}
|
||||
</div>
|
||||
<h1>{{ item.name }}</h1>
|
||||
<p class="muted">位于箱子 <a href="/boxes/{{ item.box.id }}">{{ item.box.name }}</a> 中</p>
|
||||
</div>
|
||||
@@ -34,15 +44,24 @@
|
||||
<a class="button" href="/items/{{ item.id }}/subitems/new">添加子物品</a>
|
||||
</div>
|
||||
{% if item.subitems %}
|
||||
<div class="dense-list">
|
||||
{% for subitem in item.subitems %}
|
||||
<article class="card">
|
||||
<article class="compact-row compact-row-subitem">
|
||||
{% if subitem.image_blob %}
|
||||
<img src="/subitems/{{ subitem.id }}/image" alt="{{ subitem.name }}" class="thumb-image">
|
||||
<img src="/subitems/{{ subitem.id }}/image" alt="{{ subitem.name }}" class="thumb-image compact-thumb">
|
||||
{% endif %}
|
||||
<h3>{{ subitem.name }}</h3>
|
||||
{% if subitem.quantity is not none %}<p><strong>数量:</strong> {{ subitem.quantity }}</p>{% endif %}
|
||||
{% if subitem.note %}<p><strong>备注:</strong> {{ subitem.note }}</p>{% endif %}
|
||||
<div class="actions">
|
||||
<div class="compact-main">
|
||||
<div class="row-title-line">
|
||||
<span class="type-tag type-subitem">SubItem</span>
|
||||
<h3>{{ subitem.name }}</h3>
|
||||
</div>
|
||||
<div class="row-meta-grid">
|
||||
<span>数量:{{ subitem.quantity if subitem.quantity is not none else 1 }}</span>
|
||||
<span>上级容器:{{ item.name }}</span>
|
||||
</div>
|
||||
{% if subitem.note %}<p class="row-note">备注:{{ subitem.note }}</p>{% endif %}
|
||||
</div>
|
||||
<div class="row-actions">
|
||||
<a href="/subitems/{{ subitem.id }}/edit">编辑</a>
|
||||
<form method="post" action="/subitems/{{ subitem.id }}/delete">
|
||||
<button type="submit" class="link-button">删除</button>
|
||||
@@ -50,6 +69,7 @@
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<section class="card">
|
||||
<p>还没有子物品。</p>
|
||||
|
||||
Reference in New Issue
Block a user