{# core/ui/templates/partials/components/ui_macros.html Generische UI-Makros – AstrapiFlaskUi V3 Standard-URL-Konventionen: CRUD: POST /api/{module}/{item}/run Debug: POST /api/{module}/{item}/run?debug=true Logs: GET /api/{module}/{item}/logs #} {% macro edit_button(module=None, item=None, container_id=None, loading_id=None) %} {% endmacro %} {% macro delete_button(module=None, item=None, container_id=None, loading_id=None, description=None) %} {% endmacro %} {% macro toggle_switch(module=None, item=None, container_id=None, loading_id=None, enabled=False, description=None) %} {% endmacro %} {% macro toggle_button(module=None, item=None, container_id=None, loading_id=None, enabled=False, description=None) %} {{ toggle_switch(module=module, item=item, container_id=container_id, loading_id=loading_id, enabled=enabled, description=description) }} {% endmacro %} {% macro add_button(module=None, container_id=None, loading_id=None) %} {% endmacro %} {% macro status_inline(status) %} {% set _s = status | lower if status else '' %} {% if _s == 'ok' %} OK {% elif _s == 'error' %} Fehler {% elif _s == 'warning' %} Warnung {% elif _s == 'running' or _s == 'building' %} läuft {% elif _s == 'pending' %} ●Pending {% elif _s %} {{ status }} {% else %} Neu {% endif %} {% endmacro %} {% macro refresh_button(endpoint="/", container_id=None, loading_id=None) %} {% endmacro %} {# ── Runnable-Modul-Makros ────────────────────────────────────────────────── #} {# Standard-Konvention: POST /api/{module}/{item}/run[?debug=true] #} {# GET /api/{module}/{item}/logs #} {% macro run_button(module=None, item=None, container_id=None, enabled=True) %} {% endmacro %} {% macro run_debug_button(module=None, item=None, container_id=None) %} {% endmacro %} {% macro settings_button(module=None) %} {% endmacro %} {% macro log_button(module=None, item=None) %} {% endmacro %} {# ── Modal-Standard-Komponenten ──────────────────────────────────────────── #} {# #} {# Jedes Modal soll denselben Aufbau haben: #} {# 1. modal_wrapper – Backdrop + innere Box (Außenstruktur) #} {# 2. modal_title – Icon + Überschrift (Header) #} {# 3. Inhalt – Formular, Text, Karten … #} {# 4. modal_footer – Toggle + Abbrechen/Speichern (Standard) #} {# oder modal_footer_simple – nur ein Schließen-Button #} {# #} {# Verwendung mit modal_wrapper: #} {# {% call modal_wrapper("mein-modal", max_width="580px") %} #} {# {{ modal_title(title="Titel", icon="edit") }} #} {# #} {# {{ modal_footer(save_label="Speichern") }} #} {# {% endcall %} #} {# modal_wrapper(id, max_width, padding) Rendert Backdrop + innere Modal-Box. Inhalt via {% call %}-Block. id – HTML-ID des Backdrop-Elements (ganzer Modal) max_width – CSS max-width der inneren Box (default: "620px") padding – CSS padding der inneren Box (default: "28px 32px") #} {% macro modal_wrapper(id, max_width="620px", padding="28px 32px") %}