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 = {
|
||||
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
|
||||
|
||||
|
|
|
@ -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>
|
||||
<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 %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% block content %}
|
||||
|
|
Loading…
Reference in a new issue