django allauth custom messages: Styling messages with html/css

Viewed 7189

Allauth's the messages are stored as text files in the templates directory by default and these look something like:

{% load i18n %}
{% blocktrans %}You cannot remove your primary e-mail address ({{email}}).{% endblocktrans %}

These use django's template tags but aren't 'HTML friendly'. I would like to style these and have something like:

{% load i18n %}
<div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            {% blocktrans %}You cannot remove your primary e-mail address ({{email}}).{% endblocktrans %}
 </div>

But the code above simply renders the HTML as text. I cannot put this HTML in a template and just do {{ message }} within the template because I would like to change some of it on a per message bias (at least the color!).

How could I accomplish this? Thank you!

1 Answers
Related