From 1932ac1c388d4e77cf91df2d38468d7c590e6070 Mon Sep 17 00:00:00 2001 From: Immanuel Onyeka Date: Tue, 5 Sep 2023 21:54:15 -0400 Subject: [PATCH] correct file misnaming --- skouter.go | 27 ++++++-------- views/report/comparison.tpl | 70 +++++++++++++++++++++++++++++++++--- views/report/master.tpl | 5 ++- views/report/summary.tpl | 71 ++++--------------------------------- 4 files changed, 84 insertions(+), 89 deletions(-) diff --git a/skouter.go b/skouter.go index 1896873..121c0a9 100644 --- a/skouter.go +++ b/skouter.go @@ -162,6 +162,15 @@ type Estimate struct { Loans []Loan `json:"loans"` } +type Report struct { + Title string + Name string + Avatar string + Letterhead string + User User + Estimate Estimate +} + type Password struct { Old string `json:"old"` New string `json:"new"` @@ -1849,14 +1858,7 @@ func showPDF(w http.ResponseWriter, r *http.Request) { if err != nil { w.WriteHeader(500); return } users, err := queryUsers(db, 1) - info := struct { - Title string - Name string - Avatar string - Letterhead string - User User - Estimate Estimate - }{ + info := Report{ Title: "test PDF", Name: "idk-random-name", User: users[0], @@ -1905,14 +1907,7 @@ func getPdf(w http.ResponseWriter, db *sql.DB, r *http.Request) { } users, err := queryUsers(db, claims.Id) - info := struct { - Title string - Name string - Avatar string - Letterhead string - User User - Estimate Estimate - }{ + info := Report{ Title: "test PDF", Name: "idk-random-name", User: users[0], diff --git a/views/report/comparison.tpl b/views/report/comparison.tpl index 9531cba..91ffd99 100644 --- a/views/report/comparison.tpl +++ b/views/report/comparison.tpl @@ -1,9 +1,69 @@ {{define "comparison"}} -
-
-hello -
+
+ + +{{range $l := .Estimate.Loans}}{{end}} + + + + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + + {{range .Estimate.Loans}}{{end}} + + {{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + +{{range .Estimate.Loans}}{{end}} + + {{range .Estimate.Loans}}{{end}} + + {{range .Estimate.Loans}}{{end}} + + {{range .Estimate.Loans}}{{end}} + +
{{$l.Name}}
Type{{.Type.Name}}
Term{{.Term}} Years
Amortization{{.Amortization}}
Interest rate{{.Interest}}%
Monthly MI${{dollars .Mi.Premium}}/month
Real estate taxes${{dollars .Tax}}/month
Total monthly${{dollars .Result.TotalMonthly}}
Purchase price${{dollars $.Estimate.Price}}
Loan amount${{dollars .Amount}}
Down payment${{diff .Amount $.Estimate.Price}}
Closing costs${{dollars .Result.TotalFees}}
MI Premium${{.Mi.Upfront}}
Credits${{dollars .Result.TotalCredits}}
Cash to close${{dollars .Result.CashToClose}}
-{{end}} + +{{end}} diff --git a/views/report/master.tpl b/views/report/master.tpl index 15dcc8a..e846d59 100644 --- a/views/report/master.tpl +++ b/views/report/master.tpl @@ -12,7 +12,7 @@ Get an official quote before choosing a loan.

{{template "header" .}} -{{template "summary" .}} +{{template "comparison" .}}
@@ -21,9 +21,8 @@ Get an official quote before choosing a loan.

Get an official quote before choosing a loan.

{{template "header" .}} -{{template "comparison" .}} +{{template "summary" .}} -
-{{end}}