Explorar o código

Add UI for add ATA to offices

Andrea Fazzi %!s(int64=3) %!d(string=hai) anos
pai
achega
edd1fa2568
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      templates/administratives_add_update.html.tpl

+ 7 - 1
templates/administratives_add_update.html.tpl

@@ -12,9 +12,12 @@
   
   {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo ATA" "updateTitle" (printf "Aggiorna ATA %s" (.Data|string))}}
 
+  {{$form := "form_administratives_add_update"}}
   <form
     class="needs-validation"
-    action="{{if $update}}{{.Data.ID|update "Administrative"}}{{else}}{{create "Administrative"}}{{end}}" method="POST" role="form">
+    action="{{if $update}}{{.Data.ID|update "Administrative"}}{{else}}{{create "Administrative"}}{{end}}" method="POST" role="form"
+    id={{$form}}
+    >
 
     {{$options := ` { name: "Name",id: "administrative_name",label: "Nome",placeholder: "Nome",type: "text" } `}}
     {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
@@ -28,6 +31,9 @@
     {{$options := ` { name: "AltEmail",id: "administrative_altemail",label: "Email alternativa",placeholder: "Inserire indirizzo email",type: "email" } `}}
     {{template "input" dict "options" ($options|yaml) "value" (.Data|field "AltEmail") "update" $update}}
 
+    {{$options := ` { name: "office_id", id: "office_id", label: "Ufficio", title: "Seleziona l'ufficio a cui appartiene l'impiegato"}`}}
+    {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllOffices") "selected" (.Data|field "SelectedOffice") "update" $update "form" $form}}
+
     <div class="form-row">
       <div class="col">
         {{$options := ` { name: "Regenerate",id: "administrative_regenerate",label: "Rigenerare/inviare le credenziali",formClass: "form-check form-check-inline" } `}}