{{ define "content" }} {{$isAdmin := .Claims|isAdmin}} {{$isSchool := .Claims|isSchool}}
{{$options := ` title: "Participanti" buttonTitle: "Iscrivi un nuovo partecipante" `}} {{$modelPath := ""}} {{if $isAdmin}} {{$modelPath = (create "Participant")}} {{end}} {{if $isSchool}} {{if lt (len .Data) 2}} {{$modelPath = (create "Participant")}} {{end}} {{end}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" $modelPath}} {{template "search_input" .Data}} {{if not .}} {{template "display_no_elements"}} {{else}}
{{range $element := .Data}} {{$element|string}} {{if $isAdmin}}
{{$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}}
{{else}}
{{$options := `noElements: "nessuna categoria"`}} {{template "small" dict "options" ($options | yaml) "data" $element.Category}}
{{end}}
{{end}} {{end}}
{{if $isSchool}}

Suggerimenti

{{if le (len .Data) 1}}

E' possibile iscrivere fino a due partecipanti alla gara (di diversa categoria). Iscrivi un nuovo partecipante

{{end}} {{if eq (len .Data) 2}}
Iscrizione completa. Non รจ possibile aggiungere ulteriori partecipanti.
{{end}}
{{end}}
{{ end }}