li7y/templates/item_add.html
Simon Bruder c4a73204aa
Make item name optional
This vastly changes how item names are displayed. To make this more
ergonomic, it adds some helper macros. This also aids in adhering to
DRY.
2024-07-11 01:16:45 +02:00

36 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{#
SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% extends "base.html" %}
{% block title %}{% block page_title %}Add Item{% endblock %} {{ branding }}{% endblock %}
{% block main %}
<form method="POST">
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<div class="input-group">
<div class="input-group-text">
<input type="checkbox" class="form-check-input mt-0 input-toggle"{% if let Some(data) = data %}{% if data.name.is_some() %} checked{% endif %}{% endif %}>
</div>
<input type="text" class="form-control" id="name" name="name"{% if let Some(data) = data %}{% if let Some(name) = data.name %} value="{{ name }}"{% else %} disabled{% endif %}{% else %}disabled{% endif %}>
</div>
</div>
<div class="mb-3">
<label for="class" class="form-label">Class</label>
<input type="text" class="form-control" id="class" name="class" required{% if let Some(data) = data %} value="{{ data.class }}"{% endif %}>
</div>
<div class="mb-3">
<label for="parent" class="form-label">Parent</label>
<div class="input-group">
<div class="input-group-text">
<input type="checkbox" class="form-check-input mt-0 input-toggle"{% if let Some (data) = data %}{% if data.parent.is_some() %} checked{% endif %}{% endif %}>
</div>
<input type="text" class="form-control" id="parent" name="parent"{% if let Some(data) = data %}{% if let Some(parent) = data.parent %} value="{{ parent }}"{% else %} disabled{% endif %}{% else %}disabled{% endif %}>
</div>
</div>
<button type="submit" class="btn btn-primary">Add</button>
</form>
{% endblock %}