{% extends "base.html" %} {% from "_macros.html" import avatar %} {% block title %}Aktions-Dashboard{% endblock %} {% block heading %}Aktions-Dashboard{% endblock %} {% block topbar_actions %}
Alle Laufend Wartend Fertig
{% endblock %} {% block content %}

Laufend

{{ kpis.running }}

Maschinen aktiv

Pausiert

{{ kpis.paused }}

Setup / Wartung

Wartend

{{ kpis.queued }}

in der Warteschlange

Fertig heute

{{ kpis.done_today }}

Aufträge abgeschlossen

Stück heute

{{ kpis.pieces_today }}

produzierte Teile

+ Neuen Auftrag anlegen

Maschine, Artikel, Stückzahl-Soll

{# Option-F.2: Auto-Vorschläge-Widget #} {% if suggestions %}
{% for s in suggestions %}
{{ s.icon }}
{{ s.title }}
{{ s.body }}
{% if s.action_url %} {{ s.action_label }} {% endif %}
{% endfor %}
{% endif %}

{{ jobs|length }} Aufträge

{% if sort_mode == 'auto' %}🤖 Auto-priorisiert nach Liefertermin + Priorität{% else %}Laufende oben, fertige unten{% endif %}

{# Option-E.1: Sortier-Toggle #}
📅 Standard 🤖 Auto-Priorität
{% if jobs %}
{% for j in jobs %}
{{ j.ident }} {% if j.status == 'running' %} ● Läuft {% elif j.status == 'paused' %} ⏸ Pausiert {% elif j.status == 'queued' %} Wartet {% elif j.status == 'done' %} ✓ Fertig {% else %} Storniert {% endif %} {% if j.machine_name %}{{ j.machine_name }}{% endif %} {% if j.first_name %}· {{ j.first_name }} {{ j.last_name }}{% endif %} {% if j.parent_item_ident %} Sub von {{ j.parent_item_ident }} {% endif %} {% if j.sub_job_count and j.sub_job_count > 0 %} + {{ j.sub_job_count }} Sub-Aufträge {% endif %}
{% if j.item_ident %}
Artikel: {{ j.item_ident }} — {{ j.item_description }}
{% endif %} {% if j.note %}

{{ j.note }}

{% endif %}
{{ j.qty_done }} / {{ j.qty_target }} ({{ j.percent }}%)
{% if j.status in ('running', 'paused', 'queued') %}
{% if j.status == 'queued' %}
{# Mängel-Beseitigung: scheduled-Button #} {% elif j.status == 'scheduled' %}
📅 geplant{% if j.scheduled_for %} {{ j.scheduled_for[:10] }}{% endif %} {% elif j.status == 'running' %}
{% elif j.status == 'paused' %}
{% endif %}
{% else %}
{% if j.finished_at %}Fertig: {{ j.finished_at[:16] }}{% endif %}
{% endif %}
{% endfor %}
{% else %}
Noch keine Aufträge — oben "+ Neuen Auftrag anlegen" aufklappen.
{% endif %}
{% endblock %}