From a7b0051d474faf2a741abc0692d841ddff2efefb Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Thu, 18 Jan 2024 13:35:47 +0100 Subject: [PATCH] front: add link to user's profile --- frontend/static/js/api/client.js | 2 ++ frontend/templates/index.html | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/static/js/api/client.js b/frontend/static/js/api/client.js index f8b2974..40704d5 100644 --- a/frontend/static/js/api/client.js +++ b/frontend/static/js/api/client.js @@ -112,12 +112,14 @@ class Client await this.me.init(); document.getElementById('navbarLoggedOut').classList.add('d-none'); document.getElementById('navbarLoggedIn').classList.remove('d-none'); + document.getElementById('myProfileLink').href = '/profiles/' + this.me.username; } else { this.me = undefined; document.getElementById('navbarLoggedOut').classList.remove('d-none'); document.getElementById('navbarLoggedIn').classList.add('d-none'); + document.getElementById('myProfileLink').href = ''; } this._logged = state; } diff --git a/frontend/templates/index.html b/frontend/templates/index.html index 71df47f..094c73b 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -25,7 +25,8 @@ Me