list.html

36 Zeilen · 2,6 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% block title %}Temperaturprotokoll{% endblock %}
{% block content %}
<div class="page-head"><div><div class="crumb">{{ now.strftime('%d.%m.%Y') }}</div><h1>Temperaturprotokoll</h1></div>
  {% if is_leitung %}<div class="actions"><a class="btn" href="/geraete/neu?art=Kühlschrank%20(Impfstoffe/Medikamente)">+ Messstelle</a></div>{% endif %}</div>

{% if not temp_points %}
<div class="panel"><div class="empty">
  Noch keine Messstelle. Eine Messstelle ist ein Gerät mit Sollbereich, z. B. der Impfstoff-Kühlschrank mit +2 bis +8 °C.
  {% if is_leitung %}<br><a class="btn primary" style="margin-top:.8rem" href="/geraete/neu?art=Kühlschrank%20(Impfstoffe/Medikamente)">Kühlschrank anlegen</a>
  <br><small class="muted">Bei vorhandenen Geräten: Gerät bearbeiten → „Temperaturüberwachung“ ausfüllen.</small>{% endif %}
</div></div>
{% endif %}

<div class="grid two">
{% for p in temp_points %}{% set r = temp_last.get(p.id) %}
  <div class="panel temp-card {{ 'bad' if p.id in temp_bad_ids }}">
    <div class="panel-head"><h2><a href="/temperatur/{{ p.id }}">{{ p.name }}</a></h2>
      <div class="actions">{% if p.id in temp_bad_ids %}<span class="badge bad">zuletzt außerhalb</span>{% elif p.id in temp_missing_ids %}<span class="badge warn">heute offen</span>{% elif r %}<span class="badge ok">ok</span>{% endif %}</div></div>
    <div class="sub muted" style="margin:-.5rem 0 .6rem">{{ p.location or '' }}{{ ' · ' if p.location }}Soll {{ p.temp_min|num }} bis {{ p.temp_max|num }} °C</div>
    {% if today_rows.get(p.id) %}
    <ul class="list compact">
      {% for t in today_rows[p.id] %}
      <li><span class="dot {{ 'ok' if t.in_range else 'overdue' }}"></span>
        <div class="grow"><b>{{ t.current|num }} °C</b>{% if t.min_value is not none or t.max_value is not none %} <small class="muted">(min {{ t.min_value|num if t.min_value is not none else '–' }} / max {{ t.max_value|num if t.max_value is not none else '–' }})</small>{% endif %}
          <div class="sub">{{ t.ts.strftime('%H:%M') }} · {{ t.user.full_name if t.user else '–' }}{% if t.action %} · Maßnahme: {{ t.action }}{% endif %}{% if t.note %} · {{ t.note }}{% endif %}</div></div></li>
      {% endfor %}
    </ul>
    {% elif r %}<p class="muted" style="margin:.2rem 0 .6rem">Zuletzt {{ r.current|num }} °C am {{ r.ts.strftime('%d.%m. %H:%M') }}</p>{% endif %}
    {% set back = '/temperatur' %}{% include 'temperatur/_form.html' %}
    <div style="margin-top:.5rem"><a class="btn small" href="/temperatur/{{ p.id }}">Monatsprotokoll</a></div>
  </div>
{% endfor %}
</div>
<script src="/static/temperatur.js" defer></script>
{% endblock %}