bla
This commit is contained in:
parent
1829515873
commit
d416e62d65
2 changed files with 17 additions and 2 deletions
|
@ -80,7 +80,7 @@
|
|||
</div>
|
||||
|
||||
<div id="admin-page" style="display: none">
|
||||
|
||||
|
||||
</div> <!-- end admin page -->
|
||||
|
||||
<div class="container" id="login-page" style="display: none;">
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue