Coach Schedule: same This week/Next week/month-divider agenda grouping

Extracted the grouping algorithm (previously duplicated between mobile.views.
CalendarView and management.views.EventListView's own "List" mode) into a
shared events.services.calendar.agenda_groups, and wired it into both --
plus mobile.coach_views.CoachScheduleView, the coach app's own upcoming-
events screen, which had no grouping at all before (one flat card). All
three now read identically and can't drift apart.

Also: give each management event-list row's kind badge a fixed width, so
titles start at the same horizontal position regardless of whether the row
says "Game" or "Tournament".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-23 17:27:56 +02:00
parent a13ab20a0f
commit 6f16737bd9
13 changed files with 211 additions and 88 deletions

View File

@@ -5625,7 +5625,7 @@ class EventManagementTests(ManagementTestBase):
self.assertEqual([event.title for event in response.context["list_next_week"]], ["Next week event"])
later_months = response.context["list_months"]
self.assertEqual(len(later_months), 1)
self.assertEqual([event.title for event in later_months[0]["events"]], ["Later event"])
self.assertEqual([event.title for event in later_months[0]["items"]], ["Later event"])
self.assertContains(response, "This week")
self.assertContains(response, "Next week")
self.assertContains(response, later_event.start.strftime("%B %Y"))
@@ -5640,7 +5640,7 @@ class EventManagementTests(ManagementTestBase):
self.assertEqual(response.context["list_this_week"], [])
self.assertEqual(response.context["list_next_week"], [])
self.assertEqual(len(response.context["list_months"]), 1)
self.assertEqual([event.title for event in response.context["list_months"][0]["events"]], ["Past event"])
self.assertEqual([event.title for event in response.context["list_months"][0]["items"]], ["Past event"])
self.assertNotContains(response, "This week")
def test_the_dashboard_only_shows_upcoming_events_for_managed_teams(self):