{# The rows of the audit of administration, for its page and the card on a user's page. ``outcomes``: the tag class of each outcome, ``user_pages``: whether a user's name links to its page. #} {% macro credential_of(r) %}{% if not r.credential %}not signed in{% elif r.credential == "password" %}the UI{% elif r.credential == "host" %}a command on the host{% else %}token {{ r.credential[6:22] }}…{% endif %}{% endmacro %} {% macro activity_rows(records, outcomes, user_pages, who=True) %}
{% if who %}{% endif %} {% for r in records %} {% if who %} {% endif %} {% endfor %}
WhenWhoWhatOutcome
{{ r.at | when }} {% if r.user_id and user_pages %}{{ r.user_name }}{% else %}{{ r.user_name }}{% endif %} {{ credential_of(r) }}{% if r.source %} from {{ r.source }}{% endif %} {{ r.activity }} {{ r.detail }} {% if r.record %}{{ r.record[:20] }}{% if r.record | length > 20 %}…{% endif %}{% endif %} {{ r.outcome }}
{% endmacro %}