Kleine Bugfixes und Aufräumarbeiten

This commit is contained in:
2023-10-28 10:52:06 +02:00
parent 34ef95ad76
commit 33cbf4b215
11 changed files with 165 additions and 128 deletions

View File

@ -1,21 +1,21 @@
{{ define "add-buttons" }}
{{define "add-buttons"}}
<div id="briefing-buttons">
<button type="button" hx-post="/new-participant/{{ .SessionID }}/" hx-target="#briefing-buttons" hx-swap="outerHTML">
<button type="button" hx-post="/new-participant/{{.SessionID}}/" hx-target="#briefing-buttons" hx-swap="outerHTML">
Neuer Teilnehmer
</button>
<button type="submit" hx-post="/submit-form/{{ .SessionID }}/" hx-target="#content" hx-swap="innerHTML">
<button type="submit" hx-post="/submit-form/{{.SessionID}}/" hx-target="#content" hx-swap="innerHTML">
Fertig
</button>
</div>
{{ end }}
{{end}}
{{ define "new" }}
{{ template "add-buttons" . }}
<p>{{ .Login }}</p>
{{ end }}
{{define "new"}}
{{template "add-buttons" .}}
<p>{{.Login}}</p>
{{end}}
{{ define "content" }}
{{define "content"}}
<form>
<div>
<label for="location">Ort</label>
@ -32,6 +32,6 @@
<input id="as-of" name="as-of" required type="date" />
</div>
{{ template "add-buttons" . }}
{{template "add-buttons" .}}
</form>
{{ end }}
{{end}}

View File

@ -12,7 +12,7 @@
<h1>Sicherheitsunterweisung</h1>
<div id="content">
{{ template "content" . }}
{{template "content" .}}
</div>
<script src="/static/js/htmx.min.js" type="text/javascript"></script>

View File

@ -1,4 +1,4 @@
{{ define "content" }}
{{define "content"}}
<h2>Anmeldung</h2>
<form>
@ -14,4 +14,4 @@
</button>
</div>
</form>
{{ end }}
{{end}}

View File

@ -1,16 +1,16 @@
{{ define "content" }}
{{define "content"}}
<form>
<label for="first-{{ .Login }}">Vorname</label>
<input type="text" name="first-{{ .Login }}" id="first-{{ .Login }}" />
<label for="first-{{.Login}}">Vorname</label>
<input type="text" name="first-{{.Login}}" id="first-{{.Login}}" />
<label for="last-{{ .Login }}">Nachname</label>
<input type="text" name="last-{{ .Login }}" id="last-{{ .Login }}" />
<label for="last-{{.Login}}">Nachname</label>
<input type="text" name="last-{{.Login}}" id="last-{{.Login}}" />
<label for="company-{{ .Login }}">Firma</label>
<input type="text" name="company-{{ .Login }}" id="company-{{ .Login }}" />
<label for="company-{{.Login}}">Firma</label>
<input type="text" name="company-{{.Login}}" id="company-{{.Login}}" />
<button type="button" hx-post="/submit-participant/{{ .SessionID }}/{{ .Login }}/" hx-target="#content">
<button type="button" hx-post="/submit-participant/{{.SessionID}}/{{.Login}}/" hx-target="#content">
Fertig
</button>
</form>
{{ end }}
{{end}}

View File

@ -1,29 +1,28 @@
{{ define "rows" }}
{{ range . }}
{{define "rows"}}
{{range .OTD}}
<tr>
<td>{{ .InstructorFirstName }}</td>
<td>{{ .InstructorLastName }}</td>
<td>{{ .BriefingDate }}</td>
<td>{{ .BriefingTime }}</td>
<td>{{ .BriefingLocation }}</td>
<td>{{ .BriefingDocumentName }}</td>
<td>{{ .BriefingAsOf }}</td>
<td>{{ .ParticipantFirstName }}</td>
<td>{{ .ParticipantLastName }}</td>
<td>{{ .ParticipantCompany }}</td>
<td>{{.InstructorFirstName}}</td>
<td>{{.InstructorLastName}}</td>
<td>{{.BriefingDate}}</td>
<td>{{.BriefingTime}}</td>
<td>{{.BriefingLocation}}</td>
<td>{{.BriefingDocumentName}}</td>
<td>{{.BriefingAsOf}}</td>
<td>{{.ParticipantFirstName}}</td>
<td>{{.ParticipantLastName}}</td>
<td>{{.ParticipantCompany}}</td>
</tr>
{{ end }}
{{ end }}
{{end}}
{{end}}
{{ define "content" }}
{{define "content"}}
<form>
<label for="search-input">Suche</label>
<input type="text" name="search" id="search-input" hx-post="/search/" hx-target="#results" hx-swap="innerHTML"
hx-trigger="keyup changed delay:200ms" />
<input type="text" name="search" id="search-input" hx-post="/search/" hx-target="#results">
</form>
<form>
<button type="submit" hx-post="/new-briefing/" hx-target="#content" hx-swap="innerHTML">
<button type="submit" hx-post="/new-briefing/{{.SessionID}}" hx-target="#content">
Neue Unterweisung
</button>
</form>
@ -43,7 +42,7 @@
</thead>
<tbody id="results">
{{ template "rows" . }}
{{template "rows" .}}
</tbody>
</table>
{{ end }}
{{end}}