From 18e3b0306d3ceec61043813838893add5ed099bb Mon Sep 17 00:00:00 2001 From: Bernard Siebens Date: Mon, 3 Aug 2026 22:40:06 +0200 Subject: [PATCH] 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. --- management/templates/management/home.html | 207 +++++++++++++--------- management/tests.py | 26 +++ management/views.py | 4 +- static/css/app.css | 10 ++ 4 files changed, 167 insertions(+), 80 deletions(-) diff --git a/management/templates/management/home.html b/management/templates/management/home.html index 60e600a..c90073c 100644 --- a/management/templates/management/home.html +++ b/management/templates/management/home.html @@ -22,7 +22,7 @@ money-shaped renders below for non-admins, same line the nav already draws around the Shop section. {% endcomment %} -
+
{% lucide "user-x" size=16 %} {% trans "Teams without coach" %}
@@ -55,27 +55,6 @@
-
-
-
{% lucide "repeat" size=16 %} {% trans "Renewal rate" %}
-
- {% if attention.renewal_rate is None %} - {% trans "N/A" %} - {% else %} - {{ attention.renewal_rate }}% - {% endif %} -
-
- {% if attention.renewal_rate is None %} - {% trans "No previous season" %} - {% else %} - - {% endif %} -
-
-
-
{% lucide "user-check" size=16 %} {% trans "Attendance rate" %}
@@ -98,43 +77,71 @@
-
-
-
-

{% lucide "calendar" size=18 %} {% trans "Upcoming events" %}

- {% lucide "arrow-right" size=14 %} {% trans "View all" %} +
+
+
+
+

{% lucide "calendar" size=18 %} {% trans "Upcoming events" %}

+ {% lucide "arrow-right" size=14 %} {% trans "View all" %} +
+
+ + + {% for event in upcoming_events %} + + + + + + {% empty %} + + + + {% endfor %} + +
{{ event.start|date:"D j M, H:i" }}{{ event.title }}{{ event.get_kind_display|capfirst }}
{% trans "Nothing scheduled." %}
+
-
- - - {% for event in upcoming_events %} - - - - - - {% empty %} - - - - {% endfor %} - -
{{ event.start|date:"D j M, H:i" }}{{ event.title }}{{ event.get_kind_display|capfirst }}
{% trans "Nothing scheduled." %}
+
+ +
+
+
+

{% lucide "newspaper" size=18 %} {% trans "News" %}

+ {% lucide "arrow-right" size=14 %} {% trans "View all" %} +
+
+ + + {% for news_item in published_news %} + + + + + {% empty %} + + + + {% endfor %} + +
{{ news_item.published_at|date:"D j M" }}{{ news_item.title }}
{% trans "Nothing published yet." %}
+
-
-
-
-

{% lucide "user-plus" size=18 %} {% trans "Signups per month" %}

-

{% trans "New members against returning ones." %}

-
- + {% if is_club_admin %} +
+
+
+

{% lucide "user-plus" size=18 %} {% trans "Signups per month" %}

+

{% trans "New members against returning ones." %}

+
+ +
-
- {% if is_club_admin %} +

{% lucide "wallet" size=18 %} {% trans "Club fee status this season" %}

@@ -143,10 +150,23 @@
- {% endif %} -
-
+
+
+

{% lucide "repeat" size=18 %} {% trans "Renewal rate" %}

+ {% if attention.renewal_rate is None %} +

{% trans "No previous season to compare." %}

+ {% else %} +
+ +
+ {% endif %} +
+
+
+ {% endif %} + +
{% for group in groups %} {% if group.title != "Shop" or is_club_admin %}
@@ -170,44 +190,51 @@ {% block extra_body %} {% trans "New" as new_label %} {% trans "Returning" as returning_label %} + {% trans "Renewed" as renewed_label %} + {% trans "Not renewed" as not_renewed_label %} {{ charts|json_script:"chart-data" }} + {{ attention.renewal_rate|json_script:"renewal-rate-data" }}