{{ define "content" }}

<div class="container">

  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="/classes?{{query "tpl_content" "classes" "tpl_layout" "base"}}">Classi</a></li>
      <li class="breadcrumb-item active"><a href="#">{{.Data.Name}}</a></li>
    </ol>
  </nav>


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

  <h2 class="karmen-relation-header">Attività della {{.Data.Name}}</h2>
  <div class="list-group" id="classes_list_group">
    {{if not .Data.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 := .Data.Activities}}
      <a href="/activities/{{$activity.ID}}?{{query "tpl_layout" "base" "tpl_content" "activities_show"}}" class="list-group-item list-group-item-action">
	<span class="fa fa-user"></span>
	{{if $activity.Teacher}}{{$activity.Teacher.Surname}} {{$activity.Teacher.Name}}{{else}}no docente{{end}}
	<div class="text-right">
	  <small>{{if $activity.Subject}}{{$activity.Subject.Name}}{{else}}no materia{{end}} {{$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 .Data.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 ne .Data.Coordinator.ID 0}}
    <a href="/teachers/{{.Data.Coordinator.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}" class="list-group-item list-group-item-action">
      <span class="fa fa-user"></span>
      {{.Data.Coordinator.Name}} {{.Data.Coordinator.Surname}}
      <div class="text-right">
	<small>Coordinatore</small>
      </div>
    </a>
    {{else}}
    <span class="list-group-item list-group-item-action">Nessun coordinatore</span>
    {{end}}

    {{if ne .Data.Minuter.ID 0}}
    <a href="/teachers/{{.Data.Minuter.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}" class="list-group-item list-group-item-action">
      <span class="fa fa-user"></span>
      {{.Data.Minuter.Name}} {{.Data.Minuter.Surname}}
      <div class="text-right">
	<small>Verbalizzante</small>
      </div>
    </a>
    {{else}}
    <span class="list-group-item list-group-item-action">Nessun verbalizzante</span>
    {{end}}
 
    {{end}}
  </div>


</div>    

{{ end }}
