{% endmacro %}
{#
flashed_messages: the shared alert list. A macro rather than a block so the
login page can render it inside its card -- a sign-in error banner at the
top of the page sits 10em above the form it belongs to.
#}
{% macro flashed_messages() %}
{% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %}
{% for category, message in messages %}
{% set mapping = {'message': 'info', 'error': 'danger'} %}
{% set variant = ' alert-' ~ mapping.get(category, category) if category else '' %}