teachers.html.tpl 977 B

12345678910111213141516171819202122232425262728293031323334
  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. {{$options := `noElements: "no classi"`}}
  19. {{template "small" dict "options" ($options | yaml) "data" $teacher.Classes}}
  20. {{$options := `noElements: "no materie"`}}
  21. {{template "small" dict "options" ($options | yaml) "data" $teacher.Subjects}}
  22. </div>
  23. </a>
  24. {{end}}
  25. {{end}}
  26. </div>
  27. </div>
  28. {{ end }}