select.html

29 Zeilen · 2,1 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% block title %}QR-Etiketten{% endblock %}
{% block content %}
<div class="page-head"><div><h1>QR-Etiketten</h1><small>Etikett scannen → die passende Seite öffnet sich (Anmeldung nötig)</small></div></div>
{% if not base_configured %}<div class="callout">Die QR-Codes zeigen auf <code>{{ base }}</code>. Wenn die App im Praxisnetz unter einer anderen Adresse erreichbar ist, <code>BASE_URL</code> in der .env setzen, bevor du Etiketten druckst.</div>{% endif %}
<div class="tabs">{% for k, t in TYPES.items() %}<a href="?typ={{ k }}" class="{{ 'active' if k == typ }}">{{ t[1] }}</a>{% endfor %}</div>
<form method="get" action="/etiketten/druck">
  <input type="hidden" name="typ" value="{{ typ }}">
  <div class="panel">
    <div class="filters" style="margin:0">
      <div class="field" style="min-width:300px"><label>Format</label><select name="format">{% for k, f in FORMATS.items() %}<option value="{{ k }}" {{ 'selected' if (typ == 'g' and k == '62x100') or (typ != 'g' and k == '62x29') }}>{{ f.label }}</option>{% endfor %}</select></div>
      <div class="field" style="min-width:90px"><label>Stück je Objekt</label><input type="number" name="n" value="1" min="1" max="50"></div>
      <div class="field" style="min-width:90px"><label>A4: Start bei Nr.</label><input type="number" name="start" value="1" min="1" max="24"></div>
      <button class="primary">Vorschau &amp; Drucken</button>
    </div>
  </div>
  <div class="panel flush table-wrap">
    {% if items %}
    <table>
      <thead><tr><th style="width:36px"><input type="checkbox" onclick="document.querySelectorAll('input[name=id]').forEach(c => c.checked = this.checked)"></th><th>Bezeichnung</th><th>Details</th><th>QR</th></tr></thead>
      <tbody>{% for o, d in items %}
      <tr><td><input type="checkbox" name="id" value="{{ o.id }}"></td><td><b>{{ d.title }}</b></td><td><small>{{ d.lines|join(' · ') }}</small></td>
        <td><span class="qr-mini">{{ qr_for(request, typ, o.id) }}</span></td></tr>
      {% endfor %}</tbody>
    </table>
    {% else %}<div class="empty">Keine Objekte dieser Art.</div>{% endif %}
  </div>
</form>
{% endblock %}