{{ define "content" }}

<div class="container">

  {{template "breadcrumb" toSlice "Docenti" (all "Teacher") (.Data|string) "current"}}
  {{template "show_header" dict "title" (.Data|string) "updatePath" (.Data.ID|update "Teacher") "deletePath" (.Data.ID|delete "Teacher")}}

  <div class="row">
    <div class="col-md-12">

      {{$options := `
      title: "Materie"
      model: "Subject"
      icon: "fa fa-book"
      `}}
      
      {{$noElements := "Nessuna materia associata."}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.Subjects "noElements" $noElements}}
    
    </div>
  </div>
  
  <div class="row">
    <div class="col-md-12">

      {{$options := `
      title: "Classi"
      model: "Class"
      icon: "fa fa-users"
      `}}
      
      {{$noElements := "Nessuna classe associata."}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.Classes "noElements" $noElements}}

    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      {{$options := `
      title: "Studenti"
      model: "Student"
      icon: "fa fa-user"
      `}}
      
      {{$noElements := (printf "Nessuna attività associata. Clicca %s per creare una nuova attività." (create "Activity"|anchor "qui"))|html}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.Students "noElements" $noElements}}
      
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">

      {{$options := `
      title: "Gruppi a cui il docente appartiene"
      model: "Group"
      icon: "fa fa-users"
      `}}
      
      {{$noElements := (printf "Nessun gruppo associato. Clicca %s per associare il docente ad un gruppo." (all "Group"|anchor "qui"))|html}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.Groups "noElements" $noElements}}
      
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      {{$options := `
      model: "Activity"
      icon: "fa fa-business-time"
      `}}

      {{$noElements := (printf "Nessuna attività associata. Clicca %s per creare una nuova attività." (create "Activity"|anchor "qui"))|html}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.Activities "noElements" $noElements "title" (printf "Attività del docente (%dh)" .Data.ActualHours)}}

    </div>
  </div>

  {{if $classes := .Data.CoordinatorClasses}}
  <div class="row">
    <div class="col-md-12">
      
      {{$options := `
      title: "Coordinatore nelle seguenti classi"
      model: "Class"
      icon: "fa fa-users"
      `}}
  
      {{$noElements := "Nessuna classe associata."}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.CoordinatorClasses "noElements" $noElements}}
    </div>
  </div>
  {{end}}

  {{if $classes := .Data.MinuterClasses}}
  <div class="row">
    <div class="col-md-12">
      
      {{$options := `
      title: "Verbalizzante nelle seguenti classi"
      model: "Class"
      icon: "fa fa-users"
      `}}
  
      {{$noElements := "Nessuna classe associata."}}
      {{template "relation_list" dict "options" ($options|yaml) "data" .Data.MinuterClasses "noElements" $noElements}}
    </div>
  </div>
  {{end}}
  
</div>    

{{ end }}
