Redesign the management home page's KPIs and charts

Drop renewal rate from the top KPI bar; split "Upcoming events" in half
and add a "News" overview beside it (published items only, everyone
can see it, same as events). Signups-per-month, club fee status, and
renewal rate (now a pie chart matching the fee status one, not a bare
stat box) move into their own row and become admin-only like the fee
chart already was. The bottom stat-group row now sizes its columns to
how many groups actually render, instead of leaving a blank slot where
Shop would be for non-admins.
This commit is contained in:
2026-08-03 22:40:06 +02:00
parent 92686b0755
commit 18e3b0306d
4 changed files with 167 additions and 80 deletions

View File

@@ -1708,7 +1708,10 @@ class HomeViewTests(ManagementTestBase):
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'id="fees-chart"')
self.assertContains(response, 'id="signups-chart"')
self.assertContains(response, "Renewal rate")
self.assertContains(response, "Open carts")
self.assertContains(response, "md:grid-cols-4")
def test_non_admin_staff_does_not_see_the_financial_sections(self):
self.client.force_login(self.make_coach("coach6@example.com"))
@@ -1717,7 +1720,30 @@ class HomeViewTests(ManagementTestBase):
self.assertEqual(response.status_code, 200)
self.assertNotContains(response, 'id="fees-chart"')
self.assertNotContains(response, 'id="signups-chart"')
self.assertNotContains(response, "Renewal rate")
self.assertNotContains(response, "Open carts")
self.assertContains(response, "md:grid-cols-3")
def test_published_news_is_shown_to_everyone(self):
item = News.objects.create(club=self.club, title="Season kickoff", body="Body.")
item.publish()
self.client.force_login(self.make_coach("coach-news-home@example.com"))
response = self.club_get("home")
self.assertContains(response, "Season kickoff")
def test_a_draft_or_scheduled_news_item_is_not_shown_on_the_home_page(self):
draft = News.objects.create(club=self.club, title="Still a draft", body="Body.")
scheduled = News.objects.create(club=self.club, title="Scheduled for later", body="Body.")
scheduled.publish(at=timezone.now() + datetime.timedelta(days=7))
self.client.force_login(self.admin_user)
response = self.club_get("home")
self.assertNotContains(response, draft.title)
self.assertNotContains(response, scheduled.title)
def test_upcoming_events_are_listed_in_order_and_future_only(self):
now = timezone.now()