refactor: using word depot in rear instead of admin

This commit is contained in:
2024-07-20 09:34:51 +02:00
parent a26e17a064
commit 966291dbd9
38 changed files with 1112 additions and 72 deletions
@@ -0,0 +1,29 @@
<!--noformat-->
<form class="ui form"
hx-target="main"
{% if form.method|upper == 'POST' or not form.method %}
hx-post="{{form.action}}"
{% elif form.method|upper == 'GET' %}
hx-get="{{form.action}}"
{% elif form.method|upper == 'PATCH' %}
hx-patch="{{form.action}}"
{% elif form.method|upper == 'PUT' %}
hx-put="{{form.action}}"
{% else %}
unknown-form-method={{form.method}}
{% endif %}>
{% from "/admin/items/items.jinja" import field_widget %}
{% for field_name, field_defs in fields %}
{% if item %}
{% set field_value = item.fields[field_name]|none("") %}
{% else %}
{% set field_value = "" %}
{% endif %}
<div class="field">
{{ field_widget(field_name, field_defs, field_value) }}
</div>
{% endfor %}
<button class="ui button" type="submit">Create</button>
</form>
<!--noformat-->