|
@@ -2,101 +2,77 @@
|
|
|
|
|
|
<div class="container">
|
|
<div class="container">
|
|
|
|
|
|
- {{if .Options.Get "update"}}
|
|
|
|
- <nav aria-label="breadcrumb">
|
|
|
|
- <ol class="breadcrumb">
|
|
|
|
- <li class="breadcrumb-item"><a href="/teachers?{{query "tpl_layout" "base" "tpl_content" "teachers"}}">Docenti</a></li>
|
|
|
|
- <li class="breadcrumb-item"><a href="/teachers/{{.Data.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}">{{.Data.Name}} {{.Data.Surname}}</a></li>
|
|
|
|
- <li class="breadcrumb-item active"><a href="#">Aggiorna</a></li>
|
|
|
|
- </ol>
|
|
|
|
- </nav>
|
|
|
|
- {{else}}
|
|
|
|
- <nav aria-label="breadcrumb">
|
|
|
|
- <ol class="breadcrumb">
|
|
|
|
- <li class="breadcrumb-item"><a href="/teachers/?{{query "tpl_layout" "base" "tpl_content" "teachers"}}">Docenti</a></li>
|
|
|
|
- <li class="breadcrumb-item active"><a href="#">Aggiungi</a></li>
|
|
|
|
- </ol>
|
|
|
|
- </nav>
|
|
|
|
- {{end}}
|
|
|
|
-
|
|
|
|
- {{if .Options.Get "update"}}
|
|
|
|
- <h1 class="karmen-info-header">Aggiorna il docente "{{.Data.Name}} {{.Data.Surname}}"</h1>
|
|
|
|
|
|
+ {{$update := .Options.Get "update"}}
|
|
|
|
+
|
|
|
|
+ {{if $update}}
|
|
|
|
+ {{template "breadcrumb" toSlice "Docenti" (all "Teacher") (.Data|string) (.Data.ID|show "Teacher") "Aggiorna" "current"}}
|
|
{{else}}
|
|
{{else}}
|
|
- <h1 class="karmen-info-header">Crea un nuovo docente</h1>
|
|
|
|
|
|
+ {{template "breadcrumb" toSlice "Docenti" (all "Teacher") "Aggiungi" "current"}}
|
|
{{end}}
|
|
{{end}}
|
|
|
|
+
|
|
|
|
+ {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo docente" "updateTitle" (printf "Aggiorna docente %s" (.Data|string))}}
|
|
|
|
|
|
- {{if .Options.Get "update"}}
|
|
|
|
|
|
+ {{if $update}}
|
|
<form class="needs-validation" action="/teachers/{{.Data.ID}}/update" method="POST" role="form">
|
|
<form class="needs-validation" action="/teachers/{{.Data.ID}}/update" method="POST" role="form">
|
|
{{else}}
|
|
{{else}}
|
|
<form action="/teachers/create/" method="POST" role="form" class="needs-validation">
|
|
<form action="/teachers/create/" method="POST" role="form" class="needs-validation">
|
|
- {{end}}
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="control-label" for="teacher_name">Nome</label>
|
|
|
|
- <input type="text" name="Name" class="form-control" id="teacher_name" placeholder="Nome" {{if .Options.Get "update"}} value="{{.Data.Name}}" {{end}} required>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="control-label" for="teacher_surname">Cognome</label>
|
|
|
|
- <input type="text" name="Surname" class="form-control" id="teacher_surname" placeholder="Cognome" {{if .Options.Get "update"}} value="{{.Data.Surname}}" {{end}} required>
|
|
|
|
- </div>
|
|
|
|
|
|
+ {{end}}
|
|
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="control-label has-feedback" for="teacher_hours">Numero di ore</label>
|
|
|
|
- <input type="number" name="Hours" class="form-control" id="teacher_hours" {{if .Options.Get "update"}}value="{{.Data.Hours}}"{{else}}value="18"{{end}} required>
|
|
|
|
- </div>
|
|
|
|
|
|
+ {{$options := ` { name: "Name",id: "teacher_name",label: "Nome",placeholder: "Nome",type: "text" } `}}
|
|
|
|
+ {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
|
|
|
|
|
|
- <div class="form-row">
|
|
|
|
-
|
|
|
|
- <div class="col">
|
|
|
|
- <input type="email" name="AltEmail" class="form-control" id="teacher_altemail" placeholder="Email alternativa" {{if .Options.Get "update"}} value="{{.Data.AltEmail}}" {{end}}>
|
|
|
|
- </div>
|
|
|
|
- <div class="col">
|
|
|
|
- <div class="form-check">
|
|
|
|
- <input type="checkbox" name="Regenerate" class="form-check-input" id="teacher_regenerate" {{if .Options.Get "update"}}{{if .Data.Regenerate}}checked{{end}}{{end}}>
|
|
|
|
- <label class="form-check-label has-feedback" for="teacher_regenerate">Rigenerare/inviare le credenziali</label>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="col">
|
|
|
|
- <div class="form-check">
|
|
|
|
- <input type="checkbox" name="Exclude" class="form-check-input" id="teacher_exclude" {{if .Options.Get "update"}}{{if .Data.Exclude}}checked{{end}}{{end}}>
|
|
|
|
- <label class="form-check-label has-feedback" for="teacher_exclude">Escludere dalle utenze</label>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="col">
|
|
|
|
- <div class="form-check">
|
|
|
|
- <input type="checkbox" name="NotInvited" class="form-check-input" id="teacher_not_invited" {{if .Options.Get "update"}}{{if .Data.NotInvited}}checked{{end}}{{end}}>
|
|
|
|
- <label class="form-check-label has-feedback" for="teacher_not_invited">Escludere dagli inviti</label>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ {{$options := ` { name: "Surname",id: "teacher_surname",label: "Cognome",placeholder: "Cognome",type: "text" } `}}
|
|
|
|
+ {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Surname") "update" $update}}
|
|
|
|
|
|
|
|
+ {{$options := ` { name: "Hours",id: "teacher_hours",label: "Numero di ore",placeholder: "",type: "number" } `}}
|
|
|
|
+ {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Hours") "update" $update}}
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
+ {{$options := ` { name: "AltEmail",id: "teacher_altemail",label: "Email alternativa",placeholder: "Inserire indirizzo email",type: "email" } `}}
|
|
|
|
+ {{template "input" dict "options" ($options|yaml) "value" (.Data|field "AltEmail") "update" $update}}
|
|
|
|
|
|
- <div class="form-row">
|
|
|
|
- <div class="col">
|
|
|
|
- <label class="control-label" for="teacher_date_from">In servizio dal</label>
|
|
|
|
- <input type="date" name="DateFrom" class="form-control" id="teacher_date_from" {{if .Options.Get "update"}} value="{{convertDate .Data.DateFrom}}" {{end}}>
|
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
+ <div class="col">
|
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
|
+ <input type="checkbox" name="Regenerate" class="form-check-input" id="teacher_regenerate" {{if .Options.Get "update"}}{{if .Data.Regenerate}}checked{{end}}{{end}}>
|
|
|
|
+ <label class="form-check-label has-feedback" for="teacher_regenerate">Rigenerare/inviare le credenziali</label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
|
+ <input type="checkbox" name="Exclude" class="form-check-input" id="teacher_exclude" {{if .Options.Get "update"}}{{if .Data.Exclude}}checked{{end}}{{end}}>
|
|
|
|
+ <label class="form-check-label has-feedback" for="teacher_exclude">Escludere dalle utenze</label>
|
|
</div>
|
|
</div>
|
|
- <div class="col">
|
|
|
|
- <label class="control-label" for="teacher_date_to">In servizio fino al</label>
|
|
|
|
- <input type="date" name="DateTo" class="form-control" id="teacher_date_to" {{if .Options.Get "update"}} value="{{convertDate .Data.DateTo}}" {{end}}>
|
|
|
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
|
+ <input type="checkbox" name="NotInvited" class="form-check-input" id="teacher_not_invited" {{if .Options.Get "update"}}{{if .Data.NotInvited}}checked{{end}}{{end}}>
|
|
|
|
+ <label class="form-check-label has-feedback" for="teacher_not_invited">Escludere dagli inviti</label>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="control-label has-feedback" for="teacher_ldapdnfmt">Stringa DN per LDAP</label>
|
|
|
|
- <input type="text" name="LdapDNFmt" class="form-control" id="teacher_ldapdnfmt" placeholder="cn=%s %s,ou=People,dc=foo,dc=org" {{if .Options.Get "update"}}value="{{.Data.LdapDNFmt}}"{{end}}>
|
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
+ <div class="col">
|
|
|
|
+ <label class="control-label" for="teacher_date_from">In servizio dal</label>
|
|
|
|
+ <input type="date" name="DateFrom" class="form-control" id="teacher_date_from" {{if .Options.Get "update"}} value="{{convertDate .Data.DateFrom}}" {{end}}>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <div class="form-group">
|
|
|
|
- <button type="submit" class="btn btn-primary">Salva</button>
|
|
|
|
- {{if .Options.Get "update"}}
|
|
|
|
- <a href="/teachers/{{.Data.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}" class="btn btn-default">Annulla</a>
|
|
|
|
- {{else}}
|
|
|
|
- <a href="/teachers/?{{query "tpl_layout" "base" "tpl_content" "teachers"}}" class="btn btn-default">Annulla</a>
|
|
|
|
- {{end}}
|
|
|
|
|
|
+ <div class="col">
|
|
|
|
+ <label class="control-label" for="teacher_date_to">In servizio fino al</label>
|
|
|
|
+ <input type="date" name="DateTo" class="form-control" id="teacher_date_to" {{if .Options.Get "update"}} value="{{convertDate .Data.DateTo}}" {{end}}>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="control-label has-feedback" for="teacher_ldapdnfmt">Stringa DN per LDAP</label>
|
|
|
|
+ <input type="text" name="LdapDNFmt" class="form-control" id="teacher_ldapdnfmt" placeholder="cn=%s %s,ou=People,dc=foo,dc=org" {{if .Options.Get "update"}}value="{{.Data.LdapDNFmt}}"{{end}}>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <button type="submit" class="btn btn-primary">Salva</button>
|
|
|
|
+ {{if .Options.Get "update"}}
|
|
|
|
+ <a href="/teachers/{{.Data.ID}}?{{query "tpl_layout" "base" "tpl_content" "teachers_show"}}" class="btn btn-default">Annulla</a>
|
|
|
|
+ {{else}}
|
|
|
|
+ <a href="/teachers/?{{query "tpl_layout" "base" "tpl_content" "teachers"}}" class="btn btn-default">Annulla</a>
|
|
|
|
+ {{end}}
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</form>
|
|
</form>
|
|
|
|
|
|
|
|
|