Here is the html code:
{% extends 'appMenuAdministrator/mainadmin.html' %}
{% block content %}
<br>
<form action="" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<div class="row">
<div class="col-md">
<div class="card card-body" >
<h5>Informations</h5>
<hr>
<p>Nom:</p>
<fieldset>
<input name="LibELE_GROUPE" type="text" id="LibELE_GROUPE" value="{{groupe.LibELE_GROUPE}}" size="35"
placeholder="Nom du groupe" tabindex="1" required>*
</fieldset>
<fieldset>
<input name="created_at" type="date" id="created_at" value="{{groupe.created_at}}" size="35" placeholder=""
tabindex="2" style="display:None;">
</fieldset>
<fieldset>
<input name="updated_at" type="date" id="updated_at" value="{{groupe.updated_at}}" size="35" placeholder=""
tabindex="3" style="display:None;">
</fieldset>
<fieldset>
<input name="UTIL_CREATION" type="text" id="UTIL_CREATION" value="{{groupe.UTIL_CREATION}}" size="35"
placeholder="" tabindex="4" style="display:None;">
</fieldset>
<fieldset>
<input name="UTIL_MODIF" type="text" id="UTIL_MODIF" value="{{groupe.UTIL_MODIF}}" size="35" placeholder=""
tabindex="5" style="display:None;">
</fieldset>
<fieldset>
<input name="Soc_sigle" type="text" id="Soc_sigle" value="{{groupe.Soc_sigle}}" size="35" placeholder=""
tabindex="6" style="display:None;">
</fieldset>
</div>
</div>
<div class="col-md">
<div class="card card-body" style="width:300px; margin-left:40%;">
<h5>Total des Utilisateurs</h5>
<hr>
<h1 style="text-align: center;padding: 10px"></h1>
</div>
</div>
<div class="col-md">
<div class="card card-body" style="width:200px; margin-left:50%;">
<!--<h5>Client:</h5>-->
<hr>
{% if sEtat == "crea" %}
<a class="btn btn-outline-success btn-sm btn-block" href=""
style="font-size: 10px; ">Ajouter</a>
<a class="btn btn-outline-info btn-sm btn-block" href="" style="font-size: 10px;">Quitter</a>
{% elif sEtat == "modif" %}
<button class="b3 btn-outline-warning btn-sm btn-block " href=""
style="font-size: 10px;display:None;">
Modifier
</button>
<button class="b2 btn-outline-danger btn-sm btn-block " href=""
style="font-size: 10px; display:None;">
Supprimer
</button>
<button class="b1 btn-outline-secondary btn-sm btn-block " href=""
style="font-size: 10px; display:None;">
Annuler
</button>
<button class="b4 btn-outline-success btn-sm btn-block" name="Ajouter" type="submit"
value="Submit"
style="font-size: 10px; ">Ajouter
</button>
<button class="b5 btn-outline-info btn-sm btn-block" href="" style="font-size: 10px; ">Quitter
</button>
{% else %}
<a class="btn btn-outline-success btn-sm btn-block" href=""
style="font-size: 10px; ">Ajouter...</a>
<a class="btn btn-outline-info btn-sm btn-block" href="" style="font-size: 10px;">Quitter</a>
{% endif %}
</div>
</div>
</div>
</form>
<br>
<div class="row">
<div class="col">
<div class="card card-body">
<form method="get">
<button class="btn btn-primary" type="submit">Search</button>
</form>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md">
<div class="card card-body">
<table class="table table-sm">
<tr>
<th>ID</th>
<th>login</th>
<th>Prenom et Nom</th>
<th>Telephone</th>
<th>EMAIL</th>
<th>Util création</th>
<th>Date création</th>
<th>Util modification</th>
<th>Date modification</th>
</tr>
{% for Utilisateur in utilisateur %}
<tr>
<th>{{Utilisateur.IDF_UTILISATEUR}}</th>
<th>{{Utilisateur.LOGIN}}</th>
<th>{{Utilisateur.prenom}} - {{Utilisateur.name}}</th>
<th>{{Utilisateur.Telephone}}</th>
<th>{{Utilisateur.EMAIL}}</th>
<th>{{Utilisateur.UTIL_CREATION}}</th>
<th>{{Utilisateur.created_at}}</th>
<th>{{Utilisateur.UTIL_MODIF}}</th>
<th>{{Utilisateur.updated_at}}</th>
<th><a href="">Mise à Jour</a></th>
<th><a href="">Supprimer</a></th>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
<!--https://stackoverflow.com/questions/72089986/how-to-toggle-between-button-display -->
<script>
const buttons = document.getElementsByTagName("button");
var clicked = false
var b1 = document.querySelector(".b1")
var b2 = document.querySelector(".b2")
var b3 = document.querySelector(".b3")
var b5 = document.querySelector(".b5")
function hideButtons( button1, button2, button3) {
clicked = false
for (button of buttons) {
button.style.display = "inline";
}
button1.style.display = (clicked ? "inline" : "none")
button2.style.display = (clicked ? "inline" : "none")
button3.style.display = (clicked ? "inline" : "none")
clicked = !clicked
}
b1.addEventListener("click", () => {hideButtons(b2, b3, b1)})
function hideButtons1( button1, button2, button3) {
clicked = false
for (button of buttons) {
button.style.display = "none";
}
button1.style.display = "inline";
button2.style.display = "inline";
button3.style.display = "inline";
clicked = !clicked
}
b5.addEventListener("click", () => {hideButtons1(b1, b2, b3)})
</script>
{% endblock content%}