{{ define "content" }}
{{$update := .Options.Get "update"}} {{if $update}} {{template "breadcrumb" toSlice "Dipartimenti" (all "Department") (.Data|string) (.Data.ID|show "Department") "Aggiorna" "current"}} {{else}} {{template "breadcrumb" toSlice "Dipartimenti" (all "Department") "Aggiungi" "current"}} {{end}} {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo dipartimento" "updateTitle" (printf "Aggiorna dipartimento %s" (.Data|string))}} {{$form := "form_departments_add_update"}}
{{$options := ` { name: "Name",id: "department_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}} {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}} {{$options := ` { name: "coordinator_id", id: "coordinator_id", label: "Coordinatore", title: "Seleziona il coordinatore"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllTeachers") "selected" (.Data|field "SelectedCoordinator") "update" $update "form" $form}} {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Department"} ` }} {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
{{ end }}