Browse Source

Add student's parents

Andrea Fazzi 4 years ago
parent
commit
beac46657f
2 changed files with 33 additions and 0 deletions
  1. 9 0
      orm/student.go
  2. 24 0
      templates/students_add_update.html.tpl

+ 9 - 0
orm/student.go

@@ -20,6 +20,15 @@ type Student struct {
 
 	FatherLastname  string
 	FatherFirstname string
+	FatherEmail     string
+
+	MotherLastname  string
+	MotherFirstname string
+	MotherEmail     string
+
+	LegalGuardianLastname  string
+	LegalGuardianFirstname string
+	LegalGuardianEmail     string
 
 	TutorID uint `schema:"tutor_id"`
 	ClassID uint `schema:"class_id"`

+ 24 - 0
templates/students_add_update.html.tpl

@@ -44,6 +44,30 @@
     {{$options := ` { name: "FatherLastname",id: "student_fatherlastname",label: "Cognome del padre",placeholder: "Cognome del padre",type: "text"} `}}
     {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherLastname") "update" $update}}
 
+    {{$options := ` { name: "FatherFirstname",id: "student_fatherfirstname",label: "Nome del padre",placeholder: "Nome del padre",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherFirstname") "update" $update}}
+
+    {{$options := ` { name: "FatherEmail",id: "student_fatheremail",label: "Email del padre",placeholder: "Email del padre",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "FatherEmail") "update" $update}}
+
+    {{$options := ` { name: "MotherLastname",id: "student_motherlastname",label: "Cognome della madre",placeholder: "Cognome della madre",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherLastname") "update" $update}}
+
+    {{$options := ` { name: "MotherFirstname",id: "student_motherfirstname",label: "Nome della madre",placeholder: "Nome della madre",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherFirstname") "update" $update}}
+
+    {{$options := ` { name: "MotherEmail",id: "student_motheremail",label: "Email della madre",placeholder: "Email della madre",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "MotherEmail") "update" $update}}
+
+    {{$options := ` { name: "LegalGuardianLastname",id: "student_legalguardianlastname",label: "Cognome del tutore legale",placeholder: "Cognome del tutore legale",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianLastname") "update" $update}}
+
+    {{$options := ` { name: "LegalGuardianFirstname",id: "student_legalguardianfirstname",label: "Nome del tutore legale",placeholder: "Nome del tutore legale",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianFirstname") "update" $update}}
+
+    {{$options := ` { name: "LegalGuardianEmail",id: "student_legalguardianemail",label: "Email del tutore legale",placeholder: "Email del tutore legale",type: "text"} `}}
+    {{template "input" dict "options" ($options|yaml) "value" (.Data|field "LegalGuardianEmail") "update" $update}}
+
     {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Student"} ` }}
     {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}  
   </form>