allow alert actions to be a string or a list of action dicts
This commit is contained in:
parent
ca2db7b58f
commit
9ba8fee233
@ -39,12 +39,20 @@
|
|||||||
|
|
||||||
{% if actions %}
|
{% if actions %}
|
||||||
<div class='alert__actions'>
|
<div class='alert__actions'>
|
||||||
|
{% if actions is string %}
|
||||||
|
|
||||||
|
{{ actions | safe }}
|
||||||
|
|
||||||
|
{% elif actions is iterable %}
|
||||||
|
|
||||||
{% for action in actions %}
|
{% for action in actions %}
|
||||||
<a href={{ action["href"] }} class='icon-link'>
|
<a href={{ action["href"] }} class='icon-link'>
|
||||||
{% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %}
|
{% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %}
|
||||||
<span>{{ action["label"] }}</span>
|
<span>{{ action["label"] }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user