Wrap form metadata in accordion for legibility

This commit is contained in:
Gregoo 2025-02-03 10:49:23 +01:00
parent 4cf91a6edd
commit 7453d97c81

View File

@ -1,3 +1,5 @@
{% import 'macro/accordion.html' as accordion %}
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} - {% if not bulk %}Add a set{% else %}Bulk add sets{% endif %}{% endblock %} {% block title %} - {% if not bulk %}Add a set{% else %}Bulk add sets{% endif %}{% endblock %}
@ -33,32 +35,37 @@
Add without confirmation Add without confirmation
</label> </label>
</div> </div>
{% if brickset_owners | length %} <h6 class="border-bottom mt-2">Metadata</h6>
<h5 class="border-bottom mt-2">Owners</h5> <div class="accordion accordion" id="metadata">
<div id="add-owners"> {% if brickset_owners | length %}
{% for owner in brickset_owners %} {{ accordion.header('Owners', 'owners', 'metadata', icon='user-line') }}
{% with id=owner.as_dataset() %} <div id="add-owners">
<div class="form-check"> {% for owner in brickset_owners %}
<input class="form-check-input" type="checkbox" value="{{ owner.fields.id }}" id="{{ id }}" autocomplete="off"> {% with id=owner.as_dataset() %}
<label class="form-check-label" for="{{ id }}">{{ owner.fields.name }}</label> <div class="form-check">
</div> <input class="form-check-input" type="checkbox" value="{{ owner.fields.id }}" id="{{ id }}" autocomplete="off">
{% endwith %} <label class="form-check-label" for="{{ id }}">{{ owner.fields.name }}</label>
{% endfor %} </div>
</div> {% endwith %}
{% endif %} {% endfor %}
{% if brickset_tags | length %} </div>
<h5 class="border-bottom mt-2">Tags</h5> {{ accordion.footer() }}
<div id="add-tags"> {% endif %}
{% for tag in brickset_tags %} {% if brickset_tags | length %}
{% with id=tag.as_dataset() %} {{ accordion.header('Tags', 'tags', 'metadata', icon='price-tag-2-line') }}
<div class="form-check"> <div id="add-tags">
<input class="form-check-input" type="checkbox" value="{{ tag.fields.id }}" id="{{ id }}" autocomplete="off"> {% for tag in brickset_tags %}
<label class="form-check-label" for="{{ id }}">{{ tag.fields.name }}</label> {% with id=tag.as_dataset() %}
</div> <div class="form-check">
{% endwith %} <input class="form-check-input" type="checkbox" value="{{ tag.fields.id }}" id="{{ id }}" autocomplete="off">
{% endfor %} <label class="form-check-label" for="{{ id }}">{{ tag.fields.name }}</label>
</div> </div>
{% endif %} {% endwith %}
{% endfor %}
</div>
{{ accordion.footer() }}
{% endif %}
</div>
<hr> <hr>
<div class="mb-3"> <div class="mb-3">
<p> <p>