{{ define "content" }}

<div class="container">

  <ol class="breadcrumb">
    <li><a href="/teachers?{{query "tpl_layout" "base" "tpl_content" "teachers"}}">Docenti</a></li>
    <li class="active"><a href="#">{{.Data.Name}} {{.Data.Surname}}</a></li>
  </ol>

  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>{{.Data.Name}} {{.Data.Surname}}</h1>
      </div>
      <div class="col-md-4">
	<div class="btn-group pull-right" role="group">
	  <a href="/teachers/{{.Data.ID}}/update?{{query "tpl_layout" "base" "tpl_content" "teachers_add_update" "update" "true"}}" class="btn btn-primary">
	    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
	    Modifica
	  </a>
	  <button href="/teachers/{{.Data.ID}}/delete"
		  data-url="/teachers/{{.Data.ID}}/delete"
		  class="btn btn-danger karmen-ajax-delete">
	    <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
	    Elimina
	  </button>
	</div>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Materie</h2>
      {{if .Data.Subjects}}
      <div class="list-group" id="materie_list_group">
    	{{range $subject := .Data.Subjects}}
    	<a href="/subjects/{{$subject.ID}}?{{query "tpl_layout" "base" "tpl_content" "subjects_show"}}" class="list-group-item clearfix">
    	  <span class="glyphicon glyphicon-book"></span>
    	  {{$subject.Name}}
    	  {{end}}
    	</a>
      </div>
      {{else}}
      <p>Al docente non è associata alcuna attività
    	didattica. Clicca <a href="/activities/add?{{query "tpl_layout" "base" "tpl_content" "activities_add_update"}}">qui</a> per
    	creare una nuova attività didattica da associare al docente.</p>
      {{end}}
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Classi</h2>
      {{if .Data.Classes}}
      <div class="list-group" id="classes_list_group">
	{{range $class := .Data.Classes}}
	<a href="/classes/{{$class.ID}}?{{query "tpl_layout" "base" "tpl_content" "classes_show"}}" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-blackboard"></span>
	  {{$class.Name}}
	  {{end}}
	</a>
      </div>
      {{else}}
      <p>Al docente non è associata alcuna attività
	didattica. Clicca <a href="/activities/add?{{query "tpl_layout" "base" "tpl_content" "activities_add_update"}}">qui</a> per
	creare una nuova attività didattica da associare al docente.</p>
      {{end}}
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Cattedra</h2>
      {{if .Data.Activities}}
      <div class="list-group" id="classes_list_group">
	{{range $activity := .Data.Activities}}
	<a href="/activities/{{$activity.ID}}?{{query "tpl_layout" "base" "tpl_content" "activities_show"}}" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-briefcase"></span>
	  {{$activity.Subject.Name}} {{$activity.Class.Name}} {{$activity.Hours}}h
	  {{end}}
	</a>
      </div>
      
      {{if $classes := .Data.IsCoordinator}}
      <p>Il docente è <strong>coordinatore</strong> nelle seguenti classi</p>
      <div class="list-group" id="coord_classes_list_group">
	{{range $class := $classes}}
	<a href="/classes/{{$class.ID}}?{{query "tpl_layout" "base" "tpl_content" "classes_show"}}" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-blackboard"></span>
	  {{$class.Name}}
	  {{end}}
	</a>
      </div>
      {{end}}

      {{if $classes := .Data.IsMinuter}}
      <p>Il docente è <strong>verbalizzante</strong> nelle seguenti classi</p>
      <div class="list-group" id="coord_classes_list_group">
	{{range $class := $classes}}
	<a href="/classes/{{$class.ID}}?{{query "tpl_layout" "base" "tpl_content" "classes_show"}}" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-blackboard"></span>
	  {{$class.Name}}
	  {{end}}
	</a>
      </div>
      {{end}}

      
      {{else}}
      <p>Al docente non è associata alcuna attività
	didattica. Clicca <a href="/activities/add?{{query "base" "activities_add_update"}}">qui</a> per
	creare una nuova attività didattica da associare al docente.</p>
      {{end}}
    </div>
  </div>


</div>    

{{ end }}
