mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #1480 from GSA/1464-switch-to-the-new-withnav_template
Switch to the new withnav_template
This commit is contained in:
24
app/templates/new/components/flash_messages.html
Normal file
24
app/templates/new/components/flash_messages.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user