all repos — honk @ b4311abcfa3dc6a6a81e556ec1f79c8a1fea6a82

my fork of honk

killing is mean. zonking is nicer.
Ted Unangst tedu@tedunangst.com
Sat, 01 Jun 2019 22:58:46 -0400
commit

b4311abcfa3dc6a6a81e556ec1f79c8a1fea6a82

parent

0ae8e6b5478a64f6888591267a5c3f7797a4891a

3 files changed, 15 insertions(+), 15 deletions(-)

jump to
M honk.gohonk.go

@@ -1055,7 +1055,7 @@ Name string

Wherefore string } -func killzone(w http.ResponseWriter, r *http.Request) { +func zonkzone(w http.ResponseWriter, r *http.Request) { db := opendatabase() userinfo := login.GetUserInfo(r) rows, err := db.Query("select zonkerid, name, wherefore from zonkers where userid = ?", userinfo.UserID)

@@ -1071,14 +1071,14 @@ zonkers = append(zonkers, z)

} templinfo := getInfo(r) templinfo["Zonkers"] = zonkers - templinfo["KillCSRF"] = login.GetCSRF("killitwithfire", r) + templinfo["ZonkCSRF"] = login.GetCSRF("zonkzonk", r) err = readviews.Execute(w, "zonkers.html", templinfo) if err != nil { log.Print(err) } } -func killitwithfire(w http.ResponseWriter, r *http.Request) { +func zonkzonk(w http.ResponseWriter, r *http.Request) { userinfo := login.GetUserInfo(r) itsok := r.FormValue("itsok") if itsok == "iforgiveyou" {

@@ -1087,7 +1087,7 @@ db := opendatabase()

db.Exec("delete from zonkers where userid = ? and zonkerid = ?", userinfo.UserID, zonkerid) bitethethumbs() - http.Redirect(w, r, "/killzone", http.StatusSeeOther) + http.Redirect(w, r, "/zonkzone", http.StatusSeeOther) return } wherefore := r.FormValue("wherefore")

@@ -1110,7 +1110,7 @@ if wherefore == "zonker" || wherefore == "zurl" || wherefore == "zword" {

bitethethumbs() } - http.Redirect(w, r, "/killzone", http.StatusSeeOther) + http.Redirect(w, r, "/zonkzone", http.StatusSeeOther) } func accountpage(w http.ResponseWriter, r *http.Request) {

@@ -1299,11 +1299,11 @@ loggedin.Use(login.Required)

loggedin.HandleFunc("/account", accountpage) loggedin.HandleFunc("/chpass", dochpass) loggedin.HandleFunc("/atme", homepage) - loggedin.HandleFunc("/killzone", killzone) + loggedin.HandleFunc("/zonkzone", zonkzone) loggedin.Handle("/honk", login.CSRFWrap("honkhonk", http.HandlerFunc(savehonk))) loggedin.Handle("/bonk", login.CSRFWrap("honkhonk", http.HandlerFunc(savebonk))) loggedin.Handle("/zonkit", login.CSRFWrap("honkhonk", http.HandlerFunc(zonkit))) - loggedin.Handle("/killitwithfire", login.CSRFWrap("killitwithfire", http.HandlerFunc(killitwithfire))) + loggedin.Handle("/zonkzonk", login.CSRFWrap("zonkzonk", http.HandlerFunc(zonkzonk))) loggedin.Handle("/saveuser", login.CSRFWrap("saveuser", http.HandlerFunc(saveuser))) loggedin.HandleFunc("/honkers", showhonkers) loggedin.HandleFunc("/h/{name:[[:alnum:]]+}", showhonker)
M views/header.htmlviews/header.html

@@ -17,7 +17,7 @@ <span><a href="/atme">@me</a></span>

<span><a href="/u/{{ .UserInfo.Username }}">{{ .UserInfo.Username }}</a></span> <span><a href="/honkers">honkers</a></span> <span><a href="/c">combos</a></span> -<span><a href="/killzone">killzone</a></span> +<span><a href="/zonkzone">zonkzone</a></span> <span><a href="/account">account</a></span> {{ else }} {{ if .ShowRSS }}
M views/zonkers.htmlviews/zonkers.html

@@ -2,9 +2,9 @@ {{ template "header.html" . }}

<main> <div class="info"> <p> -<form action="/killitwithfire" method="POST"> -<span class="title">kill another zonker</span> -<input type="hidden" name="CSRF" value="{{ .KillCSRF }}"> +<form action="/zonkzonk" method="POST"> +<span class="title">it's zonking time!</span> +<input type="hidden" name="CSRF" value="{{ .ZonkCSRF }}"> <p> <input tabindex=1 type="text" name="name" value="" autocomplete=off> - name <p>

@@ -19,16 +19,16 @@ <label for="iszonvoy">Zonvoy</label>

<p> <input type="radio" id="iszword" name="wherefore" value="zword"> <label for="iszword">Zword</label> -<p><input tabindex=1 type="submit" name="kill" value="kill"> +<p><br><input tabindex=1 type="submit" name="zonk" value="zonk!"> </form> </div> -{{ $killcsrf := .KillCSRF }} +{{ $zonkcsrf := .ZonkCSRF }} {{ range .Zonkers }} <section class="honk"> <p>What: {{ .Name }} <p>Where: {{ .Wherefore }} -<form action="/killitwithfire" method="POST"> -<input type="hidden" name="CSRF" value="{{ $killcsrf }}"> +<form action="/zonkzonk" method="POST"> +<input type="hidden" name="CSRF" value="{{ $zonkcsrf }}"> <input type="hidden" name="zonkerid" value="{{ .ID }}"> <input type="hidden" name="itsok" value="iforgiveyou"> <input type="submit" name="pardon" value="pardon">