{% load i18n lucide ui %} {% comment %} Shared by the event detail page and the referee management dashboard -- context: event, referees (EventReferee rows -- fee/km/km_rate read straight off the model instance, no separate form object needed), referee_candidates, referees_full, pending_signups (RefereeSignup rows still INVITED -- the self-service counterpart, events.services.referees.sync_referee_invites/ accept_referee_signup), can_manage_referees, and an optional next_url to return to after a POST (defaults to the event detail page when blank). A referee row with no assigned_by (events.services.referees. accept_referee_signup passes assigned_by=None) is one who signed themselves up rather than one an admin picked -- flagged "Self sign-up" instead of "Assigned by ..." so that stays visible here without a separate screen. The fee is entered right here, inline, rather than behind a "Fee" button that opened a second (and on the dashboard, nested-inside-a-dialog) modal -- that extra click-through was the easiest way for a fee to slip past everyone's attention until PDF export time. Travel (km/rate) stays behind a small disclosure since most assignments never need it, but posts in the same form as the fee so there's still only one Save per referee. {% endcomment %}

{% lucide "flag" size=18 %} {% trans "Referees" %} {{ referees|length }} / {{ event.max_referees }}

{% if can_manage_referees %} {% lucide "file-down" size=12 %} {% trans "Referee form (PDF)" %} {% endif %}
{% if pending_signups %}

{% blocktrans count counter=pending_signups|length %}Invited, no response yet: {% plural %}Invited, no response yet: {% endblocktrans %} {% for signup in pending_signups %}{{ signup.member }}{% if not forloop.last %}, {% endif %}{% endfor %}

{% endif %} {% if can_manage_referees and not referees_full %}
{% trans "Add a referee" %} {% if referee_candidates %}
{% csrf_token %} {% if next_url %}{% endif %} {# No btn-sm: .select is height:2.25rem, matching plain .btn -- btn-sm would sit 6px shorter and misalign in the row. #}
{% else %}

{% trans "No eligible referees for this team yet." %} {% trans "Link a referee level to this team." %}

{% endif %}
{% csrf_token %} {% if next_url %}{% endif %} {# No btn-sm: .input is height:2.25rem, matching plain .btn -- btn-sm would sit 6px shorter and misalign in the row. #}

{% trans "⚠ = also expected at another event around this time -- shown as a warning, not blocked." %}

{% elif can_manage_referees and referees_full %}

{% trans "This game already has its maximum number of referees." %}

{% endif %}