setup.html

52 Zeilen · 2,8 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% block title %}Einrichtung{% endblock %}
{% block content %}
<div class="page-head"><div><div class="crumb">Erster Start</div><h1>Willkommen! Welche Praxis wird eingerichtet?</h1></div></div>
<p class="muted" style="max-width:52rem;margin-top:-.4rem">Die Fachrichtung legt passende Startwerte fest: Gerätearten mit Prüfvorlagen,
  Qualifikationen und Berechtigungen, Dokumentarten und Module. Alles lässt sich danach unter <b>Einstellungen</b> ändern und um weitere Vorlagen ergänzen.</p>

<form method="post" action="/einrichtung" id="setup-form">
  <input type="hidden" name="csrf_token" value="{{ csrf }}">
  <div class="profile-grid">
    {% for key, p in profiles.items() %}
    <label class="profile-card">
      <input type="radio" name="profile" value="{{ key }}" required {{ 'checked' if key == current }}
        data-modules='{{ p.modules|tojson }}'>
      <span class="pc-body">
        <b>{{ p.label }}</b>
        <small class="muted">{{ p.hint }}</small>
        <span class="pc-tags">
          {% for m, on in p.modules.items() if on %}<span class="badge">{{ modules_info[m][0] }}</span>{% endfor %}
        </span>
        <small class="pc-detail">{{ p.device_categories|length }} Gerätearten · {{ p.task_templates.values()|map('length')|sum }} Prüfvorlagen · {{ p.qualifications|length }} Nachweisarten</small>
      </span>
    </label>
    {% endfor %}
  </div>

  <div class="grid two" style="margin-top:1.1rem">
    <div class="panel">
      <h2>Module</h2>
      <p class="muted" style="margin-top:-.4rem;font-size:.88rem">Vorbelegt nach Fachrichtung. Übersicht, Geräte &amp; Prüfungen, QM-Dokumente, Personal und QR-Etiketten sind immer dabei.</p>
      {% for m, info in modules_info.items() %}{% set label, desc = info %}
      <label class="check" style="margin:.45rem 0"><input type="checkbox" name="mod_{{ m }}" value="1" data-mod="{{ m }}" checked>
        <span><b>{{ label }}</b><br><small class="muted">{{ desc }}</small></span></label>
      {% endfor %}
    </div>
    <div class="panel">
      <h2>Name der Praxis</h2>
      <div class="field"><input type="text" name="praxis_name" maxlength="80" value="{{ cur_name }}" placeholder="z. B. Hausarztpraxis Dr. Muster"></div>
      <p class="muted" style="font-size:.88rem">Logo und Farben gibt es danach unter Einstellungen → Erscheinungsbild.</p>
      <button class="primary" style="margin-top:.6rem">Praxis einrichten</button>
    </div>
  </div>
</form>
<script>
document.querySelectorAll('#setup-form input[name=profile]').forEach(r => r.addEventListener('change', () => {
  const mods = JSON.parse(r.dataset.modules);
  document.querySelectorAll('#setup-form [data-mod]').forEach(c => { c.checked = !!mods[c.dataset.mod]; });
}));
const sel = document.querySelector('#setup-form input[name=profile]:checked');
if (sel) sel.dispatchEvent(new Event('change'));
</script>
{% endblock %}