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

Commit

Permalink
tooltip hover infos connexion
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 26, 2024
1 parent cff4a3f commit de994e3
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
<span class="navbar-text ml-auto" data-toggle="tooltip" data-placement="left" title="Informations de connexion">
<img src="{{ url_for('static', filename='icons/compte.png' ) }}" alt="Info" style="width: 20px; height: 20px; cursor: pointer;">
<span class="d-none" id="tooltip-content">
<p id="email">Email: </p>
<p id="name">Name: </p>
<p id="surname">Surname: </p>
<p id="role">Role: </p>
<p id="id">ID: </p>
<p id="tt-email">Email: </p>
<p id="tt-name">Name: </p>
<p id="tt-surname">Surname: </p>
<p id="tt-role">Role: </p>
<p id="tt-id">ID: </p>
</span>
</span>
</div>
Expand Down Expand Up @@ -216,11 +216,11 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
},
success: function (response) {
var user = response;
$('#email').text('Email: ' + user.email);
$('#name').text('Name: ' + user.first_name);
$('#surname').text('Surname: ' + user.last_name);
$('#role').text('Role: ' + user.role);
$('#id').text('ID: ' + user.id);
$('#tt-email').text('Email: ' + user.email);
$('#tt-name').text('Name: ' + user.first_name);
$('#tt-surname').text('Surname: ' + user.last_name);
$('#tt-role').text('Role: ' + user.role);
$('#tt-id').text('ID: ' + user.id);

var userRole = user.role;
if (userRole === 'prof') {
Expand Down Expand Up @@ -267,6 +267,14 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
title: $('#tooltip-content').html()
});
});
$('#infoTooltip').hover(
function () {
$('#tooltip-content').removeClass('d-none');
},
function () {
$('#tooltip-content').addClass('d-none');
}
);
</script>

<style>
Expand Down

0 comments on commit de994e3

Please sign in to comment.