HTML-Seiten modularer aufgebaut und table.html hinzugefügt

This commit is contained in:
2023-10-07 18:32:33 +02:00
parent 8ae3019b9c
commit 15675d5e6c
6 changed files with 115 additions and 72 deletions

39
templates/table.html Normal file
View File

@ -0,0 +1,39 @@
{{ define "row" }}
<tr>
<td>{{ .FirstName }}</td>
<td>{{ .LastName }}</td>
<td>{{ .Date }}</td>
<td>{{ .Time }}</td>
<td>{{ .State }}</td>
<td>{{ .Location }}</td>
{{ range .Participants }}
<td>{{ .FirstName }}</td>
<td>{{ .LastName }}</td>
<td>{{ .Company }}</td>
{{ end }}
</tr>
{{ end }}
{{ define "content" }}
<form>
<label for="search-input">Suche</label>
<input type="text" name="search" id="search-input" />
<button type="submit" hx-post="" hx-target="" hx-swap="">Suchen</button>
</form>
<table>
<tr>
<th colspan="2">Name Unterweiser</th>
<th>Datum</th>
<th>Uhrzeit</th>
<th>Stand</th>
<th>Ort</th>
<th colspan="2">Name Teilnehmer</th>
<th>Firma</th>
</tr>
{{ range . }}
{{ template "row" . }}
{{ end }}
</table>
{{ end }}