{% load mark_as_displayed %}

<div class='ajaxmessages' {% if ajaxmessages_refresh %}data-refresh="{% url 'ajaxmessages' %}"{% endif %}>
{% if ajaxmessages %}
    {% for message in ajaxmessages %}
        <div class="ajaxmessage alert {{ message.tag }}" data-identity="{{ message.id }}">
            {% if message.allow_dismiss %}<button type="button" class="close" data-dismiss="alert">×</button>{% endif %}
            {{ message.icon }}
            {{ message }}
        </div>
    {% endfor %}

    {% mark_as_displayed ajaxmessages %}
{% endif %}
</div>
