Ver Fonte

Add Name field to activity; add "Exclude" field in Teacher model

Andrea Fazzi há 5 anos atrás
pai
commit
f2088807df
4 ficheiros alterados com 13 adições e 0 exclusões
  1. 2 0
      orm/activity.go
  2. 1 0
      orm/credential.go
  3. 3 0
      orm/teacher.go
  4. 7 0
      templates/teachers_add_update.html.tpl

+ 2 - 0
orm/activity.go

@@ -10,6 +10,8 @@ import (
 type Activity struct {
 	gorm.Model
 
+	Name string
+
 	Class         *Class
 	Teacher       *Teacher
 	SupplyTeacher *Teacher

+ 1 - 0
orm/credential.go

@@ -24,6 +24,7 @@ type Credential struct {
 	TelephoneNumber string
 
 	Regenerate bool `schema:"Regenerate" sql:"default: false"`
+	Exclude    bool
 }
 
 func (c *Credential) sanitize(s string) string {

+ 3 - 0
orm/teacher.go

@@ -194,6 +194,9 @@ func UpdateTeacher(args map[string]string, r *http.Request) (IDer, error) {
 	// FIXME: Should not be hard set.
 	teacher.(*Teacher).Regenerate = false
 
+	// FIXME: Should not be hard set.
+	teacher.(*Teacher).Exclude = false
+
 	if len(args["DateFrom"]) == 0 {
 		// FIXME: Should not be hard set.
 		teacher.(*Teacher).DateFrom = time.Time{}

+ 7 - 0
templates/teachers_add_update.html.tpl

@@ -55,6 +55,13 @@
 	  <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>
 
     <div class="form-row">