Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

comparison.tpl 2.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{define "comparison"}}
  2. <section id="comparison">
  3. <table>
  4. <thead><tr>
  5. <th></th>{{range $l := .Estimate.Loans}}<th>{{$l.Name}}</th>{{end}}
  6. </tr></thead>
  7. <tbody>
  8. <tr><td>Type</td>
  9. {{range .Estimate.Loans}}<td>{{.Type.Name}}</td>{{end}}</tr>
  10. <tr><td>Term</td>
  11. {{range .Estimate.Loans}}<td>{{.Term}} Years</td>{{end}}</tr>
  12. <tr><td>Amortization</td>
  13. {{range .Estimate.Loans}}<td>Fixed</td>{{end}}</tr>
  14. <tr><td>Interest rate</td>
  15. {{range .Estimate.Loans}}<td>{{.Interest}}%</td>{{end}}</tr>
  16. <tr><td>Loan payment</td>
  17. {{range .Estimate.Loans}}<td>${{dollars .Result.LoanPayment}}/month</td>{{end}}</tr>
  18. <tr><td>Monthly MI</td>
  19. {{range .Estimate.Loans}}<td>${{dollars .Mi.Premium}}/month</td>{{end}}</tr>
  20. <tr><td>Real estate taxes</td>
  21. {{range .Estimate.Loans}}<td>${{dollars .Tax}}/month</td>{{end}}</tr>
  22. <tr><td>Hazard insurance</td>
  23. {{range .Estimate.Loans}}<td>${{dollars .Hazard}}/month</td>{{end}}</tr>
  24. <tr class="total"><td>Total monthly</td>
  25. {{range .Estimate.Loans}}<td>${{dollars .Result.TotalMonthly}}</td>{{end}}</tr>
  26. <tr class="gap"></tr>
  27. <tr><td>Purchase price</td>
  28. {{range .Estimate.Loans}}<td>${{dollars $.Estimate.Price}}</td>{{end}}</tr>
  29. <tr><td>Loan amount</td>
  30. {{range .Estimate.Loans}}<td>${{dollars .Amount}}</td>{{end}}</tr>
  31. <tr><td>Down payment</td>
  32. {{range .Estimate.Loans}}<td>${{diff .Amount $.Estimate.Price }}</td>{{end}}</tr>
  33. <tr><td>Closing costs</td>
  34. {{range .Estimate.Loans}}<td>${{dollars .Result.TotalFees}}</td>{{end}}</tr>
  35. <tr><td>MI Premium</td>
  36. {{range .Estimate.Loans}}<td>${{dollars .Mi.Upfront}}</td>{{end}}</tr>
  37. <tr><td>Credits</td>
  38. {{range .Estimate.Loans}}<td>${{dollars .Result.TotalCredits}}</td>{{end}}</tr>
  39. <tr class="total"><td>Cash to close</td>
  40. {{range .Estimate.Loans}}<td>${{dollars .Result.CashToClose}}</td>{{end}}</tr>
  41. </tbody>
  42. </table>
  43. </section>
  44. <style scoped>
  45. table {
  46. width: 100%;
  47. margin-top: 20px;
  48. }
  49. tr.gap {
  50. height: 20px;
  51. }
  52. tr.total {
  53. text-decoration: underline;
  54. font-weight: bold;
  55. }
  56. table td:first-child {
  57. font-weight: bold;
  58. }
  59. tbody tr:nth-child(odd) {
  60. background: #F5F5F3;
  61. }
  62. table td {
  63. padding: 4px;
  64. }
  65. </style>
  66. {{end}}