Add referee assignment/eligibility system, team bulk-add, member Groups, and referee management dashboard with PDF export

Builds the referee workflow end to end: club-defined RefereeLevel/RefereeProfile
eligibility tied to teams, EventReferee assignment (member or external, with
fee/km payment tracking), an admin dashboard with KPI tiles, date-grouped game
tiles and range filters, and a downloadable payment form PDF modeled on the
club's existing paper document (using Club.legal_name when set). Also lands
team roster bulk-add, member mass-upload with family linking, and the
members.Group model, developed alongside this work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-09 21:39:19 +02:00
parent 86e28c317f
commit 309bd4d83e
54 changed files with 4574 additions and 88 deletions

View File

@@ -1,7 +1,7 @@
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from .models import Position, StaffAssignment, Team, TeamMembership, TeamPhoto
from .models import Position, RefereeLevel, RefereeProfile, StaffAssignment, Team, TeamMembership, TeamPhoto
class TeamMembershipInline(admin.TabularInline):
@@ -29,8 +29,8 @@ class TeamPhotoInline(admin.TabularInline):
@admin.register(Team)
class TeamAdmin(admin.ModelAdmin):
list_display = ["name", "short_name", "club"]
list_filter = ["club"]
list_display = ["name", "short_name", "club", "referee_management"]
list_filter = ["club", "referee_management"]
search_fields = ["name", "short_name"]
inlines = [TeamMembershipInline, StaffAssignmentInline, TeamPhotoInline]
@@ -68,3 +68,28 @@ class StaffAssignmentAdmin(admin.ModelAdmin):
list_filter = ["team", "season", "position"]
search_fields = ["team__name", "member__first_name", "member__last_name"]
raw_id_fields = ["member"]
@admin.register(RefereeLevel)
class RefereeLevelAdmin(admin.ModelAdmin):
list_display = ["name", "club", "ordering", "team_list"]
list_filter = ["club"]
search_fields = ["name"]
autocomplete_fields = ["teams"]
ordering = ["club", "ordering", "name"]
@admin.display(description=_("teams"))
def team_list(self, obj):
return ", ".join(team.name for team in obj.teams.all())
@admin.register(RefereeProfile)
class RefereeProfileAdmin(admin.ModelAdmin):
list_display = ["member", "level", "valid_until", "is_eligible"]
list_filter = ["level"]
search_fields = ["member__first_name", "member__last_name"]
autocomplete_fields = ["member"]
@admin.display(description=_("eligible"), boolean=True)
def is_eligible(self, obj):
return obj.is_eligible