operators_add_update.html.tpl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$update := .Options.Get "update"}}
  4. {{if $update}}
  5. {{template "breadcrumb" toSlice "Operatori" (all "Operator") (.Data|string) (.Data.ID|show "Operator") "Aggiorna" "current"}}
  6. {{else}}
  7. {{template "breadcrumb" toSlice "Operatori" (all "Operator") "Aggiungi" "current"}}
  8. {{end}}
  9. {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo operatore" "updateTitle" (printf "Aggiorna operatore %s" (.Data|string))}}
  10. {{$form := "form_operators_add_update"}}
  11. <form
  12. class="needs-validation"
  13. action="{{if $update}}{{.Data.ID|update "Operator"}}{{else}}{{create "Operator"}}{{end}}"
  14. method="POST"
  15. role="form"
  16. id={{$form}}>
  17. {{$options := ` { name: "Firstname",id: "operator_firstname",label: "Nome",placeholder: "Nome ",type: "text"} `}}
  18. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Firstname") "update" $update}}
  19. {{$options := ` { name: "Lastname",id: "operator_lastname",label: "Cognome",placeholder: "Cognome",type: "text"} `}}
  20. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Lastname") "update" $update}}
  21. {{$options := ` { name: "Email",id: "operator_email",label: "Email",placeholder: "Email",type: "text"} `}}
  22. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Email") "update" $update}}
  23. {{$options := ` { name: "Description",id: "operator_description",label: "Descrizione",placeholder: "Descrizione",type: "text"} `}}
  24. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Description") "update" $update}}
  25. {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Student"} ` }}
  26. {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
  27. </form>
  28. </div>
  29. {{ end }}