quick add a list of all combos
This commit is contained in:
parent
0f329cfea1
commit
36b3f6e1e1
19
honk.go
19
honk.go
|
@ -975,6 +975,23 @@ func showhonkers(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func showcombos(w http.ResponseWriter, r *http.Request) {
|
||||||
|
userinfo := login.GetUserInfo(r)
|
||||||
|
templinfo := getInfo(r)
|
||||||
|
honkers := gethonkers(userinfo.UserID)
|
||||||
|
var combos []string
|
||||||
|
for _, h := range honkers {
|
||||||
|
combos = append(combos, h.Combos...)
|
||||||
|
}
|
||||||
|
combos = oneofakind(combos)
|
||||||
|
sort.Strings(combos)
|
||||||
|
templinfo["Combos"] = combos
|
||||||
|
err := readviews.Execute(w, "combos.html", templinfo)
|
||||||
|
if err != nil {
|
||||||
|
log.Print(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var handfull = make(map[string]string)
|
var handfull = make(map[string]string)
|
||||||
var handlock sync.Mutex
|
var handlock sync.Mutex
|
||||||
|
|
||||||
|
@ -1210,6 +1227,7 @@ func serve() {
|
||||||
"views/honkpage.html",
|
"views/honkpage.html",
|
||||||
"views/honkers.html",
|
"views/honkers.html",
|
||||||
"views/zonkers.html",
|
"views/zonkers.html",
|
||||||
|
"views/combos.html",
|
||||||
"views/honkform.html",
|
"views/honkform.html",
|
||||||
"views/honk.html",
|
"views/honk.html",
|
||||||
"views/login.html",
|
"views/login.html",
|
||||||
|
@ -1263,6 +1281,7 @@ func serve() {
|
||||||
loggedin.HandleFunc("/honkers", showhonkers)
|
loggedin.HandleFunc("/honkers", showhonkers)
|
||||||
loggedin.HandleFunc("/h/{name:[[:alnum:]]+}", showhonker)
|
loggedin.HandleFunc("/h/{name:[[:alnum:]]+}", showhonker)
|
||||||
loggedin.HandleFunc("/c/{name:[[:alnum:]]+}", showcombo)
|
loggedin.HandleFunc("/c/{name:[[:alnum:]]+}", showcombo)
|
||||||
|
loggedin.HandleFunc("/c", showcombos)
|
||||||
loggedin.Handle("/savehonker", login.CSRFWrap("savehonker", http.HandlerFunc(savehonker)))
|
loggedin.Handle("/savehonker", login.CSRFWrap("savehonker", http.HandlerFunc(savehonker)))
|
||||||
|
|
||||||
err = http.Serve(listener, mux)
|
err = http.Serve(listener, mux)
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
{{ template "header.html" . }}
|
||||||
|
<main>
|
||||||
|
<div class="info">
|
||||||
|
<p>combos
|
||||||
|
</div>
|
||||||
|
{{ range .Combos }}
|
||||||
|
<section class="honk">
|
||||||
|
<header>
|
||||||
|
<p style="font-size: 1.8em">{{ . }}
|
||||||
|
</header>
|
||||||
|
<p>honks: <a href="/c/{{ . }}" rel=noreferrer>{{ . }}</a>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
|
</main>
|
|
@ -16,6 +16,7 @@
|
||||||
<span><a href="/atme">@me</a></span>
|
<span><a href="/atme">@me</a></span>
|
||||||
<span><a href="/u/{{ .UserInfo.Username }}">{{ .UserInfo.Username }}</a></span>
|
<span><a href="/u/{{ .UserInfo.Username }}">{{ .UserInfo.Username }}</a></span>
|
||||||
<span><a href="/honkers">honkers</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="/killzone">killzone</a></span>
|
||||||
<span><a href="/logout?CSRF={{ .LogoutCSRF }}">logout</a></span>
|
<span><a href="/logout?CSRF={{ .LogoutCSRF }}">logout</a></span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
Loading…
Reference in New Issue