{% endif %}
{# === WORK LOG PAYROLL MODAL — click handler + safe DOM builder === #}
{# Builds the modal body from JSON via createElement + textContent. #}
{# staff-or-superuser matches the server-side is_admin() helper. The old #}
{# "is_authenticated and is_staff or is_superuser" parsed as "(auth AND #}
{# staff) OR superuser" — template `and` binds tighter than `or`. Both #}
{# flags are False on AnonymousUser, so this simpler form is exact. #}
{% if user.is_staff or user.is_superuser %}
{% endif %}
{% block extra_js %}{% endblock %}
{# === WORK LOG PAYROLL MODAL (admin-only) === #}
{# Hidden by default. Any element with data-log-id anywhere in the app #}
{# triggers this modal. Fetches JSON and builds the DOM safely. #}
{# staff-or-superuser matches the server-side is_admin() helper. The old #}
{# "is_authenticated and is_staff or is_superuser" parsed as "(auth AND #}
{# staff) OR superuser" — template `and` binds tighter than `or`. Both #}
{# flags are False on AnonymousUser, so this simpler form is exact. #}
{% if user.is_staff or user.is_superuser %}