patients.html
| 1 | {{define "title"}}Patienten{{end}} |
| 2 | {{define "content"}} |
| 3 | <h2>Patienten{{if .Archived}} – Archiv{{end}}</h2> |
| 4 | {{with .Imported}}<p class="ok" role="status">{{.}} Befund(e) importiert.</p>{{end}} |
| 5 | {{with .ImportErrors}}<div class="error" role="alert"><p>Nicht importiert:</p><ul>{{range .}}<li>{{.}}</li>{{end}}</ul></div>{{end}} |
| 6 | |
| 7 | <form method="get" action="/patienten" role="search" class="search"> |
| 8 | <input type="search" name="q" value="{{.Q}}" placeholder="Name oder Geburtsdatum" aria-label="Patient suchen"> |
| 9 | {{if .Archived}}<input type="hidden" name="archiv" value="1">{{end}} |
| 10 | <button type="submit">Suchen</button> |
| 11 | </form> |
| 12 | |
| 13 | {{if .Patients}} |
| 14 | <div class="tablewrap"> |
| 15 | <table class="list"> |
| 16 | <thead><tr><th>Name</th><th>Geburtsdatum</th><th>Befunde</th><th>Behandlungen</th><th>Zuletzt</th></tr></thead> |
| 17 | <tbody> |
| 18 | {{range .Patients}} |
| 19 | <tr><td><a href="/patient/{{.ID}}"><strong>{{.Name}}</strong></a></td><td>{{.Dob}}</td><td>{{.Befunde}}</td><td>{{.Sessions}}</td><td>{{de .LastDate}}</td></tr> |
| 20 | {{end}} |
| 21 | </tbody> |
| 22 | </table> |
| 23 | </div> |
| 24 | {{else}}<p class="muted">Keine Patienten gefunden.</p>{{end}} |
| 25 | <p>{{if .Archived}}<a href="/patienten">← Aktive Patienten</a>{{else}}<a href="/patienten?archiv=1">Archiv anzeigen</a>{{end}}</p> |
| 26 | |
| 27 | <div class="grid"> |
| 28 | <article> |
| 29 | <h3>Neuer Patient</h3> |
| 30 | <form method="post" action="/patienten"> |
| 31 | <input name="name" placeholder="Name" aria-label="Name" required> |
| 32 | <div class="grid"> |
| 33 | <input name="dob" placeholder="Geburtsdatum / Alter" aria-label="Geburtsdatum"> |
| 34 | <input name="phone" placeholder="Telefon (optional)" aria-label="Telefon"> |
| 35 | </div> |
| 36 | <input type="email" name="email" placeholder="E-Mail (optional)" aria-label="E-Mail" autocomplete="off"> |
| 37 | <label class="consent"><input type="checkbox" name="email_consent" value="1"> Einverstanden mit Zusammenfassungen per E-Mail</label> |
| 38 | <button type="submit">Anlegen</button> |
| 39 | </form> |
| 40 | </article> |
| 41 | <article> |
| 42 | <h3>Alte Befunde importieren</h3> |
| 43 | <p class="muted">JSON-Dateien der bisherigen Befundseite (<code>Befund_*.json</code>) oder Exporte von hier. Patienten werden über den Namen zugeordnet oder neu angelegt; der Behandlungsverlauf wird übernommen.</p> |
| 44 | <form method="post" action="/patienten/import" enctype="multipart/form-data"> |
| 45 | <input type="file" name="files" accept="application/json,.json" multiple required aria-label="JSON-Dateien"> |
| 46 | <button type="submit" class="secondary">Importieren</button> |
| 47 | </form> |
| 48 | </article> |
| 49 | </div> |
| 50 | {{end}} |
| 51 |