From 02cecf87ac5fe0c8397d0e9327a9db6b97d299e3 Mon Sep 17 00:00:00 2001
From: Thomas Schneider <thomas@fsmpi.rwth-aachen.de>
Date: Sat, 14 Sep 2024 02:38:00 +0200
Subject: [PATCH] templates/_base: Add logout button to nav bar

---
 frontend/src/main.less               | 7 +++++++
 schilder2000/templates/_base.html.j2 | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/frontend/src/main.less b/frontend/src/main.less
index cac0e35..dd1d5f8 100644
--- a/frontend/src/main.less
+++ b/frontend/src/main.less
@@ -135,6 +135,13 @@ nav {
 
 	#nav-links {
 		padding: 0;
+		flex-grow: 1;
+	}
+
+	#logout {
+		@media screen and (min-width: @mobile_threshold) {
+			margin-left: auto;
+		}
 	}
 
 	@media screen and (max-width: @mobile_threshold) {
diff --git a/schilder2000/templates/_base.html.j2 b/schilder2000/templates/_base.html.j2
index 6e68163..49cd22a 100644
--- a/schilder2000/templates/_base.html.j2
+++ b/schilder2000/templates/_base.html.j2
@@ -61,6 +61,9 @@
 					<div id="nav-links">
 						<a {{ maybe_active_href("views.index") }}>Startseite</a>
 						<a {{ maybe_active_href("views.create") }}>Neues Schild</a>
+						{%- if "identity" in session -%}
+							<a href="{{ url_for('views.logout') }}" id="logout">Abmelden</a>
+						{%- endif -%}
 					</div>
 				</nav>
 			{%- endblock nav -%}
-- 
GitLab