{{ define "content" }}

<div class="container">  

  {{$options := `
  title: "Materie"
  buttonTitle: "Crea nuova materia"
  `}}
  
  {{template "read_all_header" dict  "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "subject")}}
  {{template "search_input"}}
    
  {{if not .}}
  {{template "display_no_elements"}}
  {{else}}
  <div class="list-group" id="myUL">
    {{range $subject := .Data}}
    <a class="list-group-item list-group-item-action" href={{$subject.ID|show "subject"}}>
      <span class="fa fa-user"></span>
      {{$subject.Name}}
      <div class="text-right">
        {{$options := `noElements: "no docenti"`}}
        {{template "small" dict "options" ($options | yaml) "data" $subject.Teachers}}
      </div>
    </a>
    {{end}}
    {{end}}
  </div>

</div>

{{ end }}

