offices_add_update.html.tpl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$update := .Options.Get "update"}}
  4. {{if $update}}
  5. {{template "breadcrumb" toSlice "Uffici" (all "Office") (.Data|string) (.Data.ID|show "Office") "Aggiorna" "current"}}
  6. {{else}}
  7. {{template "breadcrumb" toSlice "Uffici" (all "Office") "Aggiungi" "current"}}
  8. {{end}}
  9. {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo ufficio" "updateTitle" (printf "Aggiorna ufficio %s" (.Data|string))}}
  10. {{$form := "form_offices_add_update"}}
  11. <form
  12. class="needs-validation"
  13. action="{{if $update}}{{.Data.ID|update "Office"}}{{else}}{{create "Office"}}{{end}}"
  14. method="POST"
  15. role="form"
  16. id={{$form}}>
  17. {{$options := ` { name: "Name",id: "office_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}}
  18. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
  19. {{$options := ` { name: "Email",id: "office_email",label: "Email",placeholder: "Inserire l'indirizzo di posta elettronica",type: "email"} `}}
  20. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Email") "update" $update}}
  21. {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Office"} ` }}
  22. {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
  23. </form>
  24. </div>
  25. {{ end }}