diff --git a/endpoint.go b/endpoint.go index 8d02f424..83e1ac52 100644 --- a/endpoint.go +++ b/endpoint.go @@ -83,6 +83,14 @@ func getReport(w http.ResponseWriter, r *http.Request) { } } +func getReportConfirmation(w http.ResponseWriter, r *http.Request) { + code := chi.URLParam(r, "code") + err := htmlReportConfirmation(w, code) + if err != nil { + respondError(w, "Failed to generate report page", err, http.StatusInternalServerError) + } +} + func getReportContribute(w http.ResponseWriter, r *http.Request) { code := chi.URLParam(r, "code") err := htmlReportContribute(w, code) diff --git a/html.go b/html.go index dc8f4e59..113fe469 100644 --- a/html.go +++ b/html.go @@ -16,6 +16,7 @@ import ( var ( dashboard = newBuiltTemplate("dashboard", "authenticated") report = newBuiltTemplate("report", "base") + reportConfirmation = newBuiltTemplate("report-confirmation", "base") reportContribute = newBuiltTemplate("report-contribute", "base") reportDetail = newBuiltTemplate("report-detail", "base") reportEvidence = newBuiltTemplate("report-evidence", "base") @@ -104,6 +105,14 @@ func htmlReport(w io.Writer) error { return report.ExecuteTemplate(w, data) } +func htmlReportConfirmation(w io.Writer, code string) error { + url := BaseURL + "/report/" + code + "/history" + data := ContentReportDiagnostic{ + URL: url, + } + return reportConfirmation.ExecuteTemplate(w, data) +} + func htmlReportContribute(w io.Writer, code string) error { nextURL := BaseURL + "/report/" + code + "/schedule" data := ContentReportDetail{ diff --git a/main.go b/main.go index 6608c971..067d3305 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,7 @@ func main() { r.Get("/qr-code/report/{code}", getQRCodeReport) r.Get("/report", getReport) r.Get("/report/{code}", getReportDetail) + r.Get("/report/{code}/confirm", getReportConfirmation) r.Get("/report/{code}/contribute", getReportContribute) r.Get("/report/{code}/evidence", getReportEvidence) r.Get("/report/{code}/schedule", getReportSchedule) diff --git a/templates/report-confirmation.html b/templates/report-confirmation.html new file mode 100644 index 00000000..b7cf2808 --- /dev/null +++ b/templates/report-confirmation.html @@ -0,0 +1,214 @@ +{{template "base.html" .}} + +{{define "title"}}Login{{end}} +{{define "style"}} + body { + background-color: #f8f9fa; + } + .page-container { + max-width: 800px; + margin: 0 auto; + padding: 20px; + } + .content-card { + background-color: white; + border-radius: 15px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + padding: 25px; + margin-bottom: 20px; + } + .logo-area { + text-align: center; + margin-bottom: 20px; + } + .logo-placeholder { + height: 50px; + max-width: 200px; + margin: 0 auto; + } + .success-icon { + font-size: 70px; + color: #198754; + margin-bottom: 20px; + display: block; + text-align: center; + } + .confirmation-title { + text-align: center; + margin-bottom: 30px; + } + .appointment-summary { + background-color: #e8f4f8; + border-left: 4px solid #0d6efd; + padding: 20px; + border-radius: 8px; + margin-bottom: 25px; + } + .appointment-details { + display: flex; + flex-wrap: wrap; + gap: 15px; + margin-top: 15px; + } + .appointment-detail { + flex: 1; + min-width: 150px; + padding: 10px; + background-color: #fff; + border-radius: 6px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + } + .detail-label { + font-size: 0.8rem; + text-transform: uppercase; + color: #6c757d; + font-weight: 600; + margin-bottom: 5px; + } + .detail-value { + font-weight: 600; + } + .contact-info { + background-color: #f8f9fa; + padding: 20px; + border-radius: 8px; + margin-top: 25px; + margin-bottom: 25px; + } + .contact-method { + display: flex; + align-items: center; + margin-bottom: 10px; + } + .contact-method i { + font-size: 1.2rem; + margin-right: 10px; + color: #0d6efd; + width: 25px; + text-align: center; + } + .tracking-link { + background-color: #e9f7ef; + border: 1px solid #d1e7dd; + border-left: 4px solid #198754; + padding: 15px; + border-radius: 8px; + margin-top: 20px; + display: flex; + justify-content: space-between; + align-items: center; + text-decoration: none; + color: inherit; + transition: all 0.2s; + } + .tracking-link:hover { + background-color: #d1e7dd; + box-shadow: 0 2px 5px rgba(0,0,0,0.1); + } + .confirmation-number { + background-color: #f8f9fa; + padding: 10px 15px; + border-radius: 6px; + font-family: monospace; + font-size: 1.2rem; + font-weight: 600; + letter-spacing: 1px; + } +{{end}} +{{define "content"}} +
Your green pool report has been successfully submitted.
+Our inspector will visit your property at the scheduled time:
+ +You can use the link below to track your report status and view the photos you've submitted.
+View photos and check for updates
+If you have any questions about your report or need to change your appointment, please contact us:
+ +Please include your confirmation number (GP-23685) in all correspondence.
+Thank you for helping keep our community safe from mosquito-borne diseases.
+