diff --git a/rmo/mock.go b/rmo/mock.go
index 7d6a6599..3e6874ce 100644
--- a/rmo/mock.go
+++ b/rmo/mock.go
@@ -17,11 +17,6 @@ var (
mockWaterT = buildTemplate("mock/water", "base")
)
-type ContentDistrict struct {
- Name string
- URLLogo string
- URLWebsite string
-}
type ContentMock struct {
District ContentDistrict
MapboxToken string
diff --git a/rmo/nuisance.go b/rmo/nuisance.go
index 5580daa4..3a66d23c 100644
--- a/rmo/nuisance.go
+++ b/rmo/nuisance.go
@@ -6,6 +6,7 @@ import (
"strconv"
"time"
+ "github.com/Gleipnir-Technology/nidus-sync/config"
"github.com/Gleipnir-Technology/nidus-sync/db"
"github.com/Gleipnir-Technology/nidus-sync/db/enums"
"github.com/Gleipnir-Technology/nidus-sync/db/models"
@@ -15,8 +16,12 @@ import (
"github.com/rs/zerolog/log"
)
-type ContextNuisance struct{}
-type ContextNuisanceSubmitComplete struct {
+type ContentNuisance struct {
+ District *ContentDistrict
+ MapboxToken string
+ URL ContentURL
+}
+type ContentNuisanceSubmitComplete struct {
ReportID string
}
@@ -29,7 +34,11 @@ func getNuisance(w http.ResponseWriter, r *http.Request) {
html.RenderOrError(
w,
Nuisance,
- ContextNuisance{},
+ ContentNuisance{
+ District: nil,
+ MapboxToken: config.MapboxToken,
+ URL: makeContentURL(),
+ },
)
}
func getNuisanceSubmitComplete(w http.ResponseWriter, r *http.Request) {
@@ -37,7 +46,7 @@ func getNuisanceSubmitComplete(w http.ResponseWriter, r *http.Request) {
html.RenderOrError(
w,
NuisanceSubmitComplete,
- ContextNuisanceSubmitComplete{
+ ContentNuisanceSubmitComplete{
ReportID: report,
},
)
diff --git a/rmo/root.go b/rmo/root.go
index b9edf4ab..a878e6ce 100644
--- a/rmo/root.go
+++ b/rmo/root.go
@@ -9,6 +9,11 @@ import (
"github.com/rs/zerolog/log"
)
+type ContentDistrict struct {
+ Name string
+ URLLogo string
+ URLWebsite string
+}
type ContentPrivacy struct {
Address string
Company string
@@ -56,7 +61,9 @@ func getRoot(w http.ResponseWriter, r *http.Request) {
html.RenderOrError(
w,
RootT,
- ContentRoot{},
+ ContentRoot{
+ URL: makeContentURL(),
+ },
)
}
@@ -68,11 +75,13 @@ func getTerms(w http.ResponseWriter, r *http.Request) {
html.RenderOrError(
w,
TermsT,
- ContentRoot{},
+ ContentRoot{
+ URL: makeContentURL(),
+ },
)
}
-func makeContentURL(slug string) ContentURL {
+func makeContentURL() ContentURL {
return ContentURL{
Nuisance: makeURL("nuisance"),
NuisanceSubmitComplete: makeURL("nuisance-submit-complete"),
diff --git a/rmo/routes.go b/rmo/routes.go
index 415fb836..41662d7e 100644
--- a/rmo/routes.go
+++ b/rmo/routes.go
@@ -8,12 +8,18 @@ import (
func Router() chi.Router {
r := chi.NewRouter()
r.Get("/", getRoot)
+ r.Get("/nuisance", getNuisance)
+ //r.Get("/district/{slug}", renderMock(mockDistrictRootT))
+ //r.Get("/district/{slug}/nuisance", renderMock(mockNuisanceT))
+ //r.Get("/district/{slug}/nuisance-submit-complete", renderMock(mockNuisanceSubmitCompleteT))
+ //r.Get("/district/{slug}/status", renderMock(mockStatusT))
+ //r.Get("/district/{slug}/water", renderMock(mockWaterT))
+
r.Get("/privacy", getPrivacy)
r.Get("/robots.txt", getRobots)
r.Get("/email", getEmailByCode)
r.Get("/image/{uuid}", getImageByUUID)
r.Route("/mock", addMockRoutes)
- r.Get("/nuisance", getNuisance)
r.Post("/nuisance-submit", postNuisance)
r.Get("/nuisance-submit-complete", getNuisanceSubmitComplete)
r.Get("/pool", getPool)
diff --git a/rmo/template.go b/rmo/template.go
index 3238b81b..470c2596 100644
--- a/rmo/template.go
+++ b/rmo/template.go
@@ -10,7 +10,7 @@ import (
//go:embed template/*
var embeddedFiles embed.FS
-var components = [...]string{"footer", "header", "photo-upload", "photo-upload-header"}
+var components = [...]string{"footer", "header-district", "header-rmo", "photo-upload", "photo-upload-header"}
func buildTemplate(files ...string) *html.BuiltTemplate {
subdir := "rmo"
diff --git a/rmo/template/component/header.html b/rmo/template/component/header-district.html
similarity index 62%
rename from rmo/template/component/header.html
rename to rmo/template/component/header-district.html
index 6679d739..b80301b8 100644
--- a/rmo/template/component/header.html
+++ b/rmo/template/component/header-district.html
@@ -1,11 +1,11 @@
-{{define "header"}}
+{{define "header-district"}}
+
+
Report areas with high adult mosquito activity causing discomfort or concern.
@@ -65,7 +65,7 @@Report any water that has been sitting for several days, where mosquitoes can live.
@@ -77,7 +77,7 @@Check on a previous request or view current mosquito activity in your area.
diff --git a/rmo/template/mock/nuisance.html b/rmo/template/mock/nuisance.html index aa2f88b6..83d02910 100644 --- a/rmo/template/mock/nuisance.html +++ b/rmo/template/mock/nuisance.html @@ -138,99 +138,6 @@ document.addEventListener('DOMContentLoaded', function() { }); {{end}} {{define "content"}} @@ -275,7 +182,7 @@ select.tall {The time when mosquitoes are active can help us identify the species and likely breeding sources.
diff --git a/rmo/template/nuisance.html b/rmo/template/nuisance.html index ccc5ee93..1f1a9e31 100644 --- a/rmo/template/nuisance.html +++ b/rmo/template/nuisance.html @@ -2,7 +2,14 @@ {{define "title"}}Nuisance{{end}} {{define "extraheader"}} + + + + + + {{end}} {{define "content"}} +{{if (eq .District nil)}} + {{template "header-rmo" .}} +{{else}} + {{template "header-district" .District}} +{{end}}While we don't spray for adult mosquitoes based on individual requests, your reports help us identify and eliminate breeding sources. Adult mosquito control is based on trap counts and disease testing. Your detailed information helps us prioritize our work and locate potential breeding sites.
-Have you noticed any of these common mosquito breeding sources in your area?
- -Mosquitoes can breed in as little as a bottle cap of water! Eliminating standing water is the most effective way to reduce mosquito populations.
+ +Have you noticed any of these common mosquito breeding sources in your area?
-Green pools, ponds, fountains, or birdbaths that aren't maintained
-Buckets, planters, toys, tires, or any items that collect rainwater
-Clogged gutters, flat roofs, or AC units that collect water
-Would you like our technicians to inspect for potential mosquito sources?
- -Request a technician to inspect your property for mosquito sources. We'll contact you to schedule a convenient time.
-Request a general inspection of your neighborhood. We'll survey the area for potential mosquito breeding sources.
-