room gate-view: reuse the gatekeeper token-slot modal — CONT GAME → hex when satisfied / rails-renew when lapsed — TDD

Redesign of the room gate-view per user-spec 2026-05-31: drop the custom
seat-circle + countdown; render the EXACT gatekeeper modal instead
(title panel + animated status-dots + token-slot rails + roles panel).

- roles-panel .btn-primary is CONT GAME (→ table hex, same target as the
  gear NVM) while the viewer's seat cost is current; absent once it
  lapses, reappears after renewal re-satisfies the cost
- .gate-status-text: "<n> Token(s) Deposited" (literal "(s)" + the shared
  . . . . dots loop) when satisfied; "Please Deposit Token" when not.
  <n> = the room's deposited (FILLED) slot count
- token slot: .claimed (static rails) when current; .active rails that
  POST to renew_token when lapsed
- seat circle + time-remaining removed — the hex's own .fa-chair carries
  seat status & user/seat tooltips land next sprint
- room_gate view trimmed to {room, cost_current, deposited_count,
  page_class}
- tests: RoomGateViewTest reworked (9) — CONT GAME→hex + deposited-count
  status + no renew-form when current; "Please Deposit Token" + renew
  rails + no CONT GAME when lapsed; NVM→hex; page-room; no seat/countdown
  markup. 510 epic tests green

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-31 23:21:58 -04:00
parent 65689295a7
commit e78ba730e3
3 changed files with 102 additions and 82 deletions

View File

@@ -464,24 +464,22 @@ def room_view(request, room_id):
def room_gate(request, room_id):
"""Room renewal gate-view — reachable mid-game (unlike `gatekeeper`,
which redirects to the table once `table_status` is set). GATE VIEW
(navbar + center supersession) routes here. Shows the viewer's own
seat/position circle, their token time-remaining, and a RENEW
affordance; the gear-menu NVM returns to the table hex, not /gameboard/.
Mirrors the my-sea gate-view (`my_sea_gate`) for the 3rd-person table."""
(navbar + center supersession) routes here. Reuses the gatekeeper's
token-slot modal: when the viewer's seat cost is current the roles
panel shows CONT GAME (→ table hex, same target as the gear NVM) and
the status reads "<n> Token(s) Deposited"; when the cost has lapsed the
rails go active to RENEW and the status reads "Please Deposit Token"
(no CONT GAME until the cost is satisfied again). The seat circle +
time-remaining live on the table hex / next-sprint user-seat tooltips,
so they're intentionally absent here (user-spec 2026-05-31)."""
room = Room.objects.get(id=room_id)
user_slot = room.gate_slots.filter(
gamer=request.user, status=GateSlot.FILLED
).first()
return render(request, "apps/gameboard/room_gate.html", {
"room": room,
"user_filled_slot": user_slot,
"cost_current": user_slot.cost_current if user_slot else True,
"cost_current_until": user_slot.cost_current_until if user_slot else None,
"grace_expires_at": user_slot.grace_expires_at if user_slot else None,
"in_renewal_grace": user_slot.in_renewal_grace if user_slot else False,
"slot_role_label": (
SLOT_ROLE_LABELS.get(user_slot.slot_number, "") if user_slot else ""
),
"deposited_count": room.gate_slots.filter(status=GateSlot.FILLED).count(),
"page_class": "page-gameboard page-room page-room-gate",
})