diff --git a/static/index.html b/static/index.html
index 3798105..6e8c011 100644
--- a/static/index.html
+++ b/static/index.html
@@ -80,7 +80,7 @@
-
+
diff --git a/static/js/main.js b/static/js/main.js
index 7508503..21a1e3c 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -37,6 +37,7 @@ $("#login-button").click(function (e) {
if(data.success) {
localStorage.setItem("token", data.token);
localStorage.setItem("user", data.user);
+ localStorage.setItem("isAdmin", data.isAdmin);
show_page('#demande-page');
} else {
@@ -48,7 +49,7 @@ $("#login-button").click(function (e) {
});
$("#prank-button").click(function () {
- if(localStorage.getItem('token')) {
+ if (localStorage.getItem('token')) {
show_page('#demande-page');
}
else {
@@ -56,6 +57,20 @@ $("#prank-button").click(function () {
}
});
+$("#logo").click(function () {
+ if (localStorage.getItem('token')) {
+ if (localStorage.getItem('isAdmin')) {
+ show_page('#admin-page');
+ }
+ else {
+ show_page('#demande-page');
+ }
+ }
+ else {
+ show_page('#login-page');
+ }
+});
+
$(window).on("load", function() {
/* Register the Service Worker */