entry.html
| 1 | {{define "title"}}{{.E.Title}}{{end}} |
| 2 | {{define "content"}} |
| 3 | {{$e := .E}} |
| 4 | <article> |
| 5 | <header> |
| 6 | <span class="kind kind-{{$e.Kind}}">{{kindLabel $e.Kind}}</span>{{with $e.Region}} <a class="region" href="/?region={{.}}">{{.}}</a>{{end}} |
| 7 | <h1>{{$e.Title}}</h1> |
| 8 | {{with $e.Summary}}<p class="lead">{{.}}</p>{{end}} |
| 9 | {{with tags $e.Tags}}<p class="tags">{{range .}}<a href="/?q={{.}}">#{{.}}</a> {{end}}</p>{{end}} |
| 10 | <div class="actions"> |
| 11 | <a role="button" class="outline" href="/eintrag/{{$e.ID}}/bearbeiten">Bearbeiten</a> |
| 12 | </div> |
| 13 | </header> |
| 14 | |
| 15 | {{if eq $e.Kind "uebung"}} |
| 16 | {{with $e.Dosage}}<p class="dosage"><strong>Dosierung:</strong> {{.}}</p>{{end}} |
| 17 | {{end}} |
| 18 | |
| 19 | {{with $e.Body}}<section class="prose">{{md .}}</section>{{end}} |
| 20 | |
| 21 | {{if eq $e.Kind "uebung"}}{{with $e.PatientText}} |
| 22 | <section class="patient"> |
| 23 | <h3>Anleitung für Patienten <small class="muted">(erscheint im Handout)</small></h3> |
| 24 | <div class="prose">{{md .}}</div> |
| 25 | </section> |
| 26 | {{end}}{{end}} |
| 27 | |
| 28 | <footer class="muted">Angelegt {{date $e.Created}} · geändert {{date $e.Updated}}</footer> |
| 29 | </article> |
| 30 | |
| 31 | {{if eq $e.Kind "uebung"}} |
| 32 | <article id="handout"> |
| 33 | <h3>Zu Handout hinzufügen</h3> |
| 34 | {{if .Added}}<p class="ok">Hinzugefügt. <a href="/handout/{{.Added}}">Zum Handout →</a></p>{{end}} |
| 35 | <div class="grid"> |
| 36 | {{if .Handouts}} |
| 37 | <form method="post" action="/handouts/uebung" class="row"> |
| 38 | <select name="handout" aria-label="Handout" required> |
| 39 | {{range .Handouts}}<option value="{{.ID}}">{{.Title}}{{with .Recipient}} – {{.}}{{end}} ({{.Count}})</option>{{end}} |
| 40 | </select> |
| 41 | <input type="hidden" name="entry" value="{{$e.ID}}"> |
| 42 | <input type="hidden" name="from" value="entry"> |
| 43 | <button type="submit">Hinzufügen</button> |
| 44 | </form> |
| 45 | {{end}} |
| 46 | <form method="post" action="/handouts" class="row"> |
| 47 | <input name="title" placeholder="Neues Handout, z. B. Knie Woche 1" aria-label="Titel"> |
| 48 | <input type="hidden" name="entry" value="{{$e.ID}}"> |
| 49 | <button type="submit" class="secondary">Neues Handout</button> |
| 50 | </form> |
| 51 | </div> |
| 52 | </article> |
| 53 | {{end}} |
| 54 | |
| 55 | <article id="verknuepft"> |
| 56 | <h3>Verknüpft</h3> |
| 57 | {{range .Groups}} |
| 58 | <h4>{{.Label}}</h4> |
| 59 | <ul class="links"> |
| 60 | {{range .Entries}} |
| 61 | <li> |
| 62 | <a href="/eintrag/{{.ID}}">{{.Title}}</a>{{with .Summary}} <small class="muted">– {{.}}</small>{{end}} |
| 63 | <form method="post" action="/eintrag/{{$e.ID}}/entknuepfen/{{.ID}}" class="inline"><button type="submit" class="link" title="Verknüpfung lösen">✕</button></form> |
| 64 | </li> |
| 65 | {{end}} |
| 66 | </ul> |
| 67 | {{else}} |
| 68 | <p class="muted">Noch nichts verknüpft.</p> |
| 69 | {{end}} |
| 70 | {{if .Linkable}} |
| 71 | <form method="post" action="/eintrag/{{$e.ID}}/verknuepfen" class="row"> |
| 72 | <select name="other" aria-label="Eintrag verknüpfen" required> |
| 73 | <option value="">Vorhandenen Eintrag verknüpfen …</option> |
| 74 | {{range .Linkable}}<option value="{{.ID}}">{{kindLabel .Kind}}: {{.Title}}</option>{{end}} |
| 75 | </select> |
| 76 | <button type="submit">Verknüpfen</button> |
| 77 | </form> |
| 78 | {{end}} |
| 79 | <p class="new-linked">Neu anlegen und verknüpfen: |
| 80 | {{range .Kinds}}<a href="/eintrag/neu?art={{.Key}}&von={{$e.ID}}&region={{$e.Region}}">{{.Label}}</a> {{end}} |
| 81 | </p> |
| 82 | </article> |
| 83 | |
| 84 | <article id="medien"> |
| 85 | <h3>Bilder, Videos, PDFs</h3> |
| 86 | {{if .Media}} |
| 87 | <div class="media"> |
| 88 | {{range .Media}} |
| 89 | <figure> |
| 90 | {{if isImage .Filename}}<a href="/medien/{{.Filename}}"><img src="/medien/{{.Filename}}" alt="{{.Caption}}" loading="lazy"></a> |
| 91 | {{else if isVideo .Filename}}<video src="/medien/{{.Filename}}" controls preload="metadata"></video> |
| 92 | {{else}}<a href="/medien/{{.Filename}}" class="file">📄 PDF öffnen</a>{{end}} |
| 93 | <figcaption>{{.Caption}} |
| 94 | <form method="post" action="/medium/{{.ID}}/loeschen" class="inline"><button type="submit" class="link" title="Löschen">✕</button></form> |
| 95 | </figcaption> |
| 96 | </figure> |
| 97 | {{end}} |
| 98 | </div> |
| 99 | {{end}} |
| 100 | <form method="post" action="/eintrag/{{$e.ID}}/medien" enctype="multipart/form-data" class="row"> |
| 101 | <input type="file" name="files" accept="image/*,video/*,application/pdf" multiple required aria-label="Dateien"> |
| 102 | <input name="caption" placeholder="Beschriftung (optional)" aria-label="Beschriftung"> |
| 103 | <button type="submit">Hochladen</button> |
| 104 | </form> |
| 105 | <small class="muted">Auf Tablet/Handy kann direkt die Kamera benutzt werden. Erstes Bild erscheint im Handout.</small> |
| 106 | </article> |
| 107 | |
| 108 | <article id="quellen"> |
| 109 | <h3>Quellen</h3> |
| 110 | {{if .Sources}} |
| 111 | <ul> |
| 112 | {{range .Sources}} |
| 113 | <li> |
| 114 | {{if .URL}}<a href="{{.URL}}" rel="noopener noreferrer" target="_blank">{{.Ref}}</a>{{else}}{{.Ref}}{{end}}{{with .Page}}, {{.}}{{end}}{{with .Note}} <small class="muted">– {{.}}</small>{{end}} |
| 115 | <form method="post" action="/quelle/{{.ID}}/loeschen" class="inline"><button type="submit" class="link" title="Löschen">✕</button></form> |
| 116 | </li> |
| 117 | {{end}} |
| 118 | </ul> |
| 119 | {{end}} |
| 120 | <form method="post" action="/eintrag/{{$e.ID}}/quelle"> |
| 121 | <div class="grid"> |
| 122 | <input name="ref" placeholder="Buch / Artikel / Studie" aria-label="Quelle" required> |
| 123 | <input name="page" placeholder="Seite / Kapitel" aria-label="Seite"> |
| 124 | </div> |
| 125 | <div class="grid"> |
| 126 | <input name="url" placeholder="Link (optional, z. B. Calibre oder DOI)" aria-label="Link"> |
| 127 | <input name="note" placeholder="Notiz (optional)" aria-label="Notiz"> |
| 128 | </div> |
| 129 | <button type="submit" class="secondary">Quelle hinzufügen</button> |
| 130 | </form> |
| 131 | </article> |
| 132 | |
| 133 | <details class="danger"> |
| 134 | <summary>Eintrag löschen …</summary> |
| 135 | <form method="post" action="/eintrag/{{$e.ID}}/loeschen"> |
| 136 | <p>„{{$e.Title}}“ mit allen Medien, Quellen und Verknüpfungen endgültig löschen?</p> |
| 137 | <button type="submit" class="danger">Endgültig löschen</button> |
| 138 | </form> |
| 139 | </details> |
| 140 | {{end}} |
| 141 |