From 5a39d169b3e6046936a5ec5d5f09bb872b5489e0 Mon Sep 17 00:00:00 2001 From: p1905074 Date: Mon, 23 Nov 2020 21:28:17 +0100 Subject: [PATCH] add profil redirect --- public/javascripts/main.js | 7 ++++++- views/template/navbar.pug | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 1a1fcda..20b1d66 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -18,4 +18,9 @@ socket.on("logout", data=>{ }else{ window.location.href = "/"; } -}) \ No newline at end of file +}) + + +function profilRedirect(){ + document.location.href="/profil"; +} \ No newline at end of file diff --git a/views/template/navbar.pug b/views/template/navbar.pug index d738661..2da3620 100644 --- a/views/template/navbar.pug +++ b/views/template/navbar.pug @@ -2,16 +2,16 @@ extends layout block navbar if student === true - div(id="navprofile" class="student") + div(id="navprofile" class="student" onclick="profilRedirect()") p Kezel Benoit p G4S3 a(id="logout") Logout if teacher === true - div(id="navprofile" class="teacher") + div(id="navprofile" class="teacher" onclick="profilRedirect()") p Kezel Benoit a(id="logout") Logout if admin === true - div(id="navprofile" class="admin") + div(id="navprofile" class="admin" onclick="profilRedirect()") p Kezel Benoit a(id="logout") Logout