{{ define "content" }}

<div class="container">

  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="/activities?{{query "tpl_layout" "base" "tpl_content" "activities"}}">Attività</a></li>
      <li class="breadcrumb-item active"><a href="#">{{if .Data.Subject}}{{.Data.Subject.Name}}{{else}}no materia{{end}} {{if .Data.Class}}{{.Data.Class.Name}}{{else}}no classe{{end}} {{.Data.Hours}}h</a></li>
    </ol>
  </nav>
  
  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>{{if .Data.Subject}}{{.Data.Subject.Name}}{{else}}no materia{{end}} {{if .Data.Class}}{{.Data.Class.Name}}{{else}}no classe{{end}} {{.Data.Hours}}h</h1>
      </div>
      <div class="col-md-4">

	<div class="btn-group float-right" role="group">
	  <a href="/activities/add/?{{query "tpl_layout" "base" "tpl_content" "activities_add_update"}}" class="btn btn-success">
	    <span class="fa fa-plus-circle" aria-hidden="true"></span>
	    Crea
	  </a>

	  <a href="/activities/{{.Data.ID}}/update?{{query "tpl_layout" "base" "tpl_content" "activities_add_update" "update" "true"}}" class="btn btn-primary">
	    <span class="fa fa-edit" aria-hidden="true"></span>
	    Modifica
	  </a>
	  <button href="/activities/{{.Data.ID}}/delete"
		  data-url="/activities/{{.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>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Materia</h2>
      {{if .Data.Subject}}
      <div class="list-group" id="materie_list_group">
    	<a href="/subjects/{{.Data.Subject.ID}}?{{query "tpl_layout" "base" "tpl_content" "subjects_show"}}" class="list-group-item list-group-item-action">
    	  <span class="fa fa-book"></span>
    	  {{.Data.Subject.Name}}
    	</a>
      </div>
      {{else}}
      <p>All'attività non è associata alcuna materia
    	didattica. Clicca <a href="/activities/update?{{query "tpl_layout" "base" "tpl_content" "activities_add_update"}}">qui</a> per
    	modificare questa attività didattica.</p>
      {{end}}
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Classe</h2>
      {{if .Data.Class}}
      <div class="list-group" id="classes_list_group">

	<a href="/classes/{{.Data.Class.ID}}?{{query "tpl_layout" "base" "tpl_content" "classes_show"}}" class="list-group-item list-group-item-action">
	  <span class="fa fa-users"></span>
	  {{.Data.Class.Name}}
	</a>
	
      </div>
      {{else}}
      
      <p>All'attività non è associata alcuna classe
    	didattica. Clicca <a href="/activities/update?{{query "tpl_layout" "base" "tpl_content" "activities_add_update"}}">qui</a> per
    	modificare questa attività didattica.</p>
      
      {{end}}
    </div>
    
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Docente</h2>
      {{if .Data.Teacher}}
      <div class="list-group" id="classes_list_group">
	<a href="/teachers/{{.Data.Teacher.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}" class="list-group-item list-group-item-action">
	  <span class="fa fa-user"></span>
	  {{.Data.Teacher.Surname}} {{.Data.Teacher.Name}}
	</a>
      </div>
            
      {{else}}

      <p>All'attività non è associato alcun docente
    	didattica. Clicca <a href="/activities/update?{{query "base" "activities_add_update"}}">qui</a> per
    	modificare questa attività didattica.</p>
	    
      {{end}}
    </div>
  </div>

  <div class="row">
    <div class="col-md-12">
      
      <h2 class="karmen-relation-header">Studente</h2>
      {{if .Data.Student}}
      <div class="list-group" id="classes_list_group">
	<a href="/teachers/{{.Data.Student.ID}}?{{query "tpl_layout" "base" "tpl_content" "students_show"}}" class="list-group-item list-group-item-action">
	  <span class="fa fa-user"></span>
	  {{.Data.Student.Surname}} {{.Data.Student.Name}}
	</a>
      </div>
      
      {{else}}

      <p>All'attività non è associato alcuno studente. Clicca <a href="/activities/update?{{query "base" "activities_add_update"}}">qui</a> per modificare questa attività didattica.</p>
     
      {{end}}
      
    </div>
  </div>


</div>    

{{ end }}
