aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-17 11:57:14 -0500
committerFrederick Muriuki Muriithi2024-09-17 11:57:14 -0500
commitcab7e21b10ed19ae59897021ba645d2b944a5423 (patch)
tree5d9d5a33e1e45761f77d0daabfad588fd11b1afa
parente3ca04cc9b163ec169ae043e40ea2413169148e1 (diff)
downloadgn-uploader-cab7e21b10ed19ae59897021ba645d2b944a5423.tar.gz
UI Improvements: Provide some details of logged in user
-rw-r--r--uploader/__init__.py2
-rw-r--r--uploader/templates/base.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/uploader/__init__.py b/uploader/__init__.py
index 347f170..1af159b 100644
--- a/uploader/__init__.py
+++ b/uploader/__init__.py
@@ -9,6 +9,7 @@ from flask_session import Session
from uploader.oauth2.client import user_logged_in, authserver_authorise_uri
+from . import session
from .base_routes import base
from .species import speciesbp
from .dbinsert import dbinsertbp
@@ -76,6 +77,7 @@ def create_app():
app.add_template_global(lambda: app.config["GN2_SERVER_URL"],
name="gn2server_uri")
app.add_template_global(user_logged_in)
+ app.add_template_global(lambda : session.user_details()["email"], name="user_email")
Session(app)
diff --git a/uploader/templates/base.html b/uploader/templates/base.html
index cc37c3e..3af14ef 100644
--- a/uploader/templates/base.html
+++ b/uploader/templates/base.html
@@ -31,7 +31,7 @@
<li class="btn">
{%if user_logged_in()%}
<a href="{{url_for('oauth2.logout')}}"
- title="Log out of the system">Log Out</a>
+ title="Log out of the system">{{user_email()}} &mdash; Log Out</a>
{%else%}
<a href="{{authserver_authorise_uri()}}"
title="Log in to the system">Log In</a>