{% extends "base.html" %} {% from "_macros.html" import status_pill %} {% block title %}{{ patron.full_name }} — {{ library_name() }}{% endblock %} {% block content %}

{{ patron.full_name }}

{{ patron.library_card_number }}

{% if message %}

{{ message }}

{% endif %} {% if error %}

{{ error }}

{% endif %}
Status
{% if patron.is_active %} Active
{% else %} Inactive
{% endif %}
{% if patron.contact_email %}
Email
{{ patron.contact_email }}
{% endif %} {% if patron.contact_phone %}
Phone
{{ patron.contact_phone }}
{% endif %}
Category & expiry
{% set today = none %}{# rendered server-side; templates can't compare dates without filters #}
{% if patron.expires_at %} {% if patron.expires_at.isoformat() < today_iso() %} Expired {{ patron.expires_at.isoformat() }} {% else %} Expires {{ patron.expires_at.isoformat() }} {% endif %} {% endif %}
User account
{% if linked_user %} {{ linked_user.username }} ({{ linked_user.role.name }}) {% if patron.is_active %}
{% endif %} {% elif patron.is_active and unlinked_users %}
{% if has_permission(user, 'patron.account.manage') %}
Create a new login for this patron
{% endif %} {% elif patron.is_active and has_permission(user, 'patron.account.manage') %}
Create a login for this patron
{% elif patron.is_active %} None {% else %} None {% endif %}
{% if patron.household_id %}

Household: {{ patron.household.name }}

{% if household_members_summary %} {% for m in household_members_summary %} {% endfor %}
NameCard #LoansHolds
{{ m.patron.full_name }}{% if not m.patron.is_active %} (inactive){% endif %} {{ m.patron.library_card_number }} {{ m.loan_count }} {{ m.hold_count }}
{% else %}

No other members in this household.

{% endif %} {% if has_permission(user, 'household.manage') %}

Manage household →

{% endif %}
{% endif %} {% if has_permission(user, 'fine.manage') %}

View fines

{% endif %}

Active Loans (view all)

{% if loans %} {% for loan in loans %} {% endfor %}
BarcodeTitleDue
{{ loan.item.barcode }} {{ loan.item.work.title }} {{ loan.due_at.strftime("%Y-%m-%d") if loan.due_at else "—" }}
{% else %}

No active loans.

{% endif %}

Active Holds

{% if holds %} {% if has_permission(user, 'hold.place.any') %}{% endif %} {% for hold in holds %} {% if has_permission(user, 'hold.place.any') %} {% endif %} {% endfor %}
TitleStatusExpires
{{ hold.work.title }} {{ status_pill(hold.status) }} {{ hold.expires_at.strftime("%Y-%m-%d") if hold.expires_at else "—" }}
{% else %}

No active holds.

{% endif %} {% endblock %}