privacy policy per game
This commit is contained in:
parent
c92b96adc0
commit
7b10cad239
3 changed files with 53 additions and 7 deletions
|
@ -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)
|
||||
|
||||
|
|
16
tem/html/pages/privacy.html
Normal file
16
tem/html/pages/privacy.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{ template "head.html" .}}
|
||||
|
||||
<div style="height: 48px;"></div>
|
||||
<!-- <h1 style='width: 100%; word-wrap: break-word; hyphens: auto;'>
|
||||
{{ .Title }}
|
||||
<p>
|
||||
{{ .Desc }}
|
||||
</p>
|
||||
</h1> -->
|
||||
{{ template "title_desc.html" .}}
|
||||
|
||||
|
||||
<h2>policy</h2>
|
||||
<pre>{{ .Data.Game.PrivacyPolicy }}</pre>
|
||||
|
||||
<div style='height: 44px; width: 100%;'></div>
|
|
@ -12,6 +12,7 @@ type Game struct {
|
|||
Name string
|
||||
Desc string
|
||||
|
||||
PrivacyPolicy string
|
||||
Notes string
|
||||
}
|
||||
|
||||
|
@ -19,6 +20,7 @@ var Games = map[string]Game{
|
|||
"silo": {
|
||||
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
|
||||
|
@ -37,6 +39,7 @@ missiles fly in
|
|||
"snake": {
|
||||
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
|
||||
|
@ -45,6 +48,7 @@ and have to deal with your past choices`,
|
|||
"vien": {
|
||||
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,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue