Busiest hours count players; fewer descriptions; no Verified badges

Busiest hours and the heatmap count the different players on T or CT in
each hour, open segments included, instead of averaging player-hours, so
one player for part of an hour is 1, not 0.38. Their descriptions end in
the span covered (Last 30 days, or Since <date>). Side-by-side chart panels
match heights, and Players per day notes its busiest day.

Dropped the page descriptions on Bans, Gags & mutes, Staff and Playtime,
and the Verified badges on the staff Overview scoreboard and drawer header;
the Verification page and the drawer's Verification section still show it.
The GroupVerify DB test now checks the staff drawer, since the public site
says nothing about verification.
This commit is contained in:
Astra 2026-10-04 22:49:12 +01:00
parent 2516759fa9
commit ba61708bed
11 changed files with 88 additions and 81 deletions

View file

@ -176,8 +176,9 @@ func TestVerifyDB(t *testing.T) {
if got := verified("/api/admin/players/"+sid, mod); got != want {
t.Errorf("staff view of %s: verified %v, want %v", sid, got, want)
}
if got := verified("/api/public/players/"+sid, ""); got != want {
t.Errorf("public view of %s: verified %v, want %v", sid, got, want)
// The public site never says whether anyone is verified.
if _, out := call("GET", "/api/public/players/"+sid, "", nil); out["verified"] != nil {
t.Errorf("public view of %s says verified %v", sid, out["verified"])
}
}
@ -186,17 +187,17 @@ func TestVerifyDB(t *testing.T) {
expect(200, code, out, "remove override")
code, out = call("DELETE", "/api/admin/verify/overrides/"+charlie, mod, nil)
expect(404, code, out, "remove it again")
if verified("/api/public/players/"+charlie, "") {
if verified("/api/admin/players/"+charlie, mod) {
t.Error("still verified after removing the override")
}
// Turned off, nobody is verified, publicly or for staff.
// Turned off, nobody is verified.
code, out = call("POST", "/api/admin/verify/settings", owner, map[string]any{"enabled": false})
expect(200, code, out, "turn off")
if !strings.Contains(out["message"].(string), "off") {
t.Errorf("turn-off message %q", out["message"])
}
if verified("/api/public/players/"+member, "") || verified("/api/admin/players/"+member, mod) {
if verified("/api/admin/players/"+member, mod) {
t.Error("verified while GroupVerify is off")
}
@ -214,7 +215,7 @@ func TestVerifyDB(t *testing.T) {
if want := time.Now().Add(24 * time.Hour).In(tokyo).Format("2006-01-02 15:04"); raw != want && raw != time.Now().Add(24*time.Hour+time.Minute).In(tokyo).Format("2006-01-02 15:04") {
t.Errorf("expires_at %s, want Tokyo wall time %s", raw, want)
}
if !verified("/api/public/players/"+charlie, "") {
if !verified("/api/admin/players/"+charlie, mod) {
t.Error("override in Tokyo time isn't counted")
}
@ -230,7 +231,4 @@ func TestVerifyDB(t *testing.T) {
if _, out := call("GET", "/api/admin/players/"+charlie, mod, nil); out["verify"] != nil {
t.Errorf("player drawer has verify %v without the tables", out["verify"])
}
if verified("/api/public/players/"+charlie, "") {
t.Error("publicly verified without the tables")
}
}