Make referee calendar rows tap-through links, like every other row

Accept/Decline now lives only on the event detail page's own "Refereeing"
card (same signup) -- the calendar row is just a link to the event, same
interaction model as every other row on M3's Calendar, instead of carrying
its own inline buttons.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
2026-08-22 18:57:50 +02:00
parent 5ef6ea5529
commit e13b17707c
2 changed files with 15 additions and 28 deletions

View File

@@ -12,13 +12,12 @@
Expects ``row`` ({event, referee_signup, referee_member}) in scope --
referee_member is only set once there's more than one managed person to
tell apart, same rule mobile/_calendar_row.html's own ``member`` uses.
Accept/Decline are two small forms, not a single multi-button one --
and, unlike this app's RSVP forms, boosted (no hx-boost="false"):
nothing here is Alpine-owned/toggled, so there's no htmx/Alpine conflict
to dodge, and a boosted POST avoids the jarring full-page reload a plain
form submit would cause on a page the user is mid-scroll on.
Just a link to the event, same as every other calendar row -- no
Accept/Decline here; event_detail.html's own "Refereeing" card (same
signup) is where that action lives, so this row and every other one
share one interaction model (tap through, act on the event page).
{% endcomment %}
<div class="flex items-center gap-3 bg-white px-4 py-3">
<a class="flex items-center gap-3 bg-white px-4 py-3" href="{% url "mobile:event_detail" row.event.pk %}">
<div class="w-9.5 shrink-0 text-center">
<div class="font-mono text-[10px] tracking-wide text-muted uppercase">{{ row.event.start|date:"D" }}</div>
<div class="font-display text-2xl leading-none font-extrabold text-ink">{{ row.event.start|date:"d" }}</div>
@@ -36,20 +35,7 @@
{% if row.event.location %}&middot; {{ row.event.location.name }}{% endif %}
</div>
</div>
{% if row.referee_signup.status == "accepted" %}
<span class="pill pill-referee shrink-0">{% trans "Confirmed" %}</span>
{% else %}
<div class="flex shrink-0 gap-1.5">
<form method="post" action="{% url "mobile:referee_signup_respond" row.referee_signup.pk %}">
{% csrf_token %}
<input type="hidden" name="response" value="accept">
<button type="submit" class="pill pill-referee">{% trans "I'll ref" %}</button>
</form>
<form method="post" action="{% url "mobile:referee_signup_respond" row.referee_signup.pk %}">
{% csrf_token %}
<input type="hidden" name="response" value="decline">
<button type="submit" class="pill pill-neutral">{% trans "Can't" %}</button>
</form>
</div>
{% endif %}
</div>
<span class="pill {% if row.referee_signup.status == "accepted" %}pill-referee{% else %}pill-neutral{% endif %} shrink-0">
{% if row.referee_signup.status == "accepted" %}{% trans "Confirmed" %}{% else %}{% trans "Reply needed" %}{% endif %}
</span>
</a>

View File

@@ -1044,7 +1044,8 @@ class CalendarRefereeSignupTests(TestCase):
response = self._get()
self.assertContains(response, "Referee")
self.assertContains(response, "I'll ref")
self.assertContains(response, "Reply needed")
self.assertContains(response, f'href="{reverse("mobile:event_detail", kwargs={"pk": self.game.pk})}"')
def test_declined_signup_is_not_shown(self):
signup = RefereeSignup.objects.get(event=self.game, member=self.member)
@@ -1054,9 +1055,9 @@ class CalendarRefereeSignupTests(TestCase):
response = self._get()
self.assertNotContains(response, "I'll ref")
self.assertNotContains(response, "Reply needed")
def test_accepted_signup_shows_a_confirmed_pill_with_no_actions(self):
def test_accepted_signup_shows_a_confirmed_pill(self):
signup = RefereeSignup.objects.get(event=self.game, member=self.member)
signup.status = RefereeSignup.Status.ACCEPTED
signup.save()
@@ -1065,14 +1066,14 @@ class CalendarRefereeSignupTests(TestCase):
response = self._get()
self.assertContains(response, "Confirmed")
self.assertNotContains(response, "I'll ref")
self.assertNotContains(response, "Reply needed")
def test_training_filter_excludes_referee_rows(self):
self.client.force_login(self.user)
response = self._get(kind="training")
self.assertNotContains(response, "I'll ref")
self.assertNotContains(response, "Reply needed")
def test_a_managed_childs_invite_shows_up_and_names_them(self):
family = Family.objects.create(name="Eree")