team.html

71 Zeilen · 4,4 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% block title %}Team-Zeiten{% endblock %}
{% block content %}
<div class="page-head"><div><h1>Team-Zeiten</h1><small>Nur für Personalverantwortliche sichtbar</small></div>
  <div class="actions"><button type="button" onclick="window.print()">Drucken</button></div></div>

<div class="grid two">
  <div class="panel">
    <h2>Jetzt anwesend</h2>
    <ul class="list">
      {% for s in summary %}
      <li><span class="dot {{ ('soon' if s.open.open_break else 'ok') if s.open and s.open.day == today else '' }}"></span>
        <div class="grow"><a href="/zeit?user={{ s.user.id }}"><b>{{ s.user.full_name }}</b></a></div>
        <small>{% if s.open and s.open.day == today %}{{ 'Pause' if s.open.open_break else 'da' }} seit {{ (s.open.open_break.start if s.open.open_break else s.open.start).strftime('%H:%M') }}{% else %}nicht eingestempelt{% endif %}</small></li>
      {% else %}<li class="empty">Niemand mit Zeiterfassung.</li>{% endfor %}
    </ul>
  </div>
  <div class="panel">
    <h2>Zu klären</h2>
    {% if old_open %}
    <ul class="list">{% for e in old_open %}
      <li><span class="dot overdue"></span><div class="grow"><b>{{ e.user.full_name }}</b><div class="sub">{{ e.day|d }} seit {{ e.start.strftime('%H:%M') }} – Gehen fehlt</div></div>
        <a class="btn small" href="/zeit?user={{ e.user_id }}&monat={{ e.day.strftime('%Y-%m') }}">Öffnen</a></li>
    {% endfor %}</ul>
    {% else %}<p class="muted">Keine offenen Einträge aus Vortagen.</p>{% endif %}
  </div>
</div>

<div class="tabs no-print" style="margin-top:1.1rem">
  <a href="?monat={{ prev_m.strftime('%Y-%m') }}">← {{ prev_m.strftime('%m/%Y') }}</a>
  <a class="active" href="?monat={{ first.strftime('%Y-%m') }}">{{ first.strftime('%m/%Y') }}</a>
  <a href="?monat={{ next_m.strftime('%Y-%m') }}">{{ next_m.strftime('%m/%Y') }} →</a>
</div>
<div class="panel flush table-wrap">
  <table>
    <thead><tr><th>Mitarbeiter/in</th><th class="num">Std./Woche</th><th class="num">Ist</th><th class="num">Soll bis heute</th><th class="num">Diff. Monat</th><th class="num">Zeitkonto</th><th>Hinweise</th></tr></thead>
    <tbody>{% for s in summary %}
    <tr><td><a href="/zeit?user={{ s.user.id }}&monat={{ first.strftime('%Y-%m') }}"><b>{{ s.user.full_name }}</b></a></td>
      <td class="num">{{ s.user.weekly_hours|num }}</td>
      <td class="num">{{ s.totals.worked|hm }}</td>
      <td class="num">{{ (s.totals.target - s.totals.credit)|hm }}</td>
      <td class="num {{ 'cell-overdue' if s.totals.diff < 0 else 'cell-ok' }}">{{ s.totals.diff|hm(true) }}</td>
      <td class="num {{ 'cell-overdue' if s.saldo < 0 else 'cell-ok' }}"><b>{{ s.saldo|hm(true) }}</b></td>
      <td>{% if s.totals.warnings %}<span class="badge warn">{{ s.totals.warnings }} Tag(e) mit Hinweis</span>{% endif %}
          {% if s.manual %}<span class="badge">{{ s.manual }}× nachgetragen/korrigiert</span>{% endif %}</td></tr>
    {% endfor %}</tbody>
  </table>
</div>

<div class="grid two no-print">
  <div class="panel">
    <h2>Praxisfreie Tage</h2>
    <p class="muted" style="margin-top:-.4rem">Zusätzlich zu den gesetzlichen Feiertagen, z. B. Heiligabend, Silvester, Brückentage. An diesen Tagen gibt es kein Soll.</p>
    {% if closures %}<ul class="list">{% for c in closures %}
      <li><div class="grow"><b>{{ c.day|d }}</b> · {{ c.name }}</div>
        <form method="post" action="/zeit/schliesstage/{{ c.id }}/loeschen"><input type="hidden" name="csrf_token" value="{{ csrf }}"><button class="small danger">Entfernen</button></form></li>
    {% endfor %}</ul>{% endif %}
    <form method="post" action="/zeit/schliesstage" class="inline-form" style="margin-top:.6rem">
      <input type="hidden" name="csrf_token" value="{{ csrf }}">
      <div class="field"><label>Datum</label><input type="date" name="day" required></div>
      <div class="field" style="flex:1"><label>Bezeichnung</label><input type="text" name="name" placeholder="z. B. Heiligabend"></div>
      <button>Hinzufügen</button>
    </form>
  </div>
  <div class="panel">
    <h2>Feiertage {{ today.year }}</h2>
    {% if not bundesland %}<div class="callout">Kein Bundesland gesetzt – es werden nur bundesweite Feiertage berücksichtigt. <code>BUNDESLAND</code> in der .env eintragen.</div>{% endif %}
    <ul class="list">{% for d, n in holidays %}<li><div class="grow">{{ n }}</div><small>{{ d|d }}</small></li>{% endfor %}</ul>
  </div>
</div>
{% endblock %}