{{ define "content" }}

<div class="container">
  
  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>Classi ({{len .Data}})</h1>
      </div>
      <div class="col-md-4">
	<div class="btn-group float-right">

	  <a href="/classes/add/?{{query "tpl_layout" "base" "tpl_content" "classes_add_update"}}" class="btn btn-primary">
	    <span class="fa fa-plus-circle" aria-hidden="true"></span>
	    Crea nuova classe
	  </a>
	  
	</div>
      </div>
    </div>

    <div class="input-group" style="margin-bottom: 20px">
      <span class="input-group-addon" id="search-query"><span class="glyphicon glyphicon-search"></span></span>
      <input type="text" id="myInput" class="form-control" aria-describedby="search-query">
    </div>
    {{if not .Data}}
    <p>Non c'è alcun elemento da visualizzare.</p>
    {{else}}
    <div class="list-group" id="myUL">
      {{range $class := .Data}}
      <a class="list-group-item list-group-item-action list-group-item-action" href="/classes/{{$class.ID}}?{{query "tpl_layout" "base" "tpl_content" "classes_show"}}">
	<span class="fa fa-users"></span>
	{{$class.Name}}
	<div class="text-right">
 	  {{range $teacher := $class.Teachers}}
	  <small>{{$teacher.Surname}}</small>
	  {{end}}
	</div>
      </a>
      {{end}}
    </div>
    {{end}}
  </div>
  
  {{ end }}
