{{ define "content" }}

<div class="container">  

  {{$options := `
  title: "Docenti"
  buttonTitle: "Crea nuovo docente"
  `}}
  
  {{template "read_all_header" dict  "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "teacher")}}
  {{template "search_input"}}
    
  {{if not .}}
  {{template "display_no_elements"}}
  {{else}}
  <div class="list-group" id="myUL">
    {{range $teacher := .Data}}
    <a class="list-group-item list-group-item-action" href={{$teacher.ID|show "teacher"}}>
      <span class="fa fa-user"></span>
      {{$teacher.Surname}} {{$teacher.Name}}
      <div class="text-right">
        {{$options := `noElements: "no classi"`}}
        {{template "small" dict "options" ($options | yaml) "data" $teacher.Classes}}
        {{$options := `noElements: "no materie"`}}
        {{template "small" dict "options" ($options | yaml) "data" $teacher.Subjects}}
      </div>
    </a>
    {{end}}
    {{end}}
  </div>

</div>

{{ end }}
