Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
user prof admin affichage boutons
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 25, 2024
1 parent 142cd30 commit 04300f2
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<nav class="navbar navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="/">Accueil</a>
<a id="profBtn" class="navbar-brand ml-auto" href="/professor" aria-hidden="true">Espace Prof</a>
<a id="adminBtn" class="navbar-brand ml-auto" href="/admin" aria-hidden="true">Espace admin</a>
<a id="profBtn" class="navbar-brand ml-auto" href="/professor" aria-hidden="true" style="display: none;">Espace Prof</a>
<a id="adminBtn" class="navbar-brand ml-auto" href="/admin" aria-hidden="true" style="display: none;">Espace admin</a>
<a id="connexionBtn" class="navbar-brand ml-auto">Connexion</a>
</div>
</nav>
Expand Down Expand Up @@ -210,21 +210,14 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
$('#name').text('Name: ' + user.first_name);
$('#surname').text('Surname: ' + user.last_name);
$('#role').text('Role: ' + user.role);
/*
user
prof
admin
*/
$('#id').text('ID: ' + user.id);
if (user.role === 'admin') {
$('#adminBtn').show();
} else {
$('#adminBtn').hide();
}
if (user.role === 'prof') {

var userRole = user.role;
if (userRole === 'prof') {
$('#profBtn').show();
} else {
$('#profBtn').hide();
}
if (userRole === 'admin') {
$('#adminBtn').show();
}
updateConnectionStatus(true);
},
Expand Down

0 comments on commit 04300f2

Please sign in to comment.