Merge pull request #1480 from GSA/1464-switch-to-the-new-withnav_template

Switch to the new withnav_template
This commit is contained in:
Carlo Costino
2024-05-31 10:28:01 -04:00
committed by GitHub
28 changed files with 116 additions and 89 deletions

View File

@@ -0,0 +1,24 @@
{% from "components/banner.html" import banner %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{% if category in ['cancel', 'delete', 'suspend', 'resume', 'remove', 'revoke this API key'] %}
{% set delete_button_text = "Yes, {}".format(category) %}
{% elif category == 'try again' %}
{% set delete_button_text = category|capitalize %}
{% else %}
{% set delete_button_text = None %}
{% endif %}
<div class="bottom-gutter">
{{ banner(
message if message is string else message[0],
'default' if ((category == 'default') or (category == 'default_with_tick')) else 'dangerous',
delete_button=delete_button_text,
with_tick=True if category == 'default_with_tick' else False,
context=message[1] if message is not string,
thing=message[2] if message is not string and message[2]
)}}
</div>
{% endfor %}
{% endif %}
{% endwith %}