From 1ab06f7f45db0a76ded9c8e88c594ff9bc3d1752 Mon Sep 17 00:00:00 2001
From: Dorian Lesbre <dorian.lesbre@gmail.com>
Date: Fri, 5 Mar 2021 12:28:53 +0100
Subject: [PATCH] Added message styling

---
 accounts/views.py         |  1 +
 home/static/css/style.css | 26 ++++++++++++++++++++++++++
 home/templates/base.html  |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/accounts/views.py b/accounts/views.py
index 1698d13..903d734 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -20,6 +20,7 @@ from site_settings.models import SiteSettings
 def logout_view(request):
 	"""Vue pour se deconnecter"""
 	logout(request)
+	messages.success(request, "Vous avez bien été déconecté·e.")
 	return redirect("home")
 
 class CreateAccountView(View):
diff --git a/home/static/css/style.css b/home/static/css/style.css
index 64c0524..c24355f 100644
--- a/home/static/css/style.css
+++ b/home/static/css/style.css
@@ -201,6 +201,32 @@ div.error {
 	margin: 10px;
 }
 
+ul.messagelist {
+	padding: 0;
+	margin-top: 20px;
+}
+
+ul.messagelist li {
+	display: block;
+	font-weight: 400;
+	font-size: 13px;
+	padding: 10px 10px 10px 65px;
+	margin: 0 0 10px 0;
+	background: #dfd;
+	background-size: 16px auto;
+	color: #333;
+}
+
+ul.messagelist li.warning {
+	background: #ffc;
+	background-size: 14px auto;
+}
+
+ul.messagelist li.error {
+	background: #ffefef;
+	background-size: 16px auto;
+}
+
 footer {
 	position: absolute;
 	bottom: 0;
diff --git a/home/templates/base.html b/home/templates/base.html
index 7ffb9a4..9e52faa 100644
--- a/home/templates/base.html
+++ b/home/templates/base.html
@@ -63,7 +63,7 @@
 
 		<main>
 			{% if messages %}
-			<ul class="messages">
+			<ul class="messagelist">
 					{% for message in messages %}
 					<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
 					{% endfor %}
-- 
GitLab