{# core/ui/templates/partials/list_wrapper_inner.html Generisches Listen-Template für runnable CRUD-Module. Status-Polling via HTMX OOB-Swaps (partials/status_oob.html). Variablen: cfg – dict {item_id: item_dict} aus load_config/storage module – Modulname (str) container_id – ID des Listen-Containers (z.B. "mod-borg") loading_id – ID des Lade-Indikators content_template – Pfad zum modul-spezifischen Inhalt-Partial running – dict der laufenden Jobs {key: mode} light_mode – bool (optionaler schreibgeschützter Modus) has_toggle – bool (default True) Toggle-Schalter in Card-Header und Ctx-Menu has_create – bool (default True) Neu-Button im Page-Header has_edit – bool (default True) Bearbeiten-Button im Ctx-Menu has_delete – bool (default True) Löschen-Button im Ctx-Menu Tabellen-Struktur (immer gleich): col-name | [modul-spezifische Spalten] | col-last-run (130px) | col-status (60px) | col-actions (38px) Deklarativ (wenn module_obj(module).ui_content gesetzt): Spalten-Header und -Zellen werden aus ui_content.columns gerendert statt aus list_header.html / list_row.html includes. #} {% import 'partials/components/ui_macros.html' as ui %} {# ── Deklarative Spalten aus ui_content oder _col_obj (ContentColumns-Sub-Tabelle) ── #} {# _col_obj wird von content_columns.html via {% with %} gesetzt #} {%- if _col_obj is defined and _col_obj -%} {%- set _ui_content = _col_obj -%} {%- else -%} {%- set _mod_obj = (module_obj(module) if module_obj is defined else none) -%} {%- set _ui_content = _mod_obj.ui_content if _mod_obj else none -%} {%- endif -%} {%- set _ui_cols = _ui_content.columns if (_ui_content and _ui_content.type == 'table') else [] -%} {%- set _item_url_prefix = (_col_obj.item_url_prefix if (_col_obj is defined and _col_obj) else '') -%} {# Überschreibe has_run_buttons / has_edit / has_delete aus ui_content wenn gesetzt #} {%- if _ui_content -%} {%- set has_run_buttons = _ui_content.has_run_buttons -%} {%- set has_status = _ui_content.has_status -%} {%- set has_edit = _ui_content.has_edit -%} {%- set has_delete = _ui_content.has_delete -%} {%- set has_toggle = _ui_content.has_toggle -%} {%- endif -%} {% if running %} {% endif %} {# ── Tabellen-Ansicht ─────────────────────────────────────────────────────── #}
{% if cfg %} {%- set _col_card_actions = (_col_obj.card_actions if (_col_obj is defined and _col_obj and _col_obj.card_actions) else []) -%} {%- set _card_actions = (_col_card_actions if _col_card_actions else module_card_actions(module)) -%} {% set _name_fixed = {'rsync': false} %} {% if _ui_cols %} {% for col in _ui_cols %}{{ ui.col_header(col) }}{% endfor %} {% else %} {% include module + '/partials/list_header.html' ignore missing %} {% endif %} {% if has_run_buttons | default(True) %} {% endif %} {% if has_status | default(True) %}{% endif %} {% for name, item in cfg.items() %} {% set item_name = name %} {% set item_data = item %} {% set is_running = (module ~ ":" ~ item_name) in (running or {}) %} {% if _ui_cols %} {% for col in _ui_cols %}{{ ui.col_cell(col, item_name, item_data) }}{% endfor %} {% else %} {% include module + '/partials/list_row.html' ignore missing %} {% endif %} {% if has_run_buttons | default(True) %} {% endif %} {% if has_status | default(True) %} {% set _status = 'running' if is_running else (last_run_status(module, item_name) or item_data.last_status) %} {% endif %} {% endfor %}
NameLetzter LaufStatus
{{ item_data.description or item_data.job or item_data.host or item_name }} {{ item_data.last_run or '—' }}{{ ui.status_inline(_status) }}
{% for action in _card_actions %}{{ ui.card_action_button(action, item_name, item_data, container_id, loading_id) }}{% endfor %} {% if extra_actions_template %}{% include extra_actions_template ignore missing %}{% endif %} {% if has_edit | default(True) %} {{ ui.edit_button(module=module, item=item_name, container_id=container_id, loading_id=loading_id, item_prefix=_item_url_prefix) }} {% endif %} {% if has_delete | default(True) %} {{ ui.delete_button(module=module, item=item_name, container_id=container_id, loading_id=loading_id, description=item_data.description or item_data.job or item_data.host or item_name, item_prefix=_item_url_prefix) }} {% endif %}
{% else %}
Keine Einträge vorhanden
Erstelle den ersten Eintrag mit „Neu"
{% endif %}
{# /content-items--table #} {% if pagination and pagination.total_pages > 1 %} {% endif %}