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"}} diff --git a/rmo/template/component/header-rmo.html b/rmo/template/component/header-rmo.html new file mode 100644 index 00000000..912b6bba --- /dev/null +++ b/rmo/template/component/header-rmo.html @@ -0,0 +1,12 @@ +{{define "header-rmo"}} + + +{{end}} diff --git a/rmo/template/mock/district-root.html b/rmo/template/mock/district-root.html index f3069987..9a32b37c 100644 --- a/rmo/template/mock/district-root.html +++ b/rmo/template/mock/district-root.html @@ -53,7 +53,7 @@
- {{ template "svg/mosquito" }} + {{ template "mosquito-color.svg" }}

Report Mosquito Nuisance

Report areas with high adult mosquito activity causing discomfort or concern.

@@ -65,7 +65,7 @@
- {{ template "svg/pond" }} + {{ template "pond-color.svg" }}

Report Standing Water

Report any water that has been sitting for several days, where mosquitoes can live.

@@ -77,7 +77,7 @@
- {{ template "svg/check-report" }} + {{ template "check-report-color.svg" }}

Follow-up or Check Status

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 {
- {{ template "svg/mosquito" }} + {{ template "mosquito-color.svg" }}

Mosquito Activity Information

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}}
-

Report Mosquito Nuisance

@@ -152,24 +154,38 @@ document.addEventListener('DOMContentLoaded', function() {
- -
-
- -
-
-
+ +
+
+ +

Nuisance Location Information

+
+
+
+

You can select the location by address or by moving the marker on the map.

+
+
+ +
+
+ + +
+
+
+

You can also click on the map to mark the location precisely

+ + +
- + {{ template "mosquito-color.svg" }}

Mosquito Activity Information

- optional

The time when mosquitoes are active can help us identify the species and likely breeding sources.

@@ -227,260 +243,131 @@ document.addEventListener('DOMContentLoaded', function() {
- - -
- - -
-
-
Minor
- Occasional mosquito -
-
-
Moderate
- Regular presence -
-
-
Severe
- Many mosquitoes -
-
-
- Current selection: 3/5 -
-
- - - -
- -
-
- -

Potential Mosquito Sources

- optional -
-

Have you noticed any of these common mosquito breeding sources in your area?

- -
-
-
Did you know?
-

Mosquitoes can breed in as little as a bottle cap of water! Eliminating standing water is the most effective way to reduce mosquito populations.

+ +
+ +
+
+ +

Potential Mosquito Sources

-
+

Have you noticed any of these common mosquito breeding sources in your area?

-
- -
-
-
-
- -
-
Stagnant Water
-

Green pools, ponds, fountains, or birdbaths that aren't maintained

-
- - -
-
-
-
- - -
-
-
-
- -
-
Containers
-

Buckets, planters, toys, tires, or any items that collect rainwater

-
- - -
-
-
-
- - -
-
-
-
- -
-
Roof & Gutters
-

Clogged gutters, flat roofs, or AC units that collect water

-
- - -
-
-
-
-
- - - -
-
- - -
-
-
- - -
-
- -

Inspection Request

-
-

Would you like our technicians to inspect for potential mosquito sources?

- -
-
-
-
Property Inspection
-

Request a technician to inspect your property for mosquito sources. We'll contact you to schedule a convenient time.

-
- - -
-
-
- -
-
-
Neighborhood Inspection
-

Request a general inspection of your neighborhood. We'll survey the area for potential mosquito breeding sources.

-
- - -
-
-
-
- - -