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 %}
|
||||
<div class='alert__actions'>
|
||||
{% for action in actions %}
|
||||
<a href={{ action["href"] }} class='icon-link'>
|
||||
{% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %}
|
||||
<span>{{ action["label"] }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if actions is string %}
|
||||
|
||||
{{ actions | safe }}
|
||||
|
||||
{% elif actions is iterable %}
|
||||
|
||||
{% for action in actions %}
|
||||
<a href={{ action["href"] }} class='icon-link'>
|
||||
{% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %}
|
||||
<span>{{ action["label"] }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user