students_add_update.html.tpl 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$update := .Options.Get "update"}}
  4. {{if $update}}
  5. {{template "breadcrumb" toSlice "Studenti" (all "Student") (.Data|string) (.Data.ID|show "Student") "Aggiorna" "current"}}
  6. {{else}}
  7. {{template "breadcrumb" toSlice "Studenti" (all "Student") "Aggiungi" "current"}}
  8. {{end}}
  9. {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo studente" "updateTitle" (printf "Aggiorna studente %s" (.Data|string))}}
  10. {{$form := "form_students_add_update"}}
  11. <form
  12. class="needs-validation"
  13. action="{{if $update}}{{.Data.ID|update "Student"}}{{else}}{{create "Student"}}{{end}}"
  14. method="POST"
  15. role="form"
  16. id={{$form}}>
  17. {{$options := ` { name: "Name",id: "student_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}}
  18. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
  19. {{$options := ` { name: "Surname",id: "student_surname",label: "Cognome",placeholder: "Cognome",type: "text",required: "true"} `}}
  20. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Surname") "update" $update}}
  21. {{$options := ` { name: "class_id", id: "class_id", label: "Classe", title: "Seleziona la classe"}`}}
  22. {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllClasses") "selected" (.Data|field "SelectedClass") "update" $update "form" $form}}
  23. {{$options := ` { name: "tutor_id", id: "tutor_id", label: "Docente tutor", title: "Seleziona il docente tutor"}`}}
  24. {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllTeachers") "selected" (.Data|field "SelectedTeacher") "update" $update "form" $form}}
  25. {{$options := ` { name: "Handicap",id: "student_handicap",label: "Handicap (L. 104/92)",formClass: "form-group form-check" } `}}
  26. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "Handicap") "update" $update}}
  27. {{$options := ` { name: "DSA",id: "student_dsa",label: "DSA (L. 170/10)",formClass: "form-group form-check" } `}}
  28. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "DSA") "update" $update}}
  29. {{$options := ` { name: "BES",id: "student_bes",label: "BES (L. 170/10)",formClass: "form-group form-check" } `}}
  30. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "BES") "update" $update}}
  31. {{$options := ` { name: "operator_ids", id: "operator_ids", label: "Operatori", title: "Seleziona gli operatori associati allo studente", multiple: "true"}`}}
  32. {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllOperators") "selected" (.Data|field "SelectedOperator") "update" $update "form" $form}}
  33. {{$options := ` { name: "FatherLastname",id: "student_fatherlastname",label: "Cognome del padre",placeholder: "Cognome del padre",type: "text"} `}}
  34. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherLastname") "update" $update}}
  35. {{$options := ` { name: "FatherFirstname",id: "student_fatherfirstname",label: "Nome del padre",placeholder: "Nome del padre",type: "text"} `}}
  36. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherFirstname") "update" $update}}
  37. {{$options := ` { name: "FatherEmail",id: "student_fatheremail",label: "Email del padre",placeholder: "Email del padre",type: "text"} `}}
  38. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherEmail") "update" $update}}
  39. {{$options := ` { name: "MotherLastname",id: "student_motherlastname",label: "Cognome della madre",placeholder: "Cognome della madre",type: "text"} `}}
  40. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherLastname") "update" $update}}
  41. {{$options := ` { name: "MotherFirstname",id: "student_motherfirstname",label: "Nome della madre",placeholder: "Nome della madre",type: "text"} `}}
  42. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherFirstname") "update" $update}}
  43. {{$options := ` { name: "MotherEmail",id: "student_motheremail",label: "Email della madre",placeholder: "Email della madre",type: "text"} `}}
  44. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherEmail") "update" $update}}
  45. {{$options := ` { name: "LegalGuardianLastname",id: "student_legalguardianlastname",label: "Cognome del tutore legale",placeholder: "Cognome del tutore legale",type: "text"} `}}
  46. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianLastname") "update" $update}}
  47. {{$options := ` { name: "LegalGuardianFirstname",id: "student_legalguardianfirstname",label: "Nome del tutore legale",placeholder: "Nome del tutore legale",type: "text"} `}}
  48. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianFirstname") "update" $update}}
  49. {{$options := ` { name: "LegalGuardianEmail",id: "student_legalguardianemail",label: "Email del tutore legale",placeholder: "Email del tutore legale",type: "text"} `}}
  50. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianEmail") "update" $update}}
  51. {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Student"} ` }}
  52. {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
  53. </form>
  54. </div>
  55. {{ end }}