training-management-system/templates/training_area_list.html
2025-02-14 16:08:48 +01:00

41 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
{{template "head.html" .}} <!-- Include header template -->
<body>
{{template "header.html" .}}
<h1>Training Areas</h1>
<a href="/training-areas/add">Add Training Area</a>
<table>
<thead>
<tr>
<th>Training Area</th>
{{range $.Trainers}}
<th>{{.Name}}</th>
{{end}}
</tr>
</thead>
<tbody>
{{range $i, $currentArea := .Areas}}
<tr>
<td>{{.Name}}</td>
{{range $.Trainers}}
<td>
<form action="/training-areas/assign-trainer" method="post" style="display:inline;">
<input type="hidden" name="training_area_id" value="{{$currentArea.ID}}">
<input type="hidden" name="trainer_id" value="{{.ID}}">
<input type="checkbox" name="assigned" value="true" {{if $currentArea.IsTrainerAssigned .ID}}checked{{end}} onchange="this.form.submit()">
</form>
</td>
{{end}}
</tr>
{{end}}
</tbody>
</table>
<a href="/">Back to Home</a>
</body>
</html>