fix the message tags (== css classes) so they are meaningful to bootstrap3
note: tags can have multiple classes inside, so better use full class names
This commit is contained in:
parent
e2f51d5eb1
commit
e924b054fe
@ -357,6 +357,15 @@ SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
|
||||
# In this case foo field's value will be stored when user follows this link
|
||||
# <a href="{% url socialauth_begin 'github' %}?foo=bar">...</a>.
|
||||
|
||||
# we need slightly different classes for bootstrap3 than the default ones
|
||||
from django.contrib.messages import constants
|
||||
MESSAGE_TAGS = {
|
||||
constants.DEBUG: '',
|
||||
constants.INFO: 'alert-info',
|
||||
constants.SUCCESS: 'alert-success',
|
||||
constants.WARNING: 'alert-warning',
|
||||
constants.ERROR: 'alert-danger',
|
||||
}
|
||||
|
||||
try:
|
||||
from .local_settings import *
|
||||
|
@ -94,7 +94,7 @@
|
||||
{% endif %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }}">
|
||||
<div class="alert {{ message.tags }}">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{{ message }}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user