Created
July 19, 2016 13:36
-
-
Save ashitvora-zz/0c3f8b77e915d4470f44ea762414bf6e to your computer and use it in GitHub Desktop.
Nunjucks Alerts Macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro alerts() %} | |
{% set types = ['success', 'error', 'info', 'warning'] %} | |
{% for type in types %} | |
{% if( old(type) ) %} | |
<p class="alert alert-{% if type == 'error' %}danger{% else %}{{type}}{% endif %}">{{ old(type) }}</p> | |
{% endif %} | |
{% endfor %} | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment