feat: Token.BAND (Wristband) — non-admin variant of PASS, admin-awarded via Django admin to any user (NOT auto-granted on signal, NO is_staff coupling, NO model-layer guard). Mirrors PASS at runtime — fills 1 gate slot, never consumed, stays equipped, no current_room tie, no expiry, no In-Use microtooltip — but separates the policy concerns so PASS stays a deliberate staff-only trinket while BAND becomes the regular-user version (promotional / play-reward / staging give-away). Tooltip prose: name "Wristband", desc "Admit All Entry" (shared w. PASS — phrasing reflects the never-depleted lifetime, not multi-slot semantics), shoptalk "Unlimited free entry (BYOB)", expiry "no expiry". fa-ring icon across all 4 surfaces (Game Kit applet #id_kit_wristband between PASS + CARTE, gk-trinkets section, kit-bag dialog Trinket slot, wallet PASS→BAND→COIN elif chain). Priority chain — PASS → BAND → COIN → FREE → TITHE — wired identically into both apps.epic.models.select_token (room gatekeeper) + apps.gameboard.models._select_my_sea_token (my-sea gatekeeper); BAND wins over consumables for any holder while PASS still wins for staff who happen to hold both. debit_token + debit_my_sea_token treat BAND same as PASS: slot marked FILLED w. debited_token_type=BAND, token row preserved, current_room untouched, equipped_trinket unchanged. View contexts (gameboard, toggle_game_applets, _game_kit_context, wallet, toggle_wallet_applets) pass a band key — universal lookup, NO is_staff filter. Migration lyric/0007_alter_token_token_type — choices-only AlterField. TDD — 5 FTs in test_trinket_wristband.py (test_band_not_auto_equipped_after_award, test_band_tooltip_renders_full_prose, test_band_uses_fa_ring_icon, test_equipped_band_shows_equipped_mini_tooltip, test_equipped_band_shows_doff_active_don_disabled); 4 tooltip UTs (BandTokenTooltipTest); 5 model ITs (BandTokenAdminAwardTest — no-auto-grant for non-staff + staff, admin-can-award to either branch, not-auto-equipped); 2 priority-chain ITs (test_returns_band_when_held_and_no_pass, test_pass_still_wins_over_band_for_staff); 1 debit IT (test_debit_band_does_not_consume_or_unequip). 1145 IT/UT + 5 FT green. A boost-pass / promo-band w. richer semantics (multi-slot admit, time-window, etc.) lands as YET-ANOTHER token_type later — keep BAND the minimal "PASS minus admin gate" trinket so the policy axis stays clean. Captured in [[sprint-band-trinket-may21]] alongside the standing auto-commit rule [[feedback-auto-commit-after-build]]
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ GAMEBOARD_APPLET_ORDER = [
|
||||
@login_required(login_url="/")
|
||||
def gameboard(request):
|
||||
pass_token = request.user.tokens.filter(token_type=Token.PASS).first() if request.user.is_staff else None
|
||||
band = request.user.tokens.filter(token_type=Token.BAND).first()
|
||||
coin = request.user.tokens.filter(token_type=Token.COIN).first()
|
||||
carte = request.user.tokens.filter(token_type=Token.CARTE).first()
|
||||
free_tokens = list(request.user.tokens.filter(
|
||||
@@ -47,6 +48,7 @@ def gameboard(request):
|
||||
return render(
|
||||
request, "apps/gameboard/gameboard.html", {
|
||||
"pass_token": pass_token,
|
||||
"band": band,
|
||||
"coin": coin,
|
||||
"carte": carte,
|
||||
"equipped_trinket_id": request.user.equipped_trinket_id,
|
||||
@@ -71,6 +73,7 @@ def toggle_game_applets(request):
|
||||
return render(request, "apps/gameboard/_partials/_applets.html", {
|
||||
"applets": applet_context(request.user, "gameboard"),
|
||||
"pass_token": request.user.tokens.filter(token_type=Token.PASS).first() if request.user.is_staff else None,
|
||||
"band": request.user.tokens.filter(token_type=Token.BAND).first(),
|
||||
"coin": request.user.tokens.filter(token_type=Token.COIN).first(),
|
||||
"carte": request.user.tokens.filter(token_type=Token.CARTE).first(),
|
||||
"equipped_trinket_id": request.user.equipped_trinket_id,
|
||||
@@ -133,6 +136,7 @@ def _game_kit_context(user):
|
||||
from apps.lyric.models import PRONOUN_CHOICES
|
||||
coin = user.tokens.filter(token_type=Token.COIN).first()
|
||||
pass_token = user.tokens.filter(token_type=Token.PASS).first() if user.is_staff else None
|
||||
band = user.tokens.filter(token_type=Token.BAND).first()
|
||||
carte = user.tokens.filter(token_type=Token.CARTE).first()
|
||||
free_tokens = list(user.tokens.filter(
|
||||
token_type=Token.FREE, expires_at__gt=timezone.now()
|
||||
@@ -145,6 +149,7 @@ def _game_kit_context(user):
|
||||
return {
|
||||
"coin": coin,
|
||||
"pass_token": pass_token,
|
||||
"band": band,
|
||||
"carte": carte,
|
||||
"free_tokens": free_tokens,
|
||||
"tithe_tokens": tithe_tokens,
|
||||
|
||||
Reference in New Issue
Block a user