Let eligible referees self-serve sign-up for games needing one
Creating (or re-teaming) a home game for a club-managed team now auto- invites every eligible referee (teams.RefereeProfile) via a new RefereeSignup model, notifying them the same way news/events already do. They see it as its own distinct row on the mobile Calendar (own accent colour) and can accept or decline right there -- accepting routes through the existing capacity-checked assign_referee (assigned_by=None marks it self-service), so it lands as a real EventReferee row with no separate sync step. The desktop referee-management screen and event detail page both surface pending invites and flag self-signed-up referees distinctly from admin assignments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
@@ -3,8 +3,16 @@
|
||||
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, can_manage_referees, and an optional next_url to return to
|
||||
after a POST (defaults to the event detail page when blank).
|
||||
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
|
||||
@@ -33,7 +41,11 @@
|
||||
{% if referee.is_external %}<span class="badge badge-neutral badge-xs">{% trans "External" %}</span>{% endif %}
|
||||
{% if can_manage_referees and not referee.fee %}<span class="badge badge-warning badge-xs">{% trans "Fee not set" %}</span>{% endif %}
|
||||
</div>
|
||||
{% if referee.assigned_by %}<span class="text-xs text-muted">{% blocktrans with name=referee.assigned_by %}Assigned by {{ name }}{% endblocktrans %}</span>{% endif %}
|
||||
{% if referee.assigned_by %}
|
||||
<span class="text-xs text-muted">{% blocktrans with name=referee.assigned_by %}Assigned by {{ name }}{% endblocktrans %}</span>
|
||||
{% elif not referee.is_external %}
|
||||
<span class="badge badge-outline badge-xs w-fit">{% trans "Self sign-up" %}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if can_manage_referees %}
|
||||
@@ -76,6 +88,13 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if pending_signups %}
|
||||
<p class="mt-2 text-xs text-muted">
|
||||
{% 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 %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if can_manage_referees and not referees_full %}
|
||||
<div class="mt-3 flex flex-col gap-2 border-t border-rule pt-3">
|
||||
<span class="font-mono text-[11px] tracking-[.08em] text-dim uppercase">{% trans "Add a referee" %}</span>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
{% if game.opponent %}{% trans "vs" %} {{ game.opponent }}{% endif %}
|
||||
</h3>
|
||||
<div class="mb-4 font-mono text-sm text-muted">{{ game.start|date:"j M Y H:i" }}</div>
|
||||
{% include "management/_referee_assignment_panel.html" with event=game referees=game.referee_rows referee_candidates=game.referee_candidates referees_full=game.referees_full can_manage_referees=True next_url=request.get_full_path %}
|
||||
{% include "management/_referee_assignment_panel.html" with event=game referees=game.referee_rows referee_candidates=game.referee_candidates referees_full=game.referees_full pending_signups=game.pending_signups can_manage_referees=True next_url=request.get_full_path %}
|
||||
</div>
|
||||
<form method="dialog" class="modal-backdrop"><button>close</button></form>
|
||||
</dialog>
|
||||
|
||||
Reference in New Issue
Block a user