administratives_add_update.html.tpl 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$update := .Options.Get "update"}}
  4. {{if $update}}
  5. {{template "breadcrumb" toSlice "Personale ATA" (all "Administrative") (.Data|string) (.Data.ID|show "Administrative") "Aggiorna" "current"}}
  6. {{else}}
  7. {{template "breadcrumb" toSlice "Personale ATA" (all "Administrative") "Aggiungi" "current"}}
  8. {{end}}
  9. {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo ATA" "updateTitle" (printf "Aggiorna ATA %s" (.Data|string))}}
  10. {{$form := "form_administratives_add_update"}}
  11. <form
  12. class="needs-validation"
  13. action="{{if $update}}{{.Data.ID|update "Administrative"}}{{else}}{{create "Administrative"}}{{end}}" method="POST" role="form"
  14. id={{$form}}
  15. >
  16. {{$options := ` { name: "Name",id: "administrative_name",label: "Nome",placeholder: "Nome",type: "text" } `}}
  17. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
  18. {{$options := ` { name: "Surname",id: "administrative_surname",label: "Cognome",placeholder: "Cognome",type: "text" } `}}
  19. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Surname") "update" $update}}
  20. {{$options := ` { name: "InternalTelephoneNumber",id: "administrative_internal_telephone_number",label: "Numero di telefono interno",placeholder: "",type: "text" } `}}
  21. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "InternalTelephoneNumber") "update" $update}}
  22. {{$options := ` { name: "AltEmail",id: "administrative_altemail",label: "Email alternativa",placeholder: "Inserire indirizzo email",type: "email" } `}}
  23. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "AltEmail") "update" $update}}
  24. {{$options := ` { name: "office_id", id: "office_id", label: "Ufficio", title: "Seleziona l'ufficio a cui appartiene l'impiegato"}`}}
  25. {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllOffices") "selected" (.Data|field "SelectedOffice") "update" $update "form" $form}}
  26. <div class="form-row">
  27. <div class="col">
  28. {{$options := ` { name: "Regenerate",id: "administrative_regenerate",label: "Rigenerare/inviare le credenziali",formClass: "form-check form-check-inline" } `}}
  29. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "Regenerate") "update" $update}}
  30. </div>
  31. <div class="col">
  32. {{$options := ` { name: "Exclude",id: "administrative_exclude",label: "Escludere dalle utenze",formClass: "form-check form-check-inline" } `}}
  33. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "Exclude") "update" $update}}
  34. </div>
  35. <div class="col">
  36. {{$options := ` { name: "NotInvited",id: "administrative_not_invited",label: "Escludere dagli inviti",formClass: "form-check form-check-inline" } `}}
  37. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "NotInvited") "update" $update}}
  38. </div>
  39. </div>
  40. <div class="form-row">
  41. <div class="col">
  42. {{$options := ` { name: "DateFrom",id: "administrative_date_from",label: "In servizio dal",type: "date" } `}}
  43. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "DateFrom"|convertDate) "update" $update}}
  44. </div>
  45. <div class="col">
  46. {{$options := ` { name: "DateTo",id: "administrative_date_to",label: "In servizio fino al",type: "date" } `}}
  47. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "DateTo"|convertDate) "update" $update}}
  48. </div>
  49. </div>
  50. {{$options := ` { name: "LdapDNFmt",id: "administrative_ldapfnfmt",label: "Stringa DN per LDAP",placeholder: "cn=%s %s,ou=People,dc=foo,dc=org",type: "text" } `}}
  51. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LdapDNFmt") "update" $update}}
  52. {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Administrative"} ` }}
  53. {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
  54. </form>
  55. </div>
  56. {{ end }}