From b5395afe74d7b397e7c4d5884e936092ce341fb0 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 12 Feb 2026 21:06:35 +0000 Subject: [PATCH] Add basic stadia maps test --- html/template/sync/stadia.html | 48 ++++++++++++++++++++++++++++++++++ sync/dash.go | 16 ++++++++++++ sync/routes.go | 1 + 3 files changed, 65 insertions(+) create mode 100644 html/template/sync/stadia.html diff --git a/html/template/sync/stadia.html b/html/template/sync/stadia.html new file mode 100644 index 00000000..be8fad42 --- /dev/null +++ b/html/template/sync/stadia.html @@ -0,0 +1,48 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Stadia{{ end }} +{{ define "extraheader" }} + + + +{{ end }} +{{ define "content" }} + +
+ + +{{ end }} diff --git a/sync/dash.go b/sync/dash.go index 5ab0b36f..8aa91123 100644 --- a/sync/dash.go +++ b/sync/dash.go @@ -162,6 +162,22 @@ func getSource(w http.ResponseWriter, r *http.Request, u *models.User) { source(w, r, u, globalid) } +func getStadia(w http.ResponseWriter, r *http.Request, u *models.User) { + userContent, err := contentForUser(r.Context(), u) + if err != nil { + respondError(w, "Failed to get user content", err, http.StatusInternalServerError) + return + } + data := ContentDashboard{ + MapData: ComponentMap{ + MapboxToken: config.MapboxToken, + }, + URL: newContentURL(), + User: userContent, + } + html.RenderOrError(w, "sync/stadia.html", data) + +} func getTemplateTest(w http.ResponseWriter, r *http.Request) { html.RenderOrError(w, "sync/template-test.html", nil) } diff --git a/sync/routes.go b/sync/routes.go index 4db913e5..62c7a430 100644 --- a/sync/routes.go +++ b/sync/routes.go @@ -69,6 +69,7 @@ func Router() chi.Router { r.Method("GET", "/setting", auth.NewEnsureAuth(getSettings)) r.Method("GET", "/signout", auth.NewEnsureAuth(getSignout)) r.Method("GET", "/source/{globalid}", auth.NewEnsureAuth(getSource)) + r.Method("GET", "/stadia", auth.NewEnsureAuth(getStadia)) r.Method("GET", "/trap/{globalid}", auth.NewEnsureAuth(getTrap)) r.Method("GET", "/text/{destination}", auth.NewEnsureAuth(getTextMessages))