{% from 'bootstrap5/utils.html' import render_icon %} {% set colors = ["indigo", "green", "orange", "teal", "pink", "purple", "cyan"] %} {% macro timeline(events, public_only=True, show_user=False) %}
{% set dates = [] %} {% for event in events | sort(attribute='created_at', reverse=True) %} {% if event.public or not public_only %} {% if not event.created_at.date() == dates[-1] %} {% set _ = dates.append(event.created_at.date()) %}
{{ event.created_at.date() }}
{% endif %}
{{ render_icon({ 'signup': 'box-arrow-in-right', 'create': 'plus', 'delete': "person-dash-fill", 'note': "pen-fill", 'status': "check", 'transition': 'caret-right-fill', 'password': 'key-fill', 'mfa': 'qr-code', }[event.category]) }}
{{ render_icon("clock") }} {{ event.created_at.time().strftime("%H:%M") }} {% if show_user and event.user.username %} {{ render_icon("person-fill") }} {{ event.user.username }} {% endif %}

{{ event.actor.username or event.user.username }} {{ event.description }}

{% if event.comment %}
{{ event.comment }}
{% endif %}
{% endif %} {% endfor %}
{% endmacro %} {% macro profile_status(profile) %} {% set current = profile.STATUSES[profile.status] %} {% set c = current[0] %} {{ current[1] }} {% if profile.transition_step %} {% set transition = profile.TRANSITIONS[profile.transition] %} {% set target = profile.STATUSES[transition.to] %} {% set c = target[0] %} {{ render_icon("arrow-right") }} {{ target[1] }} {% if profile.transition_step == profile.INIT %} {{ render_icon("clock") }} {{ transition.delta(profile) }} {% elif profile.transition_step == profile.START %} {{ render_icon("rocket") }} {% elif profile.transition_step == profile.DONE %} {{ render_icon("check") }} {% elif profile.transition_step == profile.MANUAL %} {{ render_icon("hand-index-fill") }} {% endif %} {% endif %} {% endmacro %} {% macro auths_badges(auths) %} {% for realm, auth in auths.items() %} {% set c = auth.BADGES[realm] %} {{ realm }} {% endfor %} {% endmacro %} {% macro infobox(title, text, color, icon) %} {% set c = color %}

{{ render_icon(icon) }}{{ title }}

{{ text }}

{% endmacro %}