teachers.html.tpl 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$options := `
  4. title: "Docenti"
  5. buttonTitle: "Crea nuovo docente"
  6. `}}
  7. {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "teacher")}}
  8. {{template "search_input"}}
  9. {{if not .}}
  10. {{template "display_no_elements"}}
  11. {{else}}
  12. <div class="list-group" id="myUL">
  13. {{range $teacher := .Data}}
  14. <a class="list-group-item list-group-item-action" href={{$teacher.ID|show "teacher"}}>
  15. <span class="fa fa-user"></span>
  16. {{$teacher.Surname}} {{$teacher.Name}}
  17. <div class="text-right">
  18. {{if $teacher.Classes}}
  19. {{range $class := $teacher.Classes}}
  20. <small>{{$class.Name}}</small>
  21. {{end}}
  22. {{else}}
  23. <small>no classi</small>
  24. {{end}}
  25. {{if $teacher.Subjects}}
  26. {{range $subject := $teacher.Subjects}}
  27. <small>{{$subject.Name}}</small>
  28. {{end}}
  29. {{else}}
  30. <small>no materie</small>
  31. {{end}}
  32. </div>
  33. </a>
  34. {{end}}
  35. {{end}}
  36. </div>
  37. </div>
  38. {{ end }}