use bootstrap alert classes for messages

This commit is contained in:
Jan Dittberner 2015-01-31 13:12:51 +01:00
parent f0c8336708
commit d921acd686
2 changed files with 10 additions and 9 deletions

View file

@ -273,10 +273,10 @@ INSTALLED_APPS = DJANGO_APPS + ALLAUTH_APPS + LOCAL_APPS
MESSAGE_TAGS = {
messages.DEBUG: '',
messages.ERROR: 'text-danger',
messages.INFO: 'text-info',
messages.SUCCESS: 'text-success',
messages.WARNING: 'text-warning',
messages.ERROR: 'alert-danger',
messages.INFO: 'alert-info',
messages.SUCCESS: 'alert-success',
messages.WARNING: 'alert-warning',
}
########## END APP CONFIGURATION

View file

@ -82,11 +82,12 @@
<h1>{% block page_title %}Example Base Template{% endblock page_title %}</h1>
{% if messages %}
<ul class="list-unstyled">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% for message in messages %}
<div class="alert alert-dismissible {{ message.tags }}" role="alert">
<button type="close" class="close" data-dismiss="alert" aria-label="{% trans "Close" %}"><span aria-hidden="true">&times;</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% block content %}