{{ define "content" }}

<div class="container">

  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="/offices?{{query "tpl_layout" "base" "tpl_content" "offices"}}">Uffici</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>Ufficio di {{.Data.Name}}</h1>
      </div>
      <div class="col-md-4">

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

	  <a href="/offices/{{.Data.ID}}/update?{{query "tpl_layout" "base" "tpl_content" "offices_add_update" "update" "true"}}"  class="btn btn-primary">
	    <span class="fa fa-edit" aria-hidden="true"></span>
	    Modifica
	  </a>
	  <button href="/offices/{{.Data.ID}}/delete"
		  data-url="/offices/{{.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">Informazioni sull'ufficio</h2>
      {{if .Data.Email}}
      <span class="fa fa-envelope"></span>
      <a href="mailto:{{.Data.Email}}">{{.Data.Email}}</a>
      {{else}}
      <span class="list-group-item list-group-item-action">Nessun coordinatore</span>
      {{end}}
    </div>
    
    <div class="col-md-12">
      <h2 class="karmen-relation-header">Personale amministrativo presente nell'ufficio</h2>
      {{if not .Data.Administratives}}
      <p>All'ufficio non è associato nessun personale amministrativo
	didattica. Clicca <a href="/administratives/add/?{{query "tpl_layout" "base" "tpl_content" "administratives_add_update"}}">qui</a> per creare
	una nuova utenza amministrativa.</p>
      {{else}}
      <div class="list-group" id="administratives_list_group">
	{{range $administrative := .Data.Administratives}}
	<a class="list-group-item list-group-item-action" href="/administratives/{{$administrative.ID}}?{{query "tpl_layout" "base" "tpl_content" "administratives_show"}}">
	  <span class="fa fa-user"></span>
	  {{$administrative.Surname}} {{$administrative.Name}}
	</a>
	{{end}}
      </div>
      {{end}}
    </div>    

    {{ end }}
