types.html

36 Zeilen · 3,2 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% block title %}Qualifikationsarten{% endblock %}
{% macro type_form(t) %}
<form method="post" action="/personal/uebersicht/typen">
  <input type="hidden" name="csrf_token" value="{{ csrf }}">
  <input type="hidden" name="type_id" value="{{ t.id if t else '' }}">
  <div class="form-grid">
    <div class="field full"><label>Bezeichnung *</label><input type="text" name="name" value="{{ t.name if t else '' }}" required></div>
    <div class="field"><label>Gültigkeit (Monate)</label><input type="number" min="1" name="validity_months" value="{{ t.validity_months or '' if t else '' }}"><div class="hint">leer = unbefristet</div></div>
    <div class="field"><label>Vorwarnung (Tage)</label><input type="number" min="0" name="warn_days" value="{{ t.warn_days if t else 60 }}"></div>
    <div class="field full"><label>Beschreibung</label><input type="text" name="description" value="{{ t.description or '' if t else '' }}"></div>
    <div class="field"><label>Vergibt Berechtigung</label>
      {% for p, label in PERMISSIONS.items() %}<label class="check"><input type="checkbox" name="permissions" value="{{ p }}" {{ 'checked' if t and p in t.permission_list }}> {{ label }}</label>{% endfor %}</div>
    <div class="field"><label>Zusätzlich Pflicht für</label>
      {% for p, label in PERMISSIONS.items() %}<label class="check"><input type="checkbox" name="prerequisite_for" value="{{ p }}" {{ 'checked' if t and p in t.prerequisite_list }}> {{ label }}</label>{% endfor %}
      <div class="hint">Ohne gültigen Nachweis wird die Berechtigung gesperrt – z. B. eine jährliche Pflichtunterweisung.</div></div>
    <div class="field full checks">
      <label class="check"><input type="checkbox" name="required_for_all" value="true" {{ 'checked' if t and t.required_for_all }}> Pflicht für alle Mitarbeiter</label>
      <label class="check"><input type="checkbox" name="is_instruction" value="true" {{ 'checked' if t and t.is_instruction }}> Ist eine Unterweisung</label>
      {% if t %}<label class="check"><input type="checkbox" name="active" value="true" {{ 'checked' if t.active }}> Aktiv</label>{% endif %}
    </div>
  </div>
  <div class="form-actions"><button class="primary">Speichern</button></div>
</form>
{% endmacro %}
{% block content %}
<div class="page-head"><div><div class="crumb"><a href="/personal/uebersicht/matrix">Qualifikationen</a></div><h1>Arten von Nachweisen</h1></div></div>
<div class="callout info">Die Vorgaben sind Startwerte. Gültigkeitsdauern und Pflichten bitte an die Vorgaben eurer Kammer bzw. Aufsichtsbehörde und eure Begehungsberichte anpassen.</div>
<details class="box"><summary>Neue Art anlegen</summary><div class="inner">{{ type_form(None) }}</div></details>
{% for t in types %}
<details class="box" {% if not t.active %}style="opacity:.6"{% endif %}>
  <summary>{{ t.name }} <small class="muted">· {{ (t.validity_months ~ ' Monate') if t.validity_months else 'unbefristet' }}{% if t.permission_list %} · vergibt: {{ t.permission_list|perm_labels }}{% endif %}{% if t.prerequisite_list %} · Pflicht für: {{ t.prerequisite_list|perm_labels }}{% endif %}{% if not t.active %} · inaktiv{% endif %}</small></summary>
  <div class="inner">{{ type_form(t) }}</div>
</details>
{% endfor %}
{% endblock %}