departments.html.tpl 998 B

1234567891011121314151617181920212223242526272829303132333435
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$options := `
  4. title: "Dipartimenti"
  5. buttonTitle: "Crea nuovo dipartimento"
  6. `}}
  7. {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "department")}}
  8. {{template "search_input"}}
  9. {{if not .}}
  10. {{template "display_no_elements"}}
  11. {{else}}
  12. <div class="list-group" id="myUL">
  13. {{range $department := .Data}}
  14. <a class="list-group-item list-group-item-action" href={{$department.ID|show "department"}}>
  15. <span class="fa fa-user"></span>
  16. {{$department.Name}}
  17. <div class="text-right">
  18. {{$options := `noElements: "no coordinatore"`}}
  19. {{template "small" dict "options" ($options | yaml) "data" $department.Coordinator}}
  20. {{$options := `noElements: "no materie"`}}
  21. {{template "small" dict "options" ($options | yaml) "data" $department.Subjects}}
  22. </div>
  23. </a>
  24. {{end}}
  25. {{end}}
  26. </div>
  27. </div>
  28. {{ end }}