Replace custom form templates with TabbedFieldGroups

This commit is contained in:
Jeremy Stretch
2024-03-13 10:59:00 -04:00
parent 8f03a19b5f
commit 2aaa552067
12 changed files with 87 additions and 369 deletions

View File

@@ -26,7 +26,7 @@
{% elif layout == 'inline' %}
{# Multiple form fields on the same line #}
<div class="row mb-3">
<label class="col col-form-label text-lg-end">{{ title|default:'' }}</label>
<label class="col col-3 col-form-label text-lg-end">{{ title|default:'' }}</label>
{% for field in items %}
<div class="col mb-1">
{{ field }}
@@ -37,16 +37,18 @@
{% elif layout == 'tabs' %}
{# Tabbed groups of fields #}
<div class="row offset-sm-3">
<ul class="nav nav-pills mb-1" role="tablist">
{% for tab in items %}
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="{{ tab.id }}_tab" data-bs-toggle="tab" aria-controls="{{ tab.id }}" data-bs-target="#{{ tab.id }}" class="nav-link {% if tab.active %}active{% endif %}">
{% trans tab.title %}
</button>
</li>
{% endfor %}
</ul>
<div class="row">
<div class="col offset-3">
<ul class="nav nav-pills mb-1" role="tablist">
{% for tab in items %}
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="{{ tab.id }}_tab" data-bs-toggle="tab" aria-controls="{{ tab.id }}" data-bs-target="#{{ tab.id }}" class="nav-link {% if tab.active %}active{% endif %}">
{% trans tab.title %}
</button>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="tab-content p-0 border-0">
{% for tab in items %}