1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- {{ define "content" }}
- <div class="container">
- {{$update := .Options.Get "update"}}
- {{if $update}}
- {{template "breadcrumb" toSlice "Studenti" (all "Student") (.Data|string) (.Data.ID|show "Student") "Aggiorna" "current"}}
- {{else}}
- {{template "breadcrumb" toSlice "Studenti" (all "Student") "Aggiungi" "current"}}
- {{end}}
-
- {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo studente" "updateTitle" (printf "Aggiorna studente %s" (.Data|string))}}
- {{$form := "form_students_add_update"}}
- <form
- class="needs-validation"
- action="{{if $update}}{{.Data.ID|update "Student"}}{{else}}{{create "Student"}}{{end}}"
- method="POST"
- role="form"
- id={{$form}}>
- {{$options := ` { name: "Name",id: "student_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}}
- {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
- {{$options := ` { name: "Surname",id: "student_surname",label: "Cognome",placeholder: "Cognome",type: "text",required: "true"} `}}
- {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Surname") "update" $update}}
- {{$options := ` { name: "class_id", id: "class_id", label: "Classe", title: "Seleziona la classe"}`}}
- {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllClasses") "selected" (.Data|field "SelectedClass") "update" $update "form" $form}}
- {{$options := ` { name: "tutor_id", id: "tutor_id", label: "Docente tutor", title: "Seleziona il docente tutor"}`}}
- {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllTeachers") "selected" (.Data|field "SelectedTeacher") "update" $update "form" $form}}
- {{$options := ` { name: "Handicap",id: "student_handicap",label: "Handicap (L. 104/92)",formClass: "form-group form-check" } `}}
- {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "Handicap") "update" $update}}
- {{$options := ` { name: "DSA",id: "student_dsa",label: "DSA (L. 170/10)",formClass: "form-group form-check" } `}}
- {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "DSA") "update" $update}}
- {{$options := ` { name: "BES",id: "student_bes",label: "BES (L. 170/10)",formClass: "form-group form-check" } `}}
- {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "BES") "update" $update}}
- {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Student"} ` }}
- {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
- </form>
-
- </div>
- {{ end }}
|