ui change move image element #3
@@ -44,21 +44,6 @@
|
|||||||
名称
|
名称
|
||||||
<input type="text" name="name" value="{{ item.name if item else '' }}" required autofocus>
|
<input type="text" name="name" value="{{ item.name if item else '' }}" required autofocus>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-field">
|
|
||||||
数量
|
|
||||||
<input type="number" name="quantity" min="0" value="{{ item.quantity if item and item.quantity is not none else '1' }}">
|
|
||||||
</label>
|
|
||||||
<label class="checkbox-row">
|
|
||||||
<input type="checkbox" name="is_container" {% if item and item.is_container %}checked{% endif %}>
|
|
||||||
这个物品本身是一个小容器
|
|
||||||
</label>
|
|
||||||
<div class="checkbox-help">
|
|
||||||
勾选后,这个 Item 将作为“第二层容器”,后续可以继续往里面添加最后一级的 SubItem。
|
|
||||||
</div>
|
|
||||||
<label class="form-field">
|
|
||||||
备注
|
|
||||||
<textarea name="note" rows="4">{{ item.note if item and item.note else '' }}</textarea>
|
|
||||||
</label>
|
|
||||||
<label class="form-field">
|
<label class="form-field">
|
||||||
图片
|
图片
|
||||||
<input type="file" name="image_file" accept="image/*">
|
<input type="file" name="image_file" accept="image/*">
|
||||||
@@ -77,6 +62,21 @@
|
|||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<label class="form-field">
|
||||||
|
数量
|
||||||
|
<input type="number" name="quantity" min="0" value="{{ item.quantity if item and item.quantity is not none else '1' }}">
|
||||||
|
</label>
|
||||||
|
<label class="checkbox-row">
|
||||||
|
<input type="checkbox" name="is_container" {% if item and item.is_container %}checked{% endif %}>
|
||||||
|
这个物品本身是一个小容器
|
||||||
|
</label>
|
||||||
|
<div class="checkbox-help">
|
||||||
|
勾选后,这个 Item 将作为“第二层容器”,后续可以继续往里面添加最后一级的 SubItem。
|
||||||
|
</div>
|
||||||
|
<label class="form-field">
|
||||||
|
备注
|
||||||
|
<textarea name="note" rows="4">{{ item.note if item and item.note else '' }}</textarea>
|
||||||
|
</label>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" name="submit_action" value="save" class="button button-primary">{{ submit_label }}</button>
|
<button type="submit" name="submit_action" value="save" class="button button-primary">{{ submit_label }}</button>
|
||||||
{% if not item %}
|
{% if not item %}
|
||||||
|
|||||||
@@ -46,14 +46,6 @@
|
|||||||
名称
|
名称
|
||||||
<input type="text" name="name" value="{{ subitem.name if subitem else '' }}" required autofocus>
|
<input type="text" name="name" value="{{ subitem.name if subitem else '' }}" required autofocus>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-field">
|
|
||||||
数量
|
|
||||||
<input type="number" name="quantity" min="0" value="{{ subitem.quantity if subitem and subitem.quantity is not none else '1' }}">
|
|
||||||
</label>
|
|
||||||
<label class="form-field">
|
|
||||||
备注
|
|
||||||
<textarea name="note" rows="4">{{ subitem.note if subitem and subitem.note else '' }}</textarea>
|
|
||||||
</label>
|
|
||||||
<label class="form-field">
|
<label class="form-field">
|
||||||
图片
|
图片
|
||||||
<input type="file" name="image_file" accept="image/*">
|
<input type="file" name="image_file" accept="image/*">
|
||||||
@@ -72,6 +64,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<label class="form-field">
|
||||||
|
数量
|
||||||
|
<input type="number" name="quantity" min="0" value="{{ subitem.quantity if subitem and subitem.quantity is not none else '1' }}">
|
||||||
|
</label>
|
||||||
|
<label class="form-field">
|
||||||
|
备注
|
||||||
|
<textarea name="note" rows="4">{{ subitem.note if subitem and subitem.note else '' }}</textarea>
|
||||||
|
</label>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" name="submit_action" value="save" class="button button-primary">{{ submit_label }}</button>
|
<button type="submit" name="submit_action" value="save" class="button button-primary">{{ submit_label }}</button>
|
||||||
{% if not subitem %}
|
{% if not subitem %}
|
||||||
|
|||||||
@@ -875,6 +875,7 @@ def test_new_item_page_shows_clear_context_and_default_quantity(client, db_sessi
|
|||||||
assert "主卧箱" in response.text
|
assert "主卧箱" in response.text
|
||||||
assert 'name="quantity"' in response.text
|
assert 'name="quantity"' in response.text
|
||||||
assert 'value="1"' in response.text
|
assert 'value="1"' in response.text
|
||||||
|
assert response.text.index('name="name"') < response.text.index('name="image_file"') < response.text.index('name="quantity"')
|
||||||
assert "这个物品本身是一个小容器" in response.text
|
assert "这个物品本身是一个小容器" in response.text
|
||||||
assert "保存并添加下一个" in response.text
|
assert "保存并添加下一个" in response.text
|
||||||
|
|
||||||
@@ -893,6 +894,7 @@ def test_new_subitem_page_shows_clear_context_and_default_quantity(client, db_se
|
|||||||
assert "文件袋" in response.text
|
assert "文件袋" in response.text
|
||||||
assert 'name="quantity"' in response.text
|
assert 'name="quantity"' in response.text
|
||||||
assert 'value="1"' in response.text
|
assert 'value="1"' in response.text
|
||||||
|
assert response.text.index('name="name"') < response.text.index('name="image_file"') < response.text.index('name="quantity"')
|
||||||
assert "保存并添加下一个" in response.text
|
assert "保存并添加下一个" in response.text
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user