sort the zonkzone
This commit is contained in:
parent
423d018059
commit
bd2e7cf9c7
15
honk.go
15
honk.go
|
@ -1112,6 +1112,21 @@ func zonkzone(w http.ResponseWriter, r *http.Request) {
|
||||||
rows.Scan(&z.ID, &z.Name, &z.Wherefore)
|
rows.Scan(&z.ID, &z.Name, &z.Wherefore)
|
||||||
zonkers = append(zonkers, z)
|
zonkers = append(zonkers, z)
|
||||||
}
|
}
|
||||||
|
sort.Slice(zonkers, func (i, j int) bool {
|
||||||
|
w1 := zonkers[i].Wherefore
|
||||||
|
w2 := zonkers[j].Wherefore
|
||||||
|
if w1 == w2 {
|
||||||
|
return zonkers[i].Name < zonkers[j].Name
|
||||||
|
}
|
||||||
|
if w1 == "zonvoy" {
|
||||||
|
w1 = "zzzzzzz"
|
||||||
|
}
|
||||||
|
if w2 == "zonvoy" {
|
||||||
|
w2 = "zzzzzzz"
|
||||||
|
}
|
||||||
|
return w1 < w2
|
||||||
|
})
|
||||||
|
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
templinfo["Zonkers"] = zonkers
|
templinfo["Zonkers"] = zonkers
|
||||||
templinfo["ZonkCSRF"] = login.GetCSRF("zonkzonk", r)
|
templinfo["ZonkCSRF"] = login.GetCSRF("zonkzonk", r)
|
||||||
|
|
Loading…
Reference in New Issue