tasks.html

46 Zeilen · 2,1 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% from 'macros.html' import due with context %}
{% block title %}Prüfungen & Wartung{% endblock %}
{% block content %}
<div class="page-head"><h1>Prüfungen &amp; Wartung</h1>
  <div class="actions"><button type="button" onclick="window.print()">Drucken</button></div></div>
<div class="tabs no-print">
  <a href="?f=faellig" class="{{ 'active' if filt == 'faellig' }}">Fällig &amp; bald fällig</a>
  <a href="?f=meine" class="{{ 'active' if filt == 'meine' }}">Meine</a>
  <a href="?f=alle" class="{{ 'active' if filt == 'alle' }}">Alle</a>
</div>
<div class="panel flush table-wrap">
  {% if tasks %}
  <table>
    <thead><tr><th>Fällig</th><th>Prüfung</th><th>Gerät</th><th>Intervall</th><th>Verantwortlich</th><th class="no-print"></th></tr></thead>
    <tbody>
    {% for t in tasks %}
    <tr>
      <td>{{ due(t.next_due, t.warn_days) }}</td>
      <td><a href="/pruefungen/{{ t.id }}"><b>{{ t.title }}</b></a>{% if t.external %} <span class="badge">extern</span>{% endif %}</td>
      <td>{% if t.device %}<a href="/geraete/{{ t.device.id }}">{{ t.device.name }}</a>{% else %}<small class="muted">allgemein</small>{% endif %}</td>
      <td>{{ t.interval_label }}</td>
      <td>{{ t.responsible.full_name if t.responsible else '–' }}</td>
      <td class="no-print"><a class="btn small" href="/pruefungen/{{ t.id }}">Erledigen</a></td>
    </tr>
    {% endfor %}
    </tbody>
  </table>
  {% else %}<div class="empty">{{ 'Nichts fällig 🎉' if filt == 'faellig' else 'Keine Einträge.' }}</div>{% endif %}
</div>

{% if is_leitung %}
<details class="box no-print">
  <summary>Neue Prüfung / Routine anlegen</summary>
  <div class="inner">
    <p class="muted">Auch ohne Gerät möglich – z. B. DGUV V3 aller ortsveränderlichen Geräte, Notfallkoffer, Wasserproben, Hygieneplan-Aufgaben.</p>
    <form method="post" action="/pruefungen/neu">
      <input type="hidden" name="csrf_token" value="{{ csrf }}">
      {% set t = None %}{% set preset_device = None %}
      {% include 'geraete/_task_form.html' %}
      <div class="form-actions"><button class="primary">Anlegen</button></div>
    </form>
  </div>
</details>
{% endif %}
{% endblock %}