diff --git a/hosting/templates/hosting/includes/_messages.html b/hosting/templates/hosting/includes/_messages.html new file mode 100644 index 00000000..13500fdb --- /dev/null +++ b/hosting/templates/hosting/includes/_messages.html @@ -0,0 +1,8 @@ +{% if messages %} + <ul class="list-unstyled msg-list"> + {% for message in messages %} + <div + class="alert {% if message.tags and message.tags == 'error' %} alert-danger {% else %} alert-{{message.tags}} {% endif %}">{{ message|safe }}</div> + {% endfor %} + </ul> +{% endif %} \ No newline at end of file diff --git a/hosting/templates/hosting/login.html b/hosting/templates/hosting/login.html index 82056d2f..eda3fffa 100644 --- a/hosting/templates/hosting/login.html +++ b/hosting/templates/hosting/login.html @@ -16,13 +16,7 @@ <div class="auth-content"> <div class="intro-message auth-box"> <h2 class="section-heading">{% trans "Login"%}</h2> - {% if messages %} - <ul class="list-unstyled msg-list"> - {% for message in messages %} - <li>{{ message }}</li> - {% endfor %} - </ul> - {% endif %} + {% include 'hosting/includes/_messages.html' %} <form action="{% url 'hosting:login' %}" method="post" class="form" novalidated> {% csrf_token %} {% for field in form %}