Repository navigation
Commit 101d343
committed
Fix #1302: restore IP column on the public banlist for admins
The v2.0 redesign of `web/themes/default/page_bans.tpl` dropped the
per-row IP column entirely — even an `ADMIN_OWNER` user lost the
at-a-glance IP that v1.x rendered (gated on `is_admin()`). The page
handler (`web/pages/page.banlist.php`) was already computing
`$hideplayerips = Config::getBool('banlist.hideplayerips') &&
!$userbank->is_admin()` correctly, and `BanListView` was already
exposing `hideplayerips` + the per-row `ban_ip_raw` field, so the
fix is template-only:
- Reintroduce the IP `<th>` and per-row `<td>` on the desktop table,
gated on `{if !$hideplayerips}` (mirrors the existing
`{if !$hideadminname}` admin-name guard). `data-testid="ban-ip"`
hooks the cell for E2E specs.
- Mirror the same gate on the mobile `.ban-cards` block, surfacing
the IP under the SteamID line. `data-testid="ban-ip-mobile"` for
the responsive E2E.
- Bump the empty-state `colspan` from 9 to 10 to cover the maximum
render (Player, SteamID, IP, Reason, Server, Admin, Length,
Banned, Status, Actions). The wider colspan is harmless when
conditional columns hide.
- Add `.col-ip` to the existing `white-space: nowrap` rule in
`theme.css` so IPv4 strings don't wrap.
- Drop `$hideplayerips` from the EOF manifest now that it's
referenced for real in the template body.
Regression coverage:
- `web/tests/integration/BanListIpColumnTest.php` renders
`BanListView` end-to-end through Smarty and asserts on the HTML
in both directions (visible at `hideplayerips=false`, fully
suppressed at `hideplayerips=true`) plus the empty-state
`colspan="10"` invariant.
- `web/tests/e2e/specs/flows/banlist-ip-column.spec.ts` closes the
integration gap end-to-end: the seeded `admin/admin` storage
state seeds an IP-bearing ban via `bans.add` and asserts the IP
renders in the live desktop `<table>` (chromium project) AND the
mobile `.ban-cards` block (mobile-chromium project).1 parent a9bd72f commit 101d343
4 files changed
Lines changed: 459 additions & 2 deletions
File tree
- web
- tests
- e2e/specs/flows
- integration
- themes/default
- css
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
0 commit comments