oef/templates/participants.html.tpl

63 lines
1.6 KiB
Smarty
Raw Normal View History

2019-11-14 15:04:11 +01:00
{{ define "content" }}
{{$isAdmin := .Claims|isAdmin}}
{{$isSchool := .Claims|isSchool}}
2019-11-14 15:04:11 +01:00
<div class="container">
{{$options := `
2019-11-15 10:41:32 +01:00
title: "Participanti"
buttonTitle: "Crea nuovo partecipante"
2019-11-14 15:04:11 +01:00
`}}
{{$modelPath := ""}}
{{if lt (len .Data) 2}}
{{$modelPath = (create "Participant")}}
{{end}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" $modelPath}}
{{template "search_input"}}
2019-11-14 15:04:11 +01:00
{{if not .}}
{{template "display_no_elements"}}
{{else}}
2019-11-14 15:04:11 +01:00
<div class="list-group" id="myUL">
{{range $element := .Data}}
<a class="list-group-item list-group-item-action" href={{$element.ID|show "Participant"}}>
<span class="fa fa-user"></span>
{{$element|string}}
{{if $isAdmin}}
<div class="text-right">
{{$options := `noElements: "nessuna gara"`}}
{{template "small" dict "options" ($options | yaml) "data" $element.Contests}}
{{$options := `noElements: "nessuna scuola"`}}
{{template "small" dict "options" ($options | yaml) "data" $element.School}}
</div>
{{else}}
<div class="text-right">
{{$options := `noElements: "nessuna categoria"`}}
{{template "small" dict "options" ($options | yaml) "data" $element.Category}}
</div>
{{end}}
</a>
{{end}}
{{end}}
2019-11-14 15:04:11 +01:00
</div>
{{if eq (len .Data) 2}}
<div class="row">
<div class="col-md-12">
<div class="alert alert-warning mt-4">
<strong>Iscrizione completa.</strong> Non è possibile aggiungere ulteriori partecipanti.
</div>
</div>
</div>
{{end}}
2019-11-14 15:04:11 +01:00
</div>
{{ end }}