From 7a8b8b7434b637e58970d0884e5f1bd97a87baba Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Thu, 26 Mar 2015 23:31:13 +0100 Subject: [PATCH] Modified the base layout to show the logged in users name --- app/login.py | 2 +- app/templates/layout.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/login.py b/app/login.py index 20fb494..12aff9f 100644 --- a/app/login.py +++ b/app/login.py @@ -24,7 +24,7 @@ def logout(): if 'zeus_token' in session: session.pop('zeus_token', None) logout_user() - return redirect(url_for('admin.index')) + return redirect(url_for('home')) def before_request(): diff --git a/app/templates/layout.html b/app/templates/layout.html index 03685c6..cef4cb0 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -15,7 +15,12 @@
  • Home
  • Stats
  • About
  • -
  • Login
  • + {% if current_user.is_anonymous() %} +
  • Login
  • + {% else %} +
  • Logout
  • +
  • {{ current_user.username }}
  • + {% endif %}