45 lines
1.7 KiB
Smarty
45 lines
1.7 KiB
Smarty
{{ define "content" }}
|
|
<div class="container">
|
|
|
|
{{$update := .Options.Get "update"}}
|
|
|
|
{{if $update}}
|
|
|
|
{{template "breadcrumb" toSlice "Schools" (all "School") (.Data|string) (.Data.ID|show "School") "Aggiorna" "current"}}
|
|
{{else}}
|
|
{{template "breadcrumb" toSlice "Schools" (all "School") "Aggiungi" "current"}}
|
|
{{end}}
|
|
|
|
{{template "add_update_header" dict "update" $update "addTitle" "Crea nuova scuola" "updateTitle" (printf "Aggiorna scuola %s" (.Data|string))}}
|
|
{{$form := "form_add_update"}}
|
|
<form
|
|
class="needs-validation"
|
|
action="{{if $update}}{{.Data.ID|update "School"}}{{else}}{{create "School"}}{{end}}"
|
|
method="POST"
|
|
role="form"
|
|
id={{$form}}>
|
|
|
|
{{$options := ` { name: "Name",id: "school_name",label: "Denominazione dell'istituto",placeholder: "Inserire la denominazione",type: "text",required: "true"} `}}
|
|
{{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
|
|
|
|
{{$options := `
|
|
name: "Code"
|
|
id: "school_code"
|
|
label: "Codice meccanografico"
|
|
placeholder: "Inserire il codice meccanografico"
|
|
type: "text"
|
|
inputClass: "form-control uppercase"
|
|
required: "true"
|
|
`}}
|
|
{{template "input" dict "options" ($options|yaml) "value" (.Data|field "Code") "update" $update}}
|
|
|
|
{{$options := ` { name: "Email",id: "school_email",label: "Cognome del partecipante",placeholder: "Inserire la mail istituzionale",type: "email",required: "true"} `}}
|
|
{{template "input" dict "options" ($options|yaml) "value" (.Data|field "Email") "update" $update}}
|
|
|
|
{{$options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "School" } `}}
|
|
{{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
|
|
|
|
</form>
|
|
|
|
</div>
|
|
{{ end }}
|