{{ define "content" }}

<div class="container">
  
  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>Attività</h1>
      </div>
      <div class="col-md-4">
	<a href="/activities/add" class="btn btn-primary pull-right">
	  <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
	  Crea nuova attività
	</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 .Activities}}
  <p>Non c'è alcun elemento da visualizzare</p>
  {{else}}
  <div class="list-group" id="myUL">
    {{range $activity := .Activities}}
    <a class="list-group-item clearfix" href="/activities/{{$activity.ID}}/update">
      <span class="glyphicon glyphicon-briefcase"></span>
      {{$activity.Subject.Name}}
      <div class="text-right">
	{{if eq $activity.Teacher.ID 0}}
	<small>no docente</small>
	{{else}}
	<small>{{$activity.Teacher.Surname}}</small>
	{{end}}
	<small>{{$activity.Class.Name}}</small>
	<small>{{$activity.Hours}}h</small>
      </div>
    </a>
    {{end}}
    {{end}}
  </div>
</div>
  
{{ end }}
