{{ define "content" }}

<div class="container">
  
  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>Classi</h1>
      </div>
      <div class="col-md-4">
	<div class="btn-group pull-right">

	  <a href="/classes/add" class="btn btn-primary">
	    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
	    Crea nuova classe
	  </a>

	  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
	    <span class="glyphicon glyphicon-floppy-open" aria-hidden="true"></span>
	    Importa<span class="caret"></span>
	  </button>
	  
	  <div class="dropdown-menu">
	    <div class="container">  
	      <form role="form" id="form_classes_upload" action="/classes/import" method="post" enctype="multipart/form-data">
		<div class="form-group">
		  <label class="control-label">Seleziona il file</label>
		  <input id="input-1" type="file" class="file" data-show-preview="false" name="classes_import">
		</div>
	      </form>
	    </div>  
	  </div>
	</div>
	
      </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 .}}
  <p>Non c'è alcun elemento da visualizzare.</p>
  {{else}}
  <div class="list-group" id="myUL">
    {{range $class := .}}
    <a class="list-group-item clearfix" href="/classes/{{$class.ID}}">
      <span class="glyphicon glyphicon-blackboard"></span>
      {{$class.Name}}
      <div class="text-right">
	{{range $teacher := $class.Teachers}}
	<small>{{$teacher.Surname}}</small>
	{{end}}
      </div>
    </a>
    {{end}}
  </div>
  {{end}}
</div>
  
{{ end }}
