{{ define "content" }}

<div class="container">  

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

</div>

{{ end }}

