31 lines
No EOL
1 KiB
HTML
31 lines
No EOL
1 KiB
HTML
{{ template "preamble.html" }}
|
|
<h1>Training Areas</h1>
|
|
<a href="/training-areas/add"><button>Add Training Area</button></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>
|
|
{{template "epilogue.html" }} |