diff --git a/rmo/status.go b/rmo/status.go index 52b1cb67..3eceb5b9 100644 --- a/rmo/status.go +++ b/rmo/status.go @@ -30,6 +30,18 @@ type Contact struct { Name string Phone string } +type ContentStatus struct { + Error string + MapboxToken string + ReportID string + URL ContentURL +} +type ContentStatusByID struct { + MapboxToken string + Report Report + URL ContentURL +} + type Image struct { Location string URL string @@ -47,15 +59,6 @@ type Report struct { Type string } -type ContentStatus struct { - Error string - ReportID string -} -type ContentStatusByID struct { - MapboxToken string - Report Report -} - var ( Status = buildTemplate("status", "base") StatusByID = buildTemplate("status-by-id", "base") @@ -83,28 +86,21 @@ func formatReportID(s string) string { func getStatus(w http.ResponseWriter, r *http.Request) { report_id_str := r.URL.Query().Get("report") + content := ContentStatus{ + Error: "", + MapboxToken: config.MapboxToken, + ReportID: "", + URL: makeContentURL(nil), + } if report_id_str == "" { - html.RenderOrError( - w, - Status, - ContentStatus{ - Error: "", - ReportID: "", - }, - ) + html.RenderOrError(w, Status, content) return } report_id := sanitizeReportID(report_id_str) report_id_str = formatReportID(report_id) //some_report, e := report.FindSomeReport(r.Context(), report_id) - html.RenderOrError( - w, - Status, - ContentStatus{ - Error: "Sorry, we can't find that report", - ReportID: report_id_str, - }, - ) + content.Error = "Sorry, we can't find that report" + html.RenderOrError(w, Status, content) } func contentFromNuisance(ctx context.Context, report_id string) (result ContentStatusByID, err error) { nuisance, err := models.PublicreportNuisances.Query( @@ -206,6 +202,7 @@ func getStatusByID(w http.ResponseWriter, r *http.Request) { content, err = contentFromQuick(ctx, report_id) } content.MapboxToken = config.MapboxToken + content.URL = makeContentURL(nil) html.RenderOrError( w, StatusByID, diff --git a/rmo/template/mock/status.html b/rmo/template/mock/status.html index eeab00c5..c77492df 100644 --- a/rmo/template/mock/status.html +++ b/rmo/template/mock/status.html @@ -8,35 +8,6 @@ + + + + {{end}} {{define "content"}} -
- -
-
-

Check Status or Follow-up

-
-
- - -
-
-
-
-

- Choose one of the following options to check on mosquito activity or follow up on a previous report. -

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

Look up by Report ID

-

- If you have a report ID from a previous request, enter it below to view the details and current status. -

- -
-
- - -
Example: ABCD-1234-5678
- {{ if ne .Error "" }} - - {{ end }} -
-
- -
-
-
+
+ +
-
+ + + {{end}} diff --git a/scss/custom.scss b/scss/custom.scss index 3d4714c5..b9ded3a1 100644 --- a/scss/custom.scss +++ b/scss/custom.scss @@ -43,3 +43,4 @@ $theme-colors: map-merge( @import "./sidebar.scss"; @import "./rmo/nuisance.scss"; @import "./rmo/root.scss"; +@import "./rmo/status.scss"; diff --git a/scss/status.scss b/scss/status.scss new file mode 100644 index 00000000..cdf5161f --- /dev/null +++ b/scss/status.scss @@ -0,0 +1,30 @@ +.map-container { + background-color: #e9ecef; + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0,0,0,0.05); + height: 500px; + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; +} +#map { + height: 500px; + width:100%; + margin-bottom: 10px; +} +#map img { + max-width: none; + min-width: 0px; + height: auto; +} +.search-box { + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + border-radius: 8px; +} +@media (max-width: 768px) { + .map-container { + height: 300px; + } +} +