my_sea.html: persist burger + bud btns across all 3 phases — TDD
Bud + burger now render unconditionally on /gameboard/my-sea/ alongside the always-on gear-btn (was sprint-6c) + base-html kit-btn. Persists through sign-gate, landing, and picker phases so the user can reach the cross-cutting menu / invite affordance from every state. ## templates/apps/gameboard/my_sea.html 3 new includes/scripts placed at the bottom of `<div class="my-sea-page">` alongside the existing `_my_sea_gear.html`: - `_my_sea_bud_panel.html` — bud btn + slide-out (POSTs to `my_sea_invite` stub, same shape as on my_sea_gate.html) - `_burger.html` — burger btn + fan of 5 sub-btns - `<script src="...burger-btn.js">` — the delegated click + flash handler All unconditional (outside the if/else nesting that branches on user_has_sig / show_picker), so they survive every phase transition. ## apps/gameboard/tests/integrated/test_views.py 3 new ITs on MySeaViewTest — one per phase: - `test_my_sea_renders_bud_btn_and_burger_in_sign_gate_phase` (no significator) - `test_my_sea_renders_bud_btn_and_burger_in_landing_phase` (significator set, no draw) - `test_my_sea_renders_bud_btn_and_burger_in_picker_phase` (significator + empty MySeaDraw row + ?phase=picker) Each asserts both `id="id_bud_btn"` + `id="id_burger_btn"`. Sign-gate phase also asserts burger-btn.js loaded. ## Verification All 215 gameboard IT+UT green (+3 new). No JS / model touches; pure template additions. Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1002,6 +1002,41 @@ class MySeaViewTest(TestCase):
|
||||
self.assertIn("page-gameboard", response.content.decode())
|
||||
self.assertIn("page-my-sea", response.content.decode())
|
||||
|
||||
def test_my_sea_renders_bud_btn_and_burger_in_sign_gate_phase(self):
|
||||
"""Bud + burger persist on every my_sea.html state — sign-gate is
|
||||
the first phase (no significator yet, the page body is just the
|
||||
Brief banner). Both btns sit alongside the always-on gear-btn."""
|
||||
response = self.client.get(reverse("my_sea"))
|
||||
body = response.content.decode()
|
||||
self.assertIn('id="id_bud_btn"', body)
|
||||
self.assertIn('id="id_burger_btn"', body)
|
||||
self.assertIn("burger-btn.js", body)
|
||||
|
||||
def test_my_sea_renders_bud_btn_and_burger_in_landing_phase(self):
|
||||
from apps.epic.models import personal_sig_cards
|
||||
sig = personal_sig_cards(self.user)[0]
|
||||
self.user.significator = sig
|
||||
self.user.save(update_fields=["significator"])
|
||||
response = self.client.get(reverse("my_sea"))
|
||||
body = response.content.decode()
|
||||
self.assertIn('id="id_bud_btn"', body)
|
||||
self.assertIn('id="id_burger_btn"', body)
|
||||
|
||||
def test_my_sea_renders_bud_btn_and_burger_in_picker_phase(self):
|
||||
from apps.epic.models import personal_sig_cards
|
||||
from apps.gameboard.models import MySeaDraw
|
||||
sig = personal_sig_cards(self.user)[0]
|
||||
self.user.significator = sig
|
||||
self.user.save(update_fields=["significator"])
|
||||
MySeaDraw.objects.create(
|
||||
user=self.user, spread="situation-action-outcome",
|
||||
significator_id=sig.id, hand=[],
|
||||
)
|
||||
response = self.client.get(reverse("my_sea") + "?phase=picker")
|
||||
body = response.content.decode()
|
||||
self.assertIn('id="id_bud_btn"', body)
|
||||
self.assertIn('id="id_burger_btn"', body)
|
||||
|
||||
def test_sea_stage_stat_block_renders_rank_suit_chip_per_face(self):
|
||||
"""Sprint A.7.5 — `_sea_stage.html` modal scaffold (included from
|
||||
my_sea-picker-phase + the gameroom sea overlay) carries the new
|
||||
|
||||
@@ -1065,5 +1065,11 @@
|
||||
{# (sign-gate / landing / picker). NVM-only menu mirrors the #}
|
||||
{# gatekeeper's gear; "back out to /gameboard/" affordance. #}
|
||||
{% include "apps/gameboard/_partials/_my_sea_gear.html" %}
|
||||
{# Bud + burger persist across every stage too — same affordance #}
|
||||
{# as on the my-sea gatekeeper, so the user can invite + reach #}
|
||||
{# the cross-cutting menu from sign-gate / landing / picker alike.#}
|
||||
{% include "apps/gameboard/_partials/_my_sea_bud_panel.html" %}
|
||||
{% include "apps/gameboard/_partials/_burger.html" %}
|
||||
<script src="{% static 'apps/epic/burger-btn.js' %}"></script>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user