use bootstrap alert classes for messages
This commit is contained in:
parent
f0c8336708
commit
d921acd686
2 changed files with 10 additions and 9 deletions
|
@ -273,10 +273,10 @@ INSTALLED_APPS = DJANGO_APPS + ALLAUTH_APPS + LOCAL_APPS
|
||||||
|
|
||||||
MESSAGE_TAGS = {
|
MESSAGE_TAGS = {
|
||||||
messages.DEBUG: '',
|
messages.DEBUG: '',
|
||||||
messages.ERROR: 'text-danger',
|
messages.ERROR: 'alert-danger',
|
||||||
messages.INFO: 'text-info',
|
messages.INFO: 'alert-info',
|
||||||
messages.SUCCESS: 'text-success',
|
messages.SUCCESS: 'alert-success',
|
||||||
messages.WARNING: 'text-warning',
|
messages.WARNING: 'alert-warning',
|
||||||
}
|
}
|
||||||
########## END APP CONFIGURATION
|
########## END APP CONFIGURATION
|
||||||
|
|
||||||
|
|
|
@ -82,11 +82,12 @@
|
||||||
<h1>{% block page_title %}Example Base Template{% endblock page_title %}</h1>
|
<h1>{% block page_title %}Example Base Template{% endblock page_title %}</h1>
|
||||||
|
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
<ul class="list-unstyled">
|
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
<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">×</span></button>
|
||||||
|
{{ message }}
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
Loading…
Reference in a new issue