diff --git a/endpoint.go b/endpoint.go index 83e1ac52..48e7604a 100644 --- a/endpoint.go +++ b/endpoint.go @@ -123,6 +123,14 @@ func getReportSchedule(w http.ResponseWriter, r *http.Request) { } } +func getReportUpdate(w http.ResponseWriter, r *http.Request) { + code := chi.URLParam(r, "code") + err := htmlReportUpdate(w, code) + if err != nil { + respondError(w, "Failed to generate report page", err, http.StatusInternalServerError) + } +} + func getRoot(w http.ResponseWriter, r *http.Request) { user, err := getAuthenticatedUser(r) if err != nil && !errors.Is(err, &NoCredentialsError{}) { diff --git a/html.go b/html.go index e271ad6f..d707055e 100644 --- a/html.go +++ b/html.go @@ -21,6 +21,7 @@ var ( reportDetail = newBuiltTemplate("report-detail", "base") reportEvidence = newBuiltTemplate("report-evidence", "base") reportSchedule = newBuiltTemplate("report-schedule", "base") + reportUpdate = newBuiltTemplate("report-update", "base") signin = newBuiltTemplate("signin", "base") signup = newBuiltTemplate("signup", "base") ) @@ -147,6 +148,14 @@ func htmlReportSchedule(w io.Writer, code string) error { return reportSchedule.ExecuteTemplate(w, data) } +func htmlReportUpdate(w io.Writer, code string) error { + nextURL := BaseURL + "/report/" + code + "/evidence" + data := ContentReportDetail{ + NextURL: nextURL, + } + return reportUpdate.ExecuteTemplate(w, data) +} + func htmlSignin(w io.Writer, errorCode string) error { data := ContentSignin{ InvalidCredentials: errorCode == "invalid-credentials", diff --git a/main.go b/main.go index 067d3305..e90f7173 100644 --- a/main.go +++ b/main.go @@ -65,6 +65,7 @@ func main() { r.Get("/report/{code}/contribute", getReportContribute) r.Get("/report/{code}/evidence", getReportEvidence) r.Get("/report/{code}/schedule", getReportSchedule) + r.Get("/report/{code}/update", getReportUpdate) r.Post("/signin", postSignin) r.Get("/signup", getSignup) r.Post("/signup", postSignup) diff --git a/templates/report-update.html b/templates/report-update.html new file mode 100644 index 00000000..e5446f32 --- /dev/null +++ b/templates/report-update.html @@ -0,0 +1,194 @@ +{{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; +} +.map-container { + height: 350px; + background-color: #e9ecef; + border-radius: 10px; + margin-bottom: 25px; + position: relative; + overflow: hidden; + border: 1px solid #dee2e6; +} +.map-placeholder { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-image: url('https://placehold.co/800x350/e9ecef/adb5bd?text=Interactive+Map'); + background-size: cover; + background-position: center; +} +.map-pin { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -100%); + color: #dc3545; + font-size: 30px; + filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.3)); +} +.map-instructions { + position: absolute; + bottom: 15px; + left: 50%; + transform: translateX(-50%); + background-color: rgba(255, 255, 255, 0.9); + padding: 10px 15px; + border-radius: 20px; + font-size: 14px; + box-shadow: 0 2px 5px rgba(0,0,0,0.2); + max-width: 90%; + text-align: center; +} +.or-divider { + display: flex; + align-items: center; + margin: 25px 0; + color: #6c757d; +} +.or-divider::before, .or-divider::after { + content: ''; + flex: 1; + border-bottom: 1px solid #dee2e6; +} +.or-divider::before { + margin-right: 15px; +} +.or-divider::after { + margin-left: 15px; +} +.info-box { + background-color: #e8f4f8; + border-left: 4px solid #0d6efd; + padding: 15px; + border-radius: 5px; + margin-bottom: 20px; +} +.info-box p:last-child { + margin-bottom: 0; +} +.form-section { + margin-bottom: 25px; +} +{{end}} +{{define "content"}} +
You can update the property location by either clicking on the map or entering an address below. Both methods will automatically update each other.
+If you need assistance, please contact Vector Control at (555) 123-4567
+