history_tabs.html 937 B

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