diff --git a/src/router/router.go b/src/router/router.go index dfb5c03..ce1c620 100644 --- a/src/router/router.go +++ b/src/router/router.go @@ -24,6 +24,7 @@ func New() *mux.Router { r.HandleFunc("/move/{hash}", moves.MoveHandler) r.HandleFunc("/games", games.Handler) r.HandleFunc("/game/{hash}", games.GameHandler) + r.HandleFunc("/game/{hash}/privacy", games.PrivacyHandler) r.HandleFunc("/projects", projects.Handler) r.HandleFunc("/project/{hash}", projects.ProjectHandler) diff --git a/tem/html/pages/privacy.html b/tem/html/pages/privacy.html new file mode 100644 index 0000000..59d1276 --- /dev/null +++ b/tem/html/pages/privacy.html @@ -0,0 +1,16 @@ +{{ template "head.html" .}} + +
+ +{{ template "title_desc.html" .}} + + +

policy

+
{{ .Data.Game.PrivacyPolicy }}
+ +
diff --git a/web/pages/games/games.go b/web/pages/games/games.go index 2edfac8..48a2509 100644 --- a/web/pages/games/games.go +++ b/web/pages/games/games.go @@ -12,13 +12,15 @@ type Game struct { Name string Desc string - Notes string + PrivacyPolicy string + Notes string } var Games = map[string]Game{ "silo": { - Name: "stretch silo", - Desc: "a stretch cursor 360 missile defense game", + Name: "stretch silo", + Desc: "a stretch cursor 360 missile defense game", + PrivacyPolicy: "we do not collect store or distribute any user data", Notes: `start with air raid sirens and shouted commands shilouttes in the night @@ -35,16 +37,18 @@ missiles fly in *ref typhon missile system`, }, "snake": { - Name: "snake in a box", - Desc: "vr snake zencore", + Name: "snake in a box", + Desc: "vr snake zencore", + PrivacyPolicy: "we do not collect store or distribute any user data", Notes: `cute happy go lucky eating stuff older and bigger and have to deal with your past choices`, }, "vien": { - Name: "vien", - Desc: "hordiculture", + Name: "vien", + Desc: "hordiculture", + PrivacyPolicy: "we do not collect store or distribute any user data", }, } @@ -87,3 +91,28 @@ func GameHandler(w http.ResponseWriter, r *http.Request) { data, ) } + +func PrivacyHandler(w http.ResponseWriter, r *http.Request) { + hash := mux.Vars(r)["hash"] + + game, ok := Games[hash] + if !ok { + w.WriteHeader(http.StatusNotFound) + return + } + + data := struct { + Hash string + Game Game + }{ + Hash: hash, + Game: game, + } + tem.Render( + w, r, + "privacy.html", + "privacy", + game.Name, + data, + ) +}