From 9ba8fee233a53e88086aabbfb0a4db197be0e836 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Mon, 20 Aug 2018 15:11:12 -0400 Subject: [PATCH] allow alert actions to be a string or a list of action dicts --- templates/components/alert.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/templates/components/alert.html b/templates/components/alert.html index 46be1549..80f99196 100644 --- a/templates/components/alert.html +++ b/templates/components/alert.html @@ -39,12 +39,20 @@ {% if actions %}
- {% for action in actions %} - - {% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %} - {{ action["label"] }} - - {% endfor %} + {% if actions is string %} + + {{ actions | safe }} + + {% elif actions is iterable %} + + {% for action in actions %} + + {% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %} + {{ action["label"] }} + + {% endfor %} + + {% endif %}
{% endif %}