From 89c4072a3552978aa9dbff0e2535fb819486c679 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 10 Nov 2025 22:42:19 +0000 Subject: [PATCH] Add phone call page Just mocks, and probably not great ones at that. --- endpoint.go | 4 + html.go | 11 + main.go | 1 + templates/authenticated.html | 2 + templates/base.html | 4 +- templates/phone-call.html | 417 +++++++++++++++++++++++++++++++++++ 6 files changed, 438 insertions(+), 1 deletion(-) create mode 100644 templates/phone-call.html diff --git a/endpoint.go b/endpoint.go index 7bdb3030..d2d73e72 100644 --- a/endpoint.go +++ b/endpoint.go @@ -42,6 +42,10 @@ func getFavicon(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "static/favicon.ico") } +func getPhoneCall(w http.ResponseWriter, r *http.Request) { + htmlPhoneCall(w) +} + func getQRCodeReport(w http.ResponseWriter, r *http.Request) { code := chi.URLParam(r, "code") if code == "" { diff --git a/html.go b/html.go index 9b92022d..73e95227 100644 --- a/html.go +++ b/html.go @@ -22,6 +22,7 @@ import ( var ( dashboard = newBuiltTemplate("dashboard", "authenticated") oauthPrompt = newBuiltTemplate("oauth-prompt", "authenticated") + phoneCall = newBuiltTemplate("phone-call", "base") report = newBuiltTemplate("report", "base") reportConfirmation = newBuiltTemplate("report-confirmation", "base") reportContribute = newBuiltTemplate("report-contribute", "base") @@ -52,6 +53,9 @@ type Link struct { Href string Title string } +type ContentPhoneCall struct { + DistrictName string +} type ContentReportDetail struct { NextURL string UpdateURL string @@ -185,6 +189,13 @@ func htmlOauthPrompt(w http.ResponseWriter, user *models.User) { renderOrError(w, oauthPrompt, data) } +func htmlPhoneCall(w http.ResponseWriter) { + data := ContentPhoneCall{ + DistrictName: "[District Name]", + } + renderOrError(w, phoneCall, data) +} + func htmlReport(w http.ResponseWriter) { url := BaseURL + "/report/t78fd3" data := ContentReportDiagnostic{ diff --git a/main.go b/main.go index 8296ea71..4eacc0c7 100644 --- a/main.go +++ b/main.go @@ -64,6 +64,7 @@ func main() { r.Get("/arcgis/oauth/begin", getArcgisOauthBegin) r.Get("/arcgis/oauth/callback", getArcgisOauthCallback) r.Get("/qr-code/report/{code}", getQRCodeReport) + r.Get("/phone-call", getPhoneCall) r.Get("/report", getReport) r.Get("/report/{code}", getReportDetail) r.Get("/report/{code}/confirm", getReportConfirmation) diff --git a/templates/authenticated.html b/templates/authenticated.html index 1a3509dc..6ff63c86 100644 --- a/templates/authenticated.html +++ b/templates/authenticated.html @@ -4,7 +4,9 @@ {{template "title" .}} - Nidus Sync + +