{{ define "content" }}

<div class="container">

  <ol class="breadcrumb">
    <li><a href="/teachers">Docenti</a></li>
    <li class="active"><a href="#">{{.Name}} {{.Surname}}</a></li>
  </ol>

  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>{{.Name}} {{.Surname}}</h1>
      </div>
      <div class="col-md-4">
	<div class="btn-group pull-right" role="group">
	  <a href="/teachers/{{.ID}}/update" class="btn btn-primary">
	    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
	    Modifica
	  </a>
	  <button href="/teachers/{{.ID}}/delete"
		  data-url="/teachers/{{.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 .Subjects}}
      <div class="list-group" id="materie_list_group">
    	{{range $subject := .Subjects}}
    	<a href="/subjects/{{$subject.ID}}" 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">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 .Classes}}
      <div class="list-group" id="classes_list_group">
	{{range $class := .Classes}}
	<a href="/classes/{{$class.ID}}" 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">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 .Activities}}
      <div class="list-group" id="classes_list_group">
	{{range $activity := .Activities}}
	<a href="/activities/{{$activity.ID}}/update" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-briefcase"></span>
	  {{$activity.Name}}
	  {{end}}
	</a>
      </div>
      
      {{if $classes := $.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}}" class="list-group-item clearfix">
	  <span class="glyphicon glyphicon-blackboard"></span>
	  {{$class.Name}}
	  {{end}}
	</a>
      </div>
      {{end}}

      {{if $classes := $.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}}" 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">qui</a> per
	creare una nuova attività didattica da associare al docente.</p>
      {{end}}
    </div>
  </div>


</div>    

{{ end }}
