No-shows on the desktop member page, coach event screens, "+" popup polish
- management member_detail.html's Attendance card now shows the same No-shows count as the mobile player sheet, and the card's content (sparkline + tiles) fills the card's height/width instead of sitting in the top-left corner -- same flex-1/justify-center + stretched-tiles fix used there. - Coach mode's Attendance and Line-up screens (opening an event) now highlight the Schedule tab instead of Today -- that's the calendar-icon tab, and where a coach reaches either from CoachScheduleView's own rows. - The tab bar's "+" button: rotates 45° into an "×" while its popup is open (icon reused via CSS transform, no icon swap needed), the popup sits a little higher above the button (mb-3 -> mb-5), and a dark backdrop now covers the content behind it so the popup stands out. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -176,25 +176,29 @@
|
||||
{% if not attendance_sparkline %}
|
||||
<p class="text-sm text-muted">{% trans "No events yet this season." %}</p>
|
||||
{% else %}
|
||||
<div class="flex flex-wrap items-center gap-6">
|
||||
<div class="flex flex-1 flex-col justify-center gap-4">
|
||||
<div class="attendance-sparkline">
|
||||
{% for bar in attendance_sparkline %}
|
||||
<span class="attendance-bar attendance-bar-{{ bar.state }}" title="{{ bar.event.title }} — {{ bar.event.start|date:"j M" }}"></span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<div>
|
||||
<div class="flex">
|
||||
<div class="flex-1">
|
||||
<div class="font-display text-2xl leading-none font-extrabold text-ok tabular-nums">{{ attendance_counts.present }}</div>
|
||||
<div class="mt-1 font-display text-[11px] font-bold tracking-[.1em] text-muted uppercase">{% trans "Present" %}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex-1">
|
||||
<div class="font-display text-2xl leading-none font-extrabold text-club tabular-nums">{{ attendance_counts.absent }}</div>
|
||||
<div class="mt-1 font-display text-[11px] font-bold tracking-[.1em] text-muted uppercase">{% trans "Absent" %}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex-1">
|
||||
<div class="font-display text-2xl leading-none font-extrabold text-dim tabular-nums">{{ attendance_counts.no_reply }}</div>
|
||||
<div class="mt-1 font-display text-[11px] font-bold tracking-[.1em] text-muted uppercase">{% trans "No reply" %}</div>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<div class="font-display text-2xl leading-none font-extrabold text-warn-text tabular-nums">{{ attendance_counts.no_shows }}</div>
|
||||
<div class="mt-1 font-display text-[11px] font-bold tracking-[.1em] text-muted uppercase">{% trans "No-shows" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -418,6 +418,21 @@ class MemberAttendanceSparklineTests(ManagementTestBase):
|
||||
|
||||
self.assertEqual(response.context["attendance_counts"]["no_reply"], 1)
|
||||
|
||||
def test_a_present_rsvp_checked_in_as_absent_counts_as_a_no_show(self):
|
||||
self.make_attendance(status=Attendance.AttendanceStatus.PRESENT, start=timezone.now() - datetime.timedelta(days=2), showed_up=False)
|
||||
|
||||
response = self.club_get("member_detail", self.player.pk)
|
||||
|
||||
self.assertEqual(response.context["attendance_counts"]["no_shows"], 1)
|
||||
self.assertContains(response, "No-shows")
|
||||
|
||||
def test_an_unchecked_present_rsvp_is_not_a_no_show(self):
|
||||
self.make_attendance(status=Attendance.AttendanceStatus.PRESENT, start=timezone.now() - datetime.timedelta(days=2))
|
||||
|
||||
response = self.club_get("member_detail", self.player.pk)
|
||||
|
||||
self.assertEqual(response.context["attendance_counts"]["no_shows"], 0)
|
||||
|
||||
def test_the_sparkline_is_capped_at_twelve_bars_oldest_first(self):
|
||||
for day in range(15, 0, -1):
|
||||
self.make_attendance(status=Attendance.AttendanceStatus.PRESENT, start=timezone.now() - datetime.timedelta(days=day))
|
||||
|
||||
Reference in New Issue
Block a user