{{ define "content" }}

<div class="container">

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

  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>{{.Name}}</h1>
      </div>
      <div class="col-md-4">
	<div class="btn-group pull-right" role="group">
	  <a href="/classes/{{.ID}}/update" class="btn btn-primary">
	    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
	    Modifica
	  </a>
	  <button href="/classes/{{.ID}}/delete"
		  data-url="/classes/{{.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 {{.Name}}</h2>
  <div class="list-group" id="classes_list_group">
    {{if not .Teachers}}
    <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 $activity := .Activities}}
      <a href="/activities/{{$activity.ID}}/update" class="list-group-item clearfix">
	<span class="glyphicon glyphicon-user"></span>
	{{$activity.Teacher.Surname}} {{$activity.Teacher.Name}}
	<div class="text-right">
	  <small>{{$activity.Subject.Name}} {{$activity.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 .Teachers}}
    <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 .CoordinatorID}}
    <a href="/teachers/{{.Coordinator.ID}}" class="list-group-item clearfix">
      <span class="glyphicon glyphicon-user"></span>
      {{.Coordinator.Name}} {{.Coordinator.Surname}}
      <div class="text-right">
	<small>Coordinatore</small>
      </div>
    </a>
    {{else}}
    <span class="list-group-item clearfix">Nessun coordinatore</span>
    {{end}}

    {{if .MinuterID}}
    <a href="/teachers/{{.Minuter.ID}}" class="list-group-item clearfix">
      <span class="glyphicon glyphicon-user"></span>
      {{.Minuter.Name}} {{.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 }}
