Add an "All" scope to the person switcher, default once there's a family
A lone member (or a parent of exactly one child) still lands straight on
their own record and never sees the switcher, same as before. The moment
there's more than one managed person, an "All" chip appears first and is
selected by default -- Home's cards (hero, needs-your-answer, dues) now
aggregate across everyone in scope instead of just one person, and
Calendar's own "My schedule" default does the same for its agenda.
PersonScopeMixin gains ``scope_everyone`` (bool) and ``people_in_scope``
(the effective list to filter by, regardless of which mode is active) --
kept separate from Calendar's own, unrelated ``?scope=all`` toggle
("every club event" vs. this "every person I manage"). Every RSVP form
now names its target member explicitly (``member_id``) rather than
relying on the old implicit "whoever is currently scoped" fallback, which
stops working the moment "All" -- not one person -- is the default.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<div class="text-sm font-semibold text-ink">{{ row.event.title }}</div>
|
||||
<div class="truncate text-xs text-muted">
|
||||
{{ row.event.start|date:"H:i" }}
|
||||
{% if row.member %}· {{ row.member.first_name }}{% endif %}
|
||||
{% for team in row.event.teams.all %}· {{ team.name }}{% endfor %}
|
||||
{% if row.event.location %}· {{ row.event.location.name }}{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -73,8 +73,14 @@
|
||||
|
||||
{% if managed_people|length > 1 %}
|
||||
<div class="mt-3 flex gap-2 overflow-x-auto pb-0.5">
|
||||
<a class="person-chip {% if scope_everyone %}person-chip-active{% endif %}" href="?as=all">
|
||||
<span class="person-chip-avatar">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="3"/><circle cx="17" cy="9" r="2.6"/><path d="M2.5 20c0-3.3 2.5-5.6 5.5-5.6s5.5 2.3 5.5 5.6"/><path d="M14 15c2.6.3 4.5 2.3 4.5 5"/></svg>
|
||||
</span>
|
||||
<span class="person-chip-label">{% trans "All" %}</span>
|
||||
</a>
|
||||
{% for person in managed_people %}
|
||||
<a class="person-chip {% if person == scope_person %}person-chip-active{% endif %}" href="?as={{ person.pk }}">
|
||||
<a class="person-chip {% if not scope_everyone and person == scope_person %}person-chip-active{% endif %}" href="?as={{ person.pk }}">
|
||||
<span class="person-chip-avatar">{{ person.first_name|slice:":1" }}</span>
|
||||
<span class="person-chip-label">{% if person == me %}{% trans "Me" %}{% else %}{{ person.first_name }}{% endif %}</span>
|
||||
</a>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if not scope_all and not scope_person %}
|
||||
{% if not scope_all and not managed_people %}
|
||||
<div class="m-card p-6 text-center">
|
||||
<p class="font-display text-lg font-extrabold text-ink uppercase">{% trans "No one to show yet" %}</p>
|
||||
<p class="mt-1 text-sm text-muted">{% trans "Once you're linked to a member record, their schedule will show up here." %}</p>
|
||||
|
||||
@@ -3,13 +3,16 @@
|
||||
|
||||
{% comment %}
|
||||
M1 -- design_handoff_rosterchief_platform/README.md's M1 section. Four
|
||||
independently-optional cards, all scoped to scope_person (mobile/mixins.py):
|
||||
a hero for the soonest upcoming event with a quick In/Out RSVP, a "needs
|
||||
your answer" list, a season-dues card, and a news teaser.
|
||||
independently-optional cards, scoped to people_in_scope (mobile/mixins.py)
|
||||
-- everyone the account manages once there's more than one (the header's
|
||||
"All" chip, on by default), or just the one person picked from the chip
|
||||
row. A hero for the soonest upcoming event with a quick In/Out RSVP, a
|
||||
"needs your answer" list, a season-dues card per person who owes money,
|
||||
and a news teaser.
|
||||
{% endcomment %}
|
||||
|
||||
{% block content %}
|
||||
{% if scope_person %}
|
||||
{% if managed_people %}
|
||||
{% if hero_attendance %}
|
||||
<div class="m-card-dark overflow-hidden">
|
||||
<div class="p-4 pb-0">
|
||||
@@ -29,15 +32,17 @@
|
||||
<p class="mt-3 font-display text-xs font-extrabold text-on-dark-dim uppercase tracking-wide">{% trans "Replies are closed for this event" %}</p>
|
||||
<span class="pill pill-neutral mt-2">{{ hero_attendance.get_status_display }}</span>
|
||||
{% else %}
|
||||
<p class="mt-3 font-display text-xs font-extrabold text-on-dark-dim uppercase tracking-wide">{% blocktrans with name=scope_person.first_name %}{{ name }} — are you in?{% endblocktrans %}</p>
|
||||
<p class="mt-3 font-display text-xs font-extrabold text-on-dark-dim uppercase tracking-wide">{% blocktrans with name=hero_attendance.member.first_name %}{{ name }} — are you in?{% endblocktrans %}</p>
|
||||
<div class="mt-2 flex gap-2">
|
||||
<form class="flex-1" method="post" action="{% url "mobile:event_detail" hero_attendance.event.pk %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="member_id" value="{{ hero_attendance.member.pk }}">
|
||||
<input type="hidden" name="status" value="present">
|
||||
<button class="btn btn-positive w-full" type="submit">{% trans "In" %}</button>
|
||||
</form>
|
||||
<form class="flex-1" method="post" action="{% url "mobile:event_detail" hero_attendance.event.pk %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="member_id" value="{{ hero_attendance.member.pk }}">
|
||||
<input type="hidden" name="status" value="absent">
|
||||
<button class="btn w-full bg-steel text-on-dark" type="submit">{% trans "Out" %}</button>
|
||||
</form>
|
||||
@@ -63,7 +68,7 @@
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-semibold text-ink">{{ attendance.event.title }}</div>
|
||||
<div class="text-xs text-muted">{{ scope_person.first_name }} · {{ attendance.event.start|date:"H:i" }}</div>
|
||||
<div class="text-xs text-muted">{{ attendance.member.first_name }} · {{ attendance.event.start|date:"H:i" }}</div>
|
||||
</div>
|
||||
<span class="pill pill-warn shrink-0">{% trans "Reply" %}</span>
|
||||
</a>
|
||||
@@ -72,22 +77,26 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if dues_membership %}
|
||||
<div class="m-card flex items-center gap-3 p-4">
|
||||
<div class="flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-danger-bg">
|
||||
<span class="font-display text-lg font-extrabold text-club">€</span>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-semibold text-ink">{% blocktrans with name=scope_person.first_name %}Season dues — {{ name }}{% endblocktrans %}</div>
|
||||
<div class="text-xs text-muted">
|
||||
{% if dues_invoice %}
|
||||
{% blocktrans with amount=dues_balance|floatformat:2 due=dues_invoice.due_date|date:"d M" %}€ {{ amount }} · due {{ due }}{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans with amount=dues_balance|floatformat:2 %}€ {{ amount }}{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if dues_rows %}
|
||||
<div class="flex flex-col gap-2.5">
|
||||
{% for row in dues_rows %}
|
||||
<div class="m-card flex items-center gap-3 p-4">
|
||||
<div class="flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-danger-bg">
|
||||
<span class="font-display text-lg font-extrabold text-club">€</span>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-semibold text-ink">{% blocktrans with name=row.membership.member.first_name %}Season dues — {{ name }}{% endblocktrans %}</div>
|
||||
<div class="text-xs text-muted">
|
||||
{% if row.invoice %}
|
||||
{% blocktrans with amount=row.balance|floatformat:2 due=row.invoice.due_date|date:"d M" %}€ {{ amount }} · due {{ due }}{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans with amount=row.balance|floatformat:2 %}€ {{ amount }}{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="btn btn-dark shrink-0">{% trans "Pay" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="btn btn-dark shrink-0">{% trans "Pay" %}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -108,7 +117,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not hero_attendance and not needs_answer and not dues_membership and not news_item %}
|
||||
{% if not hero_attendance and not needs_answer and not dues_rows and not news_item %}
|
||||
<div class="m-card p-6 text-center">
|
||||
<p class="text-sm text-muted">{% trans "Nothing to show right now." %}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user