{# core/ui/templates/partials/mobile_cards_generic.html Generisches Mobile-Karten-Template – Fallback für list_wrapper_inner.html. Wird automatisch verwendet wenn {module}/partials/mobile_cards.html fehlt. Verfügbare Variablen (aus list_wrapper_inner.html geerbt): cfg – dict {item_id: item_dict} module – Modulname container_id – ID des Listen-Containers loading_id – ID des Lade-Indikators _ui_cols – deklarative Spalten (Col-Instanzen) oder [] _card_actions – Aktions-Buttons (aus modul.yaml card_actions) _item_url_prefix – URL-Präfix für Item-Links has_status – bool has_run_buttons – bool has_edit – bool has_delete – bool running – dict laufender Jobs Konvention für modulspezifische Karten: Lege {module}/partials/mobile_cards.html an. Dieses Template hat Zugriff auf dieselben Variablen und wird bevorzugt geladen. #} {% import 'partials/components/ui_macros.html' as ui %} {# Ghost-Aktions-Buttons (z.B. "Auf Updates prüfen") vor den Karten #} {%- set _ui_header = (module_obj(module) if module_obj is defined else none) %} {%- set _ui_header = _ui_header.ui_header if _ui_header else none %} {% if _ui_header and _ui_header.controls %} {%- set _ghost_ctrls = _ui_header.controls | selectattr('style', 'equalto', 'ghost') | list -%} {% if _ghost_ctrls %}
{% for ctrl in _ghost_ctrls %}{{ ui.header_control(ctrl, module, container_id, loading_id | default('')) }}{% endfor %}
{% endif %} {% endif %} {% if cfg %} {% for item_name, item_data in cfg.items() %} {%- set is_running = (module ~ ":" ~ item_name) in (running or {}) -%} {%- set _status = 'running' if is_running else (last_run_status(module, item_name) if last_run_status is defined else none) or item_data.get('last_status') -%} {%- set _title = item_data.get('description') or item_data.get('job') or item_data.get('host') or item_name -%}
{{ _title }} {% if has_status | default(True) %}{{ ui.status_inline(_status) }}{% endif %}
{% if _ui_cols or (has_run_buttons | default(True) and item_data.get('last_run')) %}
{% if has_run_buttons | default(True) and item_data.get('last_run') %}
{{ (_ui_content.last_run_label if _ui_content else none) or 'Letzter Lauf' }} {{ ui.last_run_cell(item_data.get('last_run')) }}
{% endif %} {% for col in _ui_cols %} {%- set _val = item_data.get(col.key) -%} {% if _val %}
{{ col.label }} {%- if col.type == 'status' -%}{{ ui.status_inline(_val) }} {%- elif col.type == 'badge_enum' and col.enum -%}{%- set _e = col.enum.get(_val) -%}{{ _e.label if _e else _val }} {%- elif col.type == 'version_badge' -%}{{ _val }} {%- else -%}{{ _val }}{%- endif -%}
{% endif %} {% endfor %}
{% endif %}
{% endfor %} {% else %}
Keine Einträge vorhanden
Erstelle den ersten Eintrag mit „Neu"
{% endif %}