Jelajahi Sumber

Add FatherLastname field

Andrea Fazzi 4 tahun lalu
induk
melakukan
66a00d7389
4 mengubah file dengan 11 tambahan dan 0 penghapusan
  1. 1 0
      go.mod
  2. 4 0
      go.sum
  3. 3 0
      orm/student.go
  4. 3 0
      templates/students_add_update.html.tpl

+ 1 - 0
go.mod

@@ -14,6 +14,7 @@ require (
 	github.com/jinzhu/gorm v1.9.16
 	github.com/jinzhu/inflection v1.0.0
 	github.com/remogatto/cloud v0.0.0-20200423094407-c201f07eb401
+	github.com/remogatto/prettytest v0.0.0-20200211072524-6d385e11dcb8
 	github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964
 	github.com/robfig/cron v1.2.0
 	github.com/sethvargo/go-password v0.2.0

+ 4 - 0
go.sum

@@ -37,9 +37,12 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr
 github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
 github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 github.com/remogatto/cloud v0.0.0-20200423094407-c201f07eb401 h1:OrdrWowKbZqDQNdilFyiCtn7sUix9ocn/pO9VuimA4o=
 github.com/remogatto/cloud v0.0.0-20200423094407-c201f07eb401/go.mod h1:84Ak6wMU0H33hglQdkwyFJob+r0lRiQhtBiekhNrgL8=
+github.com/remogatto/prettytest v0.0.0-20200211072524-6d385e11dcb8 h1:nRDwTcxV9B3elxMt+1xINX0bwaPdpouqp5fbynexY8U=
+github.com/remogatto/prettytest v0.0.0-20200211072524-6d385e11dcb8/go.mod h1:jOEnp79oIHy5cvQSHeLcgVJk1GHOOHJHQWps/d1N5Yo=
 github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964 h1:nr+J2/lD7hrKuUU37aaW5GMjnTN9SWcPOZm8bOhw7lk=
 github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964/go.mod h1:hYhX1i+/93J3gTMZFUL96Mf/45LmfRZTunoLYPwaHTA=
 github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
@@ -67,6 +70,7 @@ gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gG
 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
 gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
 gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=

+ 3 - 0
orm/student.go

@@ -18,6 +18,9 @@ type Student struct {
 	DSA      bool
 	BES      bool
 
+	FatherLastname  string
+	FatherFirstname string
+
 	TutorID uint `schema:"tutor_id"`
 	ClassID uint `schema:"class_id"`
 

+ 3 - 0
templates/students_add_update.html.tpl

@@ -41,6 +41,9 @@
     {{$options := ` { name: "BES",id: "student_bes",label: "BES (L. 170/10)",formClass: "form-group form-check" } `}}
     {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "BES") "update" $update}}
 
+    {{$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 := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Student"} ` }}
     {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}  
   </form>