{{ define "content" }}
{{$update := .Options.Get "update"}} {{if $update}} {{template "breadcrumb" toSlice "Attività" (all "Activity") (.Data|string) (.Data.ID|show "Activity") "Aggiorna" "current"}} {{else}} {{template "breadcrumb" toSlice "Attività" (all "Activity") "Aggiungi" "current"}} {{end}} {{$updateTitle := ""}} {{if $update}}{{$updateTitle = (printf "Aggiorna attività %s" (.Data|string))}}{{end}} {{template "add_update_header" dict "update" $update "addTitle" "Crea nuova attività" "updateTitle" $updateTitle}} {{$form := "form_activities_add_update"}}
{{$options := ` { name: "subject_id", id: "subject_id", label: "Materia", title: "Seleziona la materia"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllSubjects") "selected" (.Data|field "SelectedSubject") "update" $update "form" $form}} {{$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: "teacher_id", id: "teacher_id", label: "Docente", title: "Seleziona il docente"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllTeachers") "selected" (.Data|field "SelectedTeacher") "update" $update "form" $form}} {{$options := ` { name: "supply_teacher_id", id: "supply_teacher_id", label: "Docente supplente", title: "Seleziona il docente"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllTeachers") "selected" (.Data|field "SelectedSupplyTeacher") "update" $update "form" $form}} {{$options := ` { name: "student_id", id: "student_id", label: "Studente", title: "Seleziona lo studente"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllStudents") "selected" (.Data|field "SelectedStudent") "update" $update "form" $form}} {{$options := ` { name: "Hours",id: "hours",label: "Numero di ore",type: "number",required: "true"} `}} {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Hours") "update" $update}} {{$options := ` name: "GroupActivity" id: "group_activity" label: "Attività di gruppo" formClass: "form-group form-check" help: "Spuntare la casella sopra nel caso di attività che coinvolgono più studenti contemporaneamente." `}} {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "GroupActivity") "update" $update}} {{$options := ` name: "group_activity_hours" id: "group_activity_hours" label: "Numero di ore dell'attività di gruppo" type: "number" help: "Indicare il numero totale di ore che il docente spende nell'attività di gruppo." `}} {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Hours") "update" $update}} {{$options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Activity"} ` }} {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
{{ end }}