{{ define "content" }}

<div class="container">

  <ol class="breadcrumb">
    <li><a href="/classes">Classi</a></li>
    <li class="active"><a href="#">{{.Class.Name}}</a></li>
  </ol>

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

  <h2 class="karmen-relation-header">Docenti della {{.Class.Name}}</h2>
  <div class="list-group" id="classes_list_group">
    {{if not .TeacherActivities}}
    <p>Alla classe non è associata alcuna attività
	didattica. Clicca <a href="/activities/add">qui</a> per creare
	una nuova attività didattica da associare alla classe.</p>
    {{else}}
    {{range $teacher := .TeacherActivities}}
      <a href="/activities/{{$teacher.ActivityID}}/update" class="list-group-item clearfix">
	<span class="glyphicon glyphicon-user"></span>
	{{$teacher.Surname}} {{$teacher.Name}}
	<div class="text-right">
	  <small>{{$teacher.Subject}} {{$teacher.Hours}}h</small>
	</div>
      </a>
    {{end}}
    {{end}}
  </div>

  <h2 class="karmen-relation-header">Coordinatore e verbalizzante</h2>
  <div class="list-group" id="classes_list_group">
    {{if not .TeacherActivities}}
    <p>Alla classe non è associata alcuna attività
	didattica. Clicca <a href="/activities/add">qui</a> per creare
	una nuova attività didattica da associare alla classe.</p>
    {{else}}

    {{if .Class.CoordinatorID}}
    <a href="/teachers/{{.Class.Coordinator.ID}}" class="list-group-item clearfix">
      <span class="glyphicon glyphicon-user"></span>
      {{.Class.Coordinator.Name}} {{.Class.Coordinator.Surname}}
      <div class="text-right">
	<small>Coordinatore</small>
      </div>
    </a>
    {{else}}
    <span class="list-group-item clearfix">Nessun coordinatore</span>
    {{end}}

    {{if .Class.MinuterID}}
    <a href="/teachers/{{.Class.Minuter.ID}}" class="list-group-item clearfix">
      <span class="glyphicon glyphicon-user"></span>
      {{.Class.Minuter.Name}} {{.Class.Minuter.Surname}}
      <div class="text-right">
	<small>Verbalizzante</small>
      </div>
    </a>
    {{else}}
    <span class="list-group-item clearfix">Nessun verbalizzante</span>
    {{end}}
 
    {{end}}
  </div>


</div>    

{{ end }}
