| 123456789101112131415 |
- {% macro history_tabs(section, scope, detail_url, vehicle_missing, target) %}
- <div class="tabs history-tabs" role="group" aria-label="{{ 'Kommentare' if section == 'kommentare' else 'Buchungsbelege' }} filtern">
- {% for value, label in [('invoice', 'Diese Rechnung'), ('open', 'Alle offenen Rechnungen'),
- ('vehicle', 'Dieses Fahrzeug'), ('debtor', 'Debitor Historie')] %}
- <button type="button" class="tab history-tab{% if scope == value %} active{% endif %}"
- aria-pressed="{{ 'true' if scope == value else 'false' }}"
- hx-get="{{ detail_url }}/{{ section }}?scope={{ value }}"
- hx-target="#{{ target }}" hx-swap="outerHTML" hx-push-url="false"
- hx-sync="#{{ target }}:replace"
- {% if value == 'vehicle' and vehicle_missing %}disabled title="Kein Fahrzeug zur Rechnung hinterlegt"{% endif %}>
- {{ label }}
- </button>
- {% endfor %}
- </div>
- {% endmacro %}
|