Move Sponsors to Finance and Referee management to Calendar in the sidebar

Sponsors sits better alongside Dues & billing than in Settings, and
Referee management is day-to-day operational work on games, so it
belongs with Events/Locations/Opponents rather than club-wide setup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
2026-08-20 09:34:28 +02:00
parent 45380dc282
commit 8fcbf3a310
3 changed files with 29 additions and 14 deletions

View File

@@ -165,7 +165,7 @@ _TOP_SECTION = {
"event_list": "calendar",
"location_list": "calendar",
"opponent_list": "calendar",
"sponsor_list": "settings",
"sponsor_list": "finance",
"product_list": "finance",
"order_list": "finance",
"discount_list": "finance",
@@ -176,7 +176,7 @@ _TOP_SECTION = {
"role_list": "settings",
"position_list": "settings",
"referee_level_list": "settings",
"referee_management": "settings",
"referee_management": "calendar",
}

View File

@@ -56,6 +56,11 @@
<a class="nav-subitem {% if nav == 'location_list' %}active{% endif %}" href="{% url 'management:location_list' %}">{% trans "Locations" %}</a>
<a class="nav-subitem {% if nav == 'opponent_list' %}active{% endif %}" href="{% url 'management:opponent_list' %}">{% trans "Opponents" %}</a>
{% endif %}
{% if is_club_admin or can_manage_members %}
<a class="nav-subitem flex items-center gap-2 {% if nav == 'referee_management' %}active{% endif %}" href="{% url 'management:referee_management' %}">{% trans "Referee management" %}
{% if games_missing_referees_count %}<span class="badge badge-error badge-xs">{{ games_missing_referees_count }}</span>{% endif %}
</a>
{% endif %}
</div>
{% endif %}
</div>
@@ -68,6 +73,7 @@
{% if nav_section == 'finance' %}
<div class="flex flex-col">
<a class="nav-subitem {% if nav == 'membership_list' %}active{% endif %}" href="{% url 'management:membership_list' %}">{% trans "Dues & billing" %}</a>
<a class="nav-subitem {% if nav == 'sponsor_list' %}active{% endif %}" href="{% url 'management:sponsor_list' %}">{% trans "Sponsors" %}</a>
{% if shop_enabled %}
<a class="nav-subitem {% if nav == 'product_list' %}active{% endif %}" href="{% url 'management:product_list' %}">{% trans "Products" %}</a>
<a class="nav-subitem {% if nav == 'order_list' %}active{% endif %}" href="{% url 'management:order_list' %}">{% trans "Orders" %}</a>
@@ -94,11 +100,7 @@
<a class="nav-subitem {% if nav == 'position_list' %}active{% endif %}" href="{% url 'management:position_list' %}">{% trans "Positions" %}</a>
{% endif %}
<a class="nav-subitem {% if nav == 'referee_level_list' %}active{% endif %}" href="{% url 'management:referee_level_list' %}">{% trans "Referee levels" %}</a>
<a class="nav-subitem flex items-center gap-2 {% if nav == 'referee_management' %}active{% endif %}" href="{% url 'management:referee_management' %}">{% trans "Referee management" %}
{% if games_missing_referees_count %}<span class="badge badge-error badge-xs">{{ games_missing_referees_count }}</span>{% endif %}
</a>
{% if is_club_admin %}
<a class="nav-subitem {% if nav == 'sponsor_list' %}active{% endif %}" href="{% url 'management:sponsor_list' %}">{% trans "Sponsors" %}</a>
{% if forms_enabled %}
<a class="nav-subitem {% if nav == 'form_list' %}active{% endif %}" href="{% url 'management:form_list' %}">{% trans "Forms" %}</a>
{% endif %}

View File

@@ -219,15 +219,28 @@ class ActiveNavHighlightTests(ManagementTestBase):
self.assertContains(response, f'class="nav-item active" href="{reverse("management:home")}"')
self.assertNotContains(response, f'class="nav-item active" href="{reverse("management:member_list")}"')
def test_roles_positions_and_referee_setup_pages_all_highlight_settings(self):
# Roles/Positions/Referee levels/Referee management moved out of Members/Teams
# and into Settings -- club-wide setup, not day-to-day people/roster work.
for name in ("role_list", "position_list", "referee_level_list", "referee_management"):
def test_roles_positions_and_referee_levels_pages_all_highlight_settings(self):
# Roles/Positions/Referee levels moved out of Members/Teams and into Settings --
# club-wide setup, not day-to-day people/roster work.
for name in ("role_list", "position_list", "referee_level_list"):
with self.subTest(name=name):
response = self.club_get(name)
self.assertContains(response, f'class="nav-item active" href="{reverse("management:club_settings")}"')
def test_referee_management_page_highlights_calendar(self):
# Referee management is the operational "who's covering this game" page, so it
# lives under Calendar with Events/Locations/Opponents, not under Settings.
response = self.club_get("referee_management")
self.assertContains(response, f'class="nav-item active" href="{reverse("management:event_list")}"')
def test_sponsor_list_page_highlights_finance(self):
# Sponsors sit under Finance, underneath Dues & billing.
response = self.club_get("sponsor_list")
self.assertContains(response, f'class="nav-item active" href="{reverse("management:membership_list")}"')
class SidebarThemingTests(ManagementTestBase):
"""The sidebar's own background/foreground follow Club.primary_color (base.html
@@ -4447,12 +4460,12 @@ class SponsorManagementTests(ManagementTestBase):
self.assertTrue(Sponsor.objects.filter(pk=sponsor.pk).exists())
def test_nav_only_shows_sponsors_for_an_admin(self):
# Sponsors lives under Settings' sub-nav now, which only expands on a
# Settings-section page -- see ActiveNavHighlightTests's sibling comments.
# Settings itself is admin-only, so a coach never reaches a page that would
# Sponsors lives under Finance's sub-nav now, which only expands on a
# Finance-section page -- see ActiveNavHighlightTests's sibling comments.
# Finance itself is admin-only, so a coach never reaches a page that would
# expand it in the first place -- club_get raises PermissionDenied for them.
self.client.force_login(self.admin_user)
self.assertContains(self.club_get("club_settings"), "Sponsors")
self.assertContains(self.club_get("membership_list"), "Sponsors")
self.client.force_login(self.coach_manager)
self.assertNotContains(self.club_get("home"), "Sponsors")