Ver código fonte

Add NotInvited field

Andrea Fazzi 5 anos atrás
pai
commit
5476a0b4cf

+ 5 - 0
orm/credential.go

@@ -30,6 +30,7 @@ type Credential struct {
 
 	Regenerate bool `schema:"Regenerate" sql:"default: false"`
 	Exclude    bool
+	NotInvited bool
 
 	LdapDNFmt string
 }
@@ -77,6 +78,10 @@ func (c *Credential) GetExclude() bool {
 	return c.Exclude
 }
 
+func (c *Credential) IsInvited() bool {
+	return !c.NotInvited
+}
+
 func (c *Credential) GetRegenerate() bool {
 	return c.Regenerate
 }

+ 7 - 0
templates/administratives_add_update.html.tpl

@@ -69,6 +69,13 @@
 	</div>
       </div>
     </div>
+    <div class="col">
+      <div class="form-check">
+	<input type="checkbox" name="NotInvited" class="form-check-input" id="administrative_not_invited" {{if .Options.Get "update"}}{{if .Data.NotInvited}}checked{{end}}{{end}}>
+	<label class="form-check-label has-feedback" for="administrative_not_invited">Escludere dagli inviti</label>
+      </div>
+    </div>
+
     
     <div class="form-row">
       <div class="col">

+ 7 - 0
templates/teachers_add_update.html.tpl

@@ -62,6 +62,13 @@
 	  <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>
+
 
     </div>