{{ define "content" }}
{{$update := .Options.Get "update"}} {{if $update}} {{template "breadcrumb" toSlice "Materie" (all "Subject") (.Data|string) (.Data.ID|show "Subject") "Aggiorna" "current"}} {{else}} {{template "breadcrumb" toSlice "Materie" (all "Subject") "Aggiungi" "current"}} {{end}} {{template "add_update_header" dict "update" $update "addTitle" "Crea nuova materia" "updateTitle" (printf "Aggiorna materia %s" (.Data|string))}} {{$form := "form_subjects_add_update"}}
{{$options := ` { name: "Name",id: "subject_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}} {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}} {{$options := ` { name: "department_id", id: "department_id", label: "Dipartimento", title: "Seleziona il dipartimento"}`}} {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllDepartments") "selected" (.Data|field "Selected") "update" $update "form" $form}} {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Subject"} ` }} {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
{{ end }}