Send the groups list Edit button to the group page, not the rename form

Every other list page with a detail view (Teams, Members, News, Events) has
Edit land on the overview; groups jumped straight to the rename form, skipping
the page where the members actually are. The group page already carries its own
Edit action, so nothing becomes unreachable.

The list pages that legitimately do go straight to a form -- Locations,
Opponents, Sponsors, Positions, Referee levels -- have no detail view at all,
which is why they stay as they are. Noted in the test so the inconsistency
doesn't read as one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 13:54:32 +02:00
parent 1d5286fbbf
commit ab1c703baf
2 changed files with 14 additions and 1 deletions

View File

@@ -27,7 +27,7 @@
<td>{{ group.member_count }}</td> <td>{{ group.member_count }}</td>
<td class="text-right"> <td class="text-right">
<div class="flex justify-end gap-1"> <div class="flex justify-end gap-1">
<a class="btn btn-outline btn-sm" href="{% url 'management:group_update' group.pk %}" aria-label="{% trans 'Edit' %}">{% lucide "pencil" size=14 %} {% trans "Edit" %}</a> <a class="btn btn-outline btn-sm" href="{% url 'management:group_detail' group.pk %}" aria-label="{% trans 'Edit' %}">{% lucide "pencil" size=14 %} {% trans "Edit" %}</a>
<button class="btn btn-sm btn-outline btn-error" type="button" onclick="document.getElementById('{{ group.pk|dom_id:"group_delete_modal" }}').showModal()" aria-label="{% trans 'Delete' %}">{% lucide "trash-2" size=14 %} {% trans "Delete" %}</button> <button class="btn btn-sm btn-outline btn-error" type="button" onclick="document.getElementById('{{ group.pk|dom_id:"group_delete_modal" }}').showModal()" aria-label="{% trans 'Delete' %}">{% lucide "trash-2" size=14 %} {% trans "Delete" %}</button>
</div> </div>
</td> </td>

View File

@@ -824,6 +824,19 @@ class GroupManagementTests(ManagementTestBase):
self.client.force_login(self.make_non_admin_coach()) self.client.force_login(self.make_non_admin_coach())
self.assertEqual(self.club_get("group_list").status_code, 403) self.assertEqual(self.club_get("group_list").status_code, 403)
def test_the_lists_edit_button_goes_to_the_group_page_not_straight_to_the_form(self):
# Same as Teams: Edit lands on the overview, which is where the members
# live, and offers its own Edit for the rename form. The list pages that
# do jump straight to a form (Locations, Opponents, Sponsors, Positions,
# Referee levels) have no detail page to land on at all.
group = Group.objects.create(club=self.club, name="Referees")
self.client.force_login(self.admin_user)
response = self.club_get("group_list")
self.assertContains(response, reverse("management:group_detail", args=[group.pk]))
self.assertNotContains(response, reverse("management:group_update", args=[group.pk]))
def test_admin_can_create_a_group(self): def test_admin_can_create_a_group(self):
self.client.force_login(self.admin_user) self.client.force_login(self.admin_user)