Merge pull request 'dashboard' (#2) from dashboard into master

Reviewed-on: v4l3n71n/covas-bo#2
This commit is contained in:
v4l3n71n 2022-08-25 21:39:59 +00:00
commit e026d9bd04
13 changed files with 1369 additions and 356 deletions

View File

@ -90,3 +90,7 @@ body {
border-color: transparent;
box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}
#users tbody td {
cursor: pointer;
}

View File

@ -37,7 +37,3 @@ body {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.hidden {
visibility: hidden;
}

3
web/css/style.css Normal file
View File

@ -0,0 +1,3 @@
.hidden {
display: none;
}

226
web/html/adduser.html Normal file
View File

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.101.0">
<title>Dashboard Template · Bootstrap v5.2</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/dashboard/">
<link href="../css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Favicons -->
<link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
<meta name="theme-color" content="#712cf9">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.b-example-divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}
.b-example-vr {
flex-shrink: 0;
width: 1.5rem;
height: 100vh;
}
.bi {
vertical-align: -.125em;
fill: currentColor;
}
.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}
.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
</style>
<!-- Custom styles for this template -->
<link href="../css/dashboard.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/html/users.html"><- Retour à la liste</a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" id="signout" href="#">Deconnecté</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/html/users.html">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
Utilisateurs
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="alert alert-warning alert-dismissible hidden" id="notModifiedAlert" role="alert">
<div>Utilisateur non modifié</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-success alert-dismissible hidden" id="createUserAlert" role="alert">
<div>Vous avez créer l'utilisateur <span id="displayUser"></span></div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-warning alert-dismissible hidden" id="pseudoExistAlert" role="alert">
<div>Pseudo déjà pris</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-warning alert-dismissible hidden" id="emailExistAlert" role="alert">
<div>Email déjà pris</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
<div>Action non autorisée</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
<div>Action interdite</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
<div>Erreur interne du serveur</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
<div>Erreur inconnue</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Utilisateur</h1>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="pseudoUpdate">Pseudo</span>
<input id="pseudoUpdateInput" type="text" class="form-control" placeholder="Pseudo" aria-label="Pseudo" aria-describedby="pseudoUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="passwordUpdate">Mot de passe</span>
<input id="passwordUpdateInput" type="password" class="form-control" placeholder="Mot de passe" aria-label="Mot de passe" aria-describedby="passwordUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="nameUpdate">Nom</span>
<input id="nameUpdateInput" type="text" class="form-control" placeholder="Nom" aria-label="Nom" aria-describedby="nameUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="firstNameUpdate">Prenom</span>
<input id="firstNameUpdateInput" type="text" class="form-control" placeholder="Prenom" aria-label="Prenom" aria-describedby="firstNameUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="emailUpdate">Email</span>
<input id="emailUpdateInput" type="text" class="form-control" placeholder="Email" aria-label="Email" aria-describedby="emailUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="birthUpdate">Date de naissance</span>
<input id="birthUpdateInput" type="date" class="form-control" placeholder="Date de naissance" aria-label="Date de naissance" aria-describedby="birthdateUpdate">
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="rolesSelector">Roles</label>
<select class="form-select" id="rolesSelector">
<option value="Admin">Administrateur</option>
<option value="User" selected>Utilisateur</option>
</select>
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button type="button" class="btn btn-success" id="addUser">Ajouter l'utilisateur</button>
</div>
</main>
</div>
</div>
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/addUser.js"></script>
</body></html>

View File

@ -1,335 +0,0 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.101.0">
<title>Dashboard Template · Bootstrap v5.2</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/dashboard/">
<link href="../css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Favicons -->
<link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
<meta name="theme-color" content="#712cf9">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.b-example-divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}
.b-example-vr {
flex-shrink: 0;
width: 1.5rem;
height: 100vh;
}
.bi {
vertical-align: -.125em;
fill: currentColor;
}
.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}
.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
</style>
<!-- Custom styles for this template -->
<link href="../css/dashboard.css" rel="stylesheet">
<style type="text/css">/* Chart.js */
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}</style></head>
<body>
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="#">Company name</a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" placeholder="Search" aria-label="Search">
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" href="#">Sign out</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
Dashboard
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file align-text-bottom" aria-hidden="true"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>
Orders
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart align-text-bottom" aria-hidden="true"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>
Products
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users align-text-bottom" aria-hidden="true"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
Customers
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart-2 align-text-bottom" aria-hidden="true"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg>
Reports
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-layers align-text-bottom" aria-hidden="true"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
Integrations
</a>
</li>
</ul>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
<span>Saved reports</span>
<a class="link-secondary" href="#" aria-label="Add a new report">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle align-text-bottom" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>
</a>
</h6>
<ul class="nav flex-column mb-2">
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text align-text-bottom" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
Current month
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text align-text-bottom" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
Last quarter
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text align-text-bottom" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
Social engagement
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text align-text-bottom" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
Year-end sale
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"><div class="chartjs-size-monitor"><div class="chartjs-size-monitor-expand"><div class=""></div></div><div class="chartjs-size-monitor-shrink"><div class=""></div></div></div>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Dashboard</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2">
<button type="button" class="btn btn-sm btn-outline-secondary">Share</button>
<button type="button" class="btn btn-sm btn-outline-secondary">Export</button>
</div>
<button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar align-text-bottom" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
This week
</button>
</div>
</div>
<canvas class="my-4 w-100 chartjs-render-monitor" id="myChart" style="display: block; width: 1552px; height: 655px;" width="1552" height="655"></canvas>
<h2>Section title</h2>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Header</th>
<th scope="col">Header</th>
<th scope="col">Header</th>
<th scope="col">Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>1,001</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,002</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,003</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,003</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,004</td>
<td>text</td>
<td>random</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,005</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>placeholder</td>
</tr>
<tr>
<td>1,006</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,007</td>
<td>placeholder</td>
<td>tabular</td>
<td>information</td>
<td>irrelevant</td>
</tr>
<tr>
<td>1,008</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,009</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,010</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,011</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,012</td>
<td>text</td>
<td>placeholder</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,013</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>visual</td>
</tr>
<tr>
<td>1,014</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,015</td>
<td>random</td>
<td>tabular</td>
<td>information</td>
<td>text</td>
</tr>
</tbody>
</table>
</div>
</main>
</div>
</div>
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="Dashboard%20Template%20%C2%B7%20Bootstrap%20v5_files/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script><script src="Dashboard%20Template%20%C2%B7%20Bootstrap%20v5_files/dashboard.js"></script>
</body></html>

361
web/html/user.html Normal file
View File

@ -0,0 +1,361 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.101.0">
<title>Dashboard Template · Bootstrap v5.2</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/dashboard/">
<link href="../css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Favicons -->
<link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
<meta name="theme-color" content="#712cf9">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.b-example-divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}
.b-example-vr {
flex-shrink: 0;
width: 1.5rem;
height: 100vh;
}
.bi {
vertical-align: -.125em;
fill: currentColor;
}
.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}
.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
</style>
<!-- Custom styles for this template -->
<link href="../css/dashboard.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/html/users.html"><- Retour à la liste</a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" id="signout" href="#">Deconnecté</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/html/users.html">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
Utilisateurs
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="alert alert-warning alert-dismissible hidden" id="notModifiedAlert" role="alert">
<div>Utilisateur non modifié</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
<div>Création d'utilisateur non autorisée avec ce compte</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
<div>Action interdite</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="noContentAlert" role="alert">
<div>Utilisateur non modifié</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
<div>Erreur interne du serveur</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
<div>Erreur inconnue</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="pseudoAlert" role="alert">
<div>Champ pseudo vide</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="emailAlert" role="alert">
<div>Champ email vide</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="firstNameAlert" role="alert">
<div>Champ prenom vide</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="nameAlert" role="alert">
<div>Champ nom vide</div>
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Utilisateur</h1>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="idUpdate">ID</span>
<input id="idUpdateInput" type="text" class="form-control" placeholder="" aria-label="Id" aria-describedby="idUpdate" disabled>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="pseudoUpdate">Pseudo</span>
<input id="pseudoUpdateInput" type="text" class="form-control" placeholder="Pseudo" aria-label="Pseudo" aria-describedby="pseudoUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="passwordUpdate">Mot de passe</span>
<input id="passwordUpdateInput" type="password" class="form-control" placeholder="Mot de passe" aria-label="Mot de passe" aria-describedby="passwordUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="nameUpdate">Nom</span>
<input id="nameUpdateInput" type="text" class="form-control" placeholder="Nom" aria-label="Nom" aria-describedby="nameUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="firstNameUpdate">Prenom</span>
<input id="firstNameUpdateInput" type="text" class="form-control" placeholder="Prenom" aria-label="Prenom" aria-describedby="firstNameUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="emailUpdate">Email</span>
<input id="emailUpdateInput" type="text" class="form-control" placeholder="Email" aria-label="Email" aria-describedby="emailUpdate">
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="rolesSelector">Roles</label>
<select class="form-select" id="rolesSelector">
<option value="Admin">Administrateur</option>
<option value="User">Utilisateur</option>
</select>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="birthUpdate">Date de naissance</span>
<input id="birthUpdateInput" type="date" class="form-control" placeholder="Date de naissance" aria-label="Date de naissance" aria-describedby="birthdateUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="connected_atUpdate">Dernière connexion</span>
<input id="connected_atUpdateInput" type="text" class="form-control" placeholder="" aria-label="Dernière connexion" aria-describedby="connected_atUpdate" disabled>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="created_atUpdate">Date de création</span>
<input id="created_atUpdateInput" type="text" class="form-control" placeholder="" aria-label="Date de création" aria-describedby="created_atUpdate" disabled>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="updated_atUpdate">Date de mise à jour</span>
<input id="updated_atUpdateInput" type="text" class="form-control" placeholder="" aria-label="Date de mise à jour" aria-describedby="updated_atUpdate" disabled>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="deleted_atUpdate">Date de suppression</span>
<input id="deleted_atUpdateInput" type="text" class="form-control" placeholder="" aria-label="Date de suppression" aria-describedby="deleted_atUpdate" disabled>
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="statusSelector">Statut</label>
<select class="form-select" id="statusSelector" disabled>
<option value="-2" selected>Statut</option>
<option value="-1">En cours de suppression</option>
<option value="0">Desactivé</option>
<option value="1">Activé</option>
<option value="2">En attente de validation</option>
</select>
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button type="button" class="btn btn-success hidden" id="enableUser" data-bs-toggle="modal" data-bs-target="#enableUserModal">Activer l'utilisateur</button>
<button type="button" class="btn btn-success hidden" id="cancelUser" data-bs-toggle="modal" data-bs-target="#cancelUserModal">Annuler la suppression de l'utilisateur</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updateUserModal">Mettre à jour l'utilisateur</button>
<button type="button" class="btn btn-warning hidden" id="disableUser" data-bs-toggle="modal" data-bs-target="#disableUserModal">Désactiver l'utilisateur</button>
<button type="button" class="btn btn-danger" id="removeUser" data-bs-toggle="modal" data-bs-target="#removeUserModal">Supprimer l'utilisateur</button>
</div>
<div class="modal fade" id="updateUserModal" tabindex="-1" aria-labelledby="updateUserModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updateUserModalLabel">Mettre à jour l'utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Voulez-vous mettre à jour l'utilisateur ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-primary" id="updateUserButton">Mettre à jour</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="disableUserModal" tabindex="-1" aria-labelledby="disableUserModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="disableUserModalLabel">Désactiver l'utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Voulez-vous désactiver l'utilisateur ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-warning" id="disableUserButton">Désactiver</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="removeUserModal" tabindex="-1" aria-labelledby="removeUserModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updateUserModalLabel">Supprimer l'utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Etes-vous sûr de supprimer l'utilisateur ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-danger" id="removeUserButton">Supprimer</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="enableUserModal" tabindex="-1" aria-labelledby="enableUserModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="enableUserModalLabel">Activer l'utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Voulez-vous activer l'utilisateur ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-success" id="enableUserButton">Activer</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="cancelUserModal" tabindex="-1" aria-labelledby="cancelUserModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="cancelUserModalLabel">Annuler la suppression de l'utilisateur</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Voulez-vous annuller la suppression de l'utilisateur ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-success" id="cancelUserButton">Annuler la suppression de l'utilisateur</button>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/user.js"></script>
</body></html>

200
web/html/users.html Normal file
View File

@ -0,0 +1,200 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.101.0">
<title>Dashboard Template · Bootstrap v5.2</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/dashboard/">
<link href="../css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Favicons -->
<link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
<meta name="theme-color" content="#712cf9">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.b-example-divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}
.b-example-vr {
flex-shrink: 0;
width: 1.5rem;
height: 100vh;
}
.bi {
vertical-align: -.125em;
fill: currentColor;
}
.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}
.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
</style>
<!-- Custom styles for this template -->
<link href="../css/dashboard.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="#">Company name</a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<input class="form-control form-control-dark w-100 rounded-0 border-0" id=searchUser type="text" placeholder="Search" aria-label="Search">
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" id="signout" href="#">Deconnecté</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
Utilisateurs
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Utilisateurs</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2">
<button type="button" id=addUser class="btn btn-sm btn-outline-secondary">Ajouter un utilisateur</button>
</div>
</div>
</div>
<h2>Liste d'utilisateur</h2>
<div class="table-responsive">
<div class="row g-3">
<div class="col-auto">
<label for="inputRoles" class="form-label">Roles</label>
<select class="form-select" id="inputRoles" aria-label="Default select example">
<option value="All" selected>Tout</option>
<option value="Admin">Administrateurs</option>
<option value="User">Utilisateurs</option>
</select>
</div>
<div class="col-auto">
<label for="inputStatus" class="form-label">Statut</label>
<select class="form-select" id="inputStatus" aria-label="Default select example">
<option value="-2" selected>Tout</option>
<option value="-1">En cours de suppression</option>
<option value="0">Desactivé</option>
<option value="1">Activé</option>
<option value="2">En cours de validation</option>
</select>
</div>
</div>
<table id=users class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Pseudo</th>
<th scope="col">Mail</th>
<th scope="col">Rôle</th>
<th scope="col">Statut</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td><span class="activeStatus hidden">Activé</span><span class="disableStatus hidden">Désactivé</span><span class="confirmStatus hidden">En attente de confirmation</span><span class="removeStatus hidden">En attente de suppression</span><span class="unknownStatus hidden">Statut inconnu</span></td>
</tr>
</tbody>
</table>
<nav aria-label="Page navigation" class="hidden" id="page">
<ul class="pagination justify-content-center">
<li class="page-item disabled" id="previousPage"><a class="page-link" href="#" tabindex="-1" aria-disabled="true">Précédent</a></li>
<li class="page-item"><a class="page-link" href="/html/users.html?page=1">1</a></li>
<li class="page-item" id="nextPage"> <a class="page-link" href="#">Suivant</a></li>
</ul>
</div>
</main>
</div>
</div>
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/users.js"></script>
</body></html>

View File

@ -45,10 +45,15 @@
<!-- Custom styles for this template -->
<link href="css/signin.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body class="text-center">
<main class="form-signin">
<div class="alert alert-danger alert-dismissible hidden" id="alertRequest" role="alert">
<div>Requête incorrecte</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="alertUsername" role="alert">
<div>Utilisateur inexistant</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
@ -106,5 +111,6 @@
<script src="js/config.js"></script>
<script src="js/library.js"></script>
<script src="js/login.js"></script>
</body></html>

94
web/js/addUser.js Normal file
View File

@ -0,0 +1,94 @@
checkToken();
signOut();
closeButton();
document.getElementById("addUser").addEventListener("click", function(){
var updateProfil = ["pseudo", "email", "firstName", "birth", "password"];
var updateOk = true;
for (var i=0; i<updateProfil.length; i++){
if(document.getElementById(updateProfil[i]+"UpdateInput").value.length == 0){
updateOk = false;
document.getElementById(updateProfil[i]+"Alert").classList.remove("hidden");
}
}
if(updateOk){
var selector = { "roles": ""};
var listSelector = [ "roles"];
for (var i=0; i<listSelector.length; i++){
var options = document.querySelectorAll("#"+listSelector[i]+"Selector option");
for (var j=0; j<options.length; j++){
if(options[j].selected){
selector[listSelector[i]] = options[j].value;
}
}
}
dataPut = {
"id": "",
"pseudo": document.getElementById("pseudoUpdateInput").value,
"email": document.getElementById("emailUpdateInput").value,
"name": document.getElementById("nameUpdateInput").value,
"firstName": document.getElementById("firstNameUpdateInput").value,
"birth": document.getElementById("birthUpdateInput").value,
"status": 1,
"password": document.getElementById("passwordUpdateInput").value,
"roles": selector["roles"],
"created_at": "",
"updated_at": "",
"deleted_at": "",
"connected_at": ""
}
instance({
method : "put",
url:"users",
withCredentials: true,
data: dataPut
}).then(function(response){
var idAlert = "";
switch(response.status){
case 201:
idAlert="createUser"
var user = document.getElementById("pseudoUpdateInput").value;
if(user.length > 0){
document.getElementById("displayUser").textContent=user;
}
break;
case 204:
idAlert="notModified"
break;
default:
idAlert="unknown";
break
}
document.getElementById(idAlert+"Alert").classList.remove("hidden");
}).catch(function(error){
console.log(error);
switch(error.response.status){
case 401:
listExist = [ "pseudo", "email" ];
for(var i=0; i<listExist.length; i++){
if(error.response.data[listExist[i]]){
document.getElementById(listExist[i]+"ExistAlert").classList.remove("hidden");
}
}
idAlert="notAuthorized";
break;
case 403:
idAlert="forbidden";
break;
case 500:
idAlert="internalServer";
break;
default:
idAlert="unknown";
break;
}
document.getElementById(idAlert+"Alert").classList.remove("hidden");
});
}
});

128
web/js/library.js Normal file
View File

@ -0,0 +1,128 @@
function checkToken(){
instance.get("token", { withCredentials: true})
.then(function(response) {
if(location.pathname == "/")
{
location.href="/html/users.html";
}
})
.catch(function(error){
if(location.pathname != "/"){
location.href="/";
}
if(error.response.status == 406){
instance.delete("token" , {withCredentials:true}).then(function(response){
location.reload();
});
}
});
}
function buildParam(e, id){
var search = document.getElementById("searchUser").value;
var param = "";
var listParam = ["page", "nbPages"];
if(id.length > 0){
var select = document.getElementById(id);
var getId = select.options[select.selectedIndex].value;
if(id == "inputRoles"){
var status = e.target.value;
if(status != "-2"){
param = param + "status="+status+"&";
}
if(getId != "All"){
param = param + "roles="+getId;
}
}
if(id == "inputStatus"){
var roles = e.target.value;
if(getId != "-2"){
param = param + "status="+getId+"&";
}
if(roles != "All"){
param = param + "roles="+roles+"&";
}
}
} else {
listParam.push("roles");
listParam.push("status");
}
if(search.length > 0){
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(search)){
param = param + "email="+search+"&";
} else if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(search)){
param = param + "uuid="+search+"&";
} else {
param = param + "search="+search+"&";
}
} else {
listParam.push("email"); listParam.push("uuid"); listParam.push("search");
}
for (var i=0; i<listParam.length; i++){
var query = getQuery(listParam[i]);
if(query.length > 0){
param = param + listParam[i]+"="+query+"&";
}
}
return param;
}
function signOut(){
document.getElementById("signout").addEventListener("click", function(){
instance.delete("token" , {withCredentials:true}).then(function(response){
if(response.status == 200) {
location.href="/";
}
});
});
}
function closeButton(){
var btnclose = document.getElementsByClassName("btn-close");
for (var i = 0; i<btnclose.length; i++){
btnclose[i].addEventListener("click", function(e){
var parent = e.currentTarget.parentElement;
if(!parent.classList.contains("hidden")){
parent.classList.add("hidden");
}
});
}
}
function getQuery(param){
var result = "";
if(location.search.length > 0){
query = location.search.split("?")[1];
var variables = query.split("&")
for (var i=0; i<variables.length; i++){
if(variables[i].split("=")[0] == param){
result = variables[i].split("=")[1];
}
}
}
return result;
}
function updateParam(param, value){
var result = "";
if(location.search.length > 0){
query = location.search.split("?")[1];
var variables = query.split("&");
for (var i=0; i<variables.length; i++){
var data = variabes[i];
if(variables[i].split("=")[0] == param){
data = param+"="+value;
}
result = result + "&" + data;
}
}
return result;
}

View File

@ -1,8 +1,5 @@
instance.get("token", { withCredentials: true})
.then(function(response) { location.href="html/home.html"; })
.catch(function(error){
});
checkToken();
closeButton();
document.getElementById("signin").addEventListener("submit", function(evt){
evt.preventDefault();
@ -10,10 +7,13 @@ document.getElementById("signin").addEventListener("submit", function(evt){
var password = document.getElementById("floatingPassword");
if((password.value.length > 0) || (pseudo.value.length > 0)){
instance.get("token", { auth : {username: pseudo.value, password: password.value}, withCredentials: true})
.then(function(response) { location.href="html/home.html"; })
.then(function(response) { location.href="html/users.html"; })
.catch(function(error){
switch (error.response.status){
case 400:
id = "alertRequest"
break;
case 406:
id = "alertPassword";
break;
@ -39,14 +39,4 @@ document.getElementById("signin").addEventListener("submit", function(evt){
}
});
var btnclose = document.getElementsByClassName("btn-close");
for (var i = 0; i<btnclose.length; i++){
btnclose[i].addEventListener("click", function(){
var alertt = document.getElementsByClassName("alert");
for (var j=0; j<alertt.length; j++){
if(!alertt[j].classList.contains("hidden")){
alertt[j].classList.add("hidden");
}
}
});
}

184
web/js/user.js Normal file
View File

@ -0,0 +1,184 @@
checkToken();
signOut();
closeButton();
var id = getQuery("id");
if(id.length > 0){
instance.get("users/"+id, {withCredentials: true})
.then(function(response){
var listValue = [ "id", "pseudo", "name", "firstName", "email", "birth"];
var listTime = ["connected_at", "created_at", "updated_at", "deleted_at"];
for (var i=0; i<listValue.length; i++){
if(response.data[listValue[i]] != null){
document.getElementById(listValue[i]+"UpdateInput").value=response.data[listValue[i]];
}
}
for (var i=0; i<listTime.length; i++){
if(response.data[listTime[i]] != null){
document.getElementById(listTime[i]+"UpdateInput").value=new Date(response.data[listTime[i]]).toLocaleString();
}
}
var listSelector = ["roles", "status"];
for (var i=0; i<listSelector.length; i++){
var select = document.getElementById(listSelector[i]+"Selector").querySelectorAll("option");
for (var j=0; j<select.length; j++){
if(select[j].value == response.data[listSelector[i]]){
select[j].setAttribute("selected", true);
}
}
}
var buttonUser = "";
switch(response.data.status){
case 1:
buttonUser = "disableUser";
break;
case 2:
buttonUser = "enableUser";
break;
case -1:
buttonUser = "cancelUser";
document.getElementById("removeUser").classList.add("hidden");
break;
case 0:
buttonUser = "enableUser";
break;
default:
break;
}
if(buttonUser.length > 0){
document.getElementById(buttonUser).classList.remove("hidden");
}
var listModalButton = ["disable", "enable", "cancel", "remove"];
for (var i=0; i<listModalButton.length; i++){
document.getElementById(listModalButton[i]+"UserButton").addEventListener("click", function(e){
var httpMethod = ""
var httpUrl = "";
var idInput = document.getElementById("idUpdateInput").value;
switch(e.currentTarget.id){
case "disableUserButton":
httpMethod = "delete";
httpUrl = "users/disable/"+idInput;
break;
case "removeUserButton":
httpMethod = "delete";
httpUrl = "users/"+idInput;
break;
default:
httpMethod = "patch";
httpUrl = "users/enable/"+idInput;
break;
}
instance({
method: httpMethod,
url: httpUrl,
withCredentials: true
})
.then(function(response){
if(response.status == 200){
location.href="/html/user.html?id="+idInput;
}
})
.catch(function(error){
console.log(error);
});
});
}
})
.catch(function(error){
console.log(error);
});
document.getElementById("updateUserButton").addEventListener("click", function(){
var updateProfil = ["id", "pseudo", "email", "firstName", "birth"];
var updateOk = true;
for (var i=0; i<updateProfil.length; i++){
if(document.getElementById(updateProfil[i]+"UpdateInput").value.length == 0){
updateOk = false;
document.getElementById(updateProfil[i]+"Alert").classList.remove("hidden");
}
}
if(updateOk){
var selector = { "roles": "", "status": 0};
var listSelector = [ "roles", "status"];
for (var i=0; i<listSelector.length; i++){
var options = document.querySelectorAll("#"+listSelector[i]+"Selector option");
for (var j=0; j<options.length; j++){
if(options[j].selected){
selector[listSelector[i]] = options[j].value;
}
}
}
dataPut = {
"id": id,
"pseudo": document.getElementById("pseudoUpdateInput").value,
"email": document.getElementById("emailUpdateInput").value,
"name": document.getElementById("nameUpdateInput").value,
"firstName": document.getElementById("firstNameUpdateInput").value,
"birth": document.getElementById("birthUpdateInput").value,
"status": selector["status"],
"password": document.getElementById("passwordUpdateInput").value,
"roles": selector["roles"],
"created_at": "",
"updated_at": "",
"deleted_at": "",
"connected_at": ""
}
instance({
method : "patch",
url:"users/"+id,
withCredentials: true,
data: dataPut
}).then(function(response){
var idAlert = "";
switch(response.status){
case 200:
location.reload();
break;
case 304:
idAlert="noContent";
break;
default:
idAlert="unknown";
break;
}
document.getElementById(idAlert+"Alert").classList.remove("hidden");
}).catch(function(error){
var idAlert = "";
switch(error.status){
case 401:
idAlert="notAuthorized";
break;
case 403:
idAlert="forbidden";
break;
case 500:
idAlert="internalServer";
break;
default:
idAlert="unknown";
break;
}
document.getElementById(idAlert+"Alert").classList.remove("hidden");
});
}
});
}

156
web/js/users.js Normal file
View File

@ -0,0 +1,156 @@
checkToken();
signOut();
var param = {}
param["nbPages"] = 20;
var listSearch = [ "email", "uuid", "search"];
for(var i=0; i<listSearch.length; i++){
var search = getQuery(listSearch[i]);
if(search.length > 0){
document.getElementById("searchUser").value=search;
}
}
var listQuery = [{"query": "roles", "id":"inputRoles"}, {"query":"status", "id":"inputStatus"}]
for (var i=0; i<listQuery.length; i++){
var query = getQuery(listQuery[i]["query"]);
if(query.length > 0){
var listOption = document.querySelectorAll("#"+listQuery[i]["id"]+" option");
for(var j=0; j<listOption.length; j++){
if(query == listOption[j].value){
listOption[j].setAttribute("selected", true);
}
}
}
}
instance.get("users/count", { withCredentials: true }).then(function(response){
var count = response.data / param["nbPages"];
var reste = response.data % param["nbPages"];
var total = 0;
if(reste != 0){
total = Number.parseInt(count) + 1;
}
if(total > 1){
document.getElementById("page").classList.remove("hidden");
var pageCurrent = getQuery("page");
var page = 1;
if(pageCurrent.length > 0){
page = Number.parseInt(pageCurrent);
}
for (var i=0; i<total; i++){
var liPage = document.querySelectorAll(".page-item")[i+1];
var cloneLi = liPage.cloneNode(true);
liPage.after(cloneLi);
var newPage = i + 2;
var aPage = document.querySelectorAll(".page-item")[newPage].querySelector("a");
aPage.text=newPage;
var newPage = updateParam("page", newpage);
aPage.href="/html/users.html?"+newPage;
}
document.querySelectorAll(".page-item")[page].classList.add("active");
if(page != 1){
document.querySelectorAll(".page-item")[0].classList.remove("disabled");
}
if(page == total){
document.querySelectorAll(".page-item")[page].classList.add("disabled");
}
}
});
param["page"] = 0;
var pageCurrent = getQuery("page");
if (pageCurrent.length > 0){
param["page"] = Number.parseInt(pageCurrent);
param["page"] = param["page"] - 1;
}
var listQuery = ["search", "uuid", "roles", "status", "email"];
for (var i=0; i<listQuery.length; i++){
var query = getQuery(listQuery[i]);
if(query.length > 0){
param[listQuery[i]]=query;
}
}
instance.get("users", {withCredentials: true, params :param}).then(function(response){
var listData = response.data;
if(!Array.isArray(listData)){
var listData = []
listData.push(response.data);
}
for (var i=0; i<listData.length; i++){
var trTag = document.querySelector("#users tbody tr").cloneNode(true);
if(i != 0){
document.querySelector("#users tbody").append(trTag);
}
var trAll = document.querySelectorAll("#users tbody tr")
td = trAll[i].querySelectorAll("td");
td[0].textContent = listData[i].id;
td[1].textContent = listData[i].pseudo;
td[2].textContent = listData[i].email;
td[3].textContent = listData[i].roles;
var classTd = "";
switch(listData[i].status){
case 1:
classTd = ".activeStatus";
break;
case 0:
classTd = ".disableStatus";
break;
case 2:
classTd = ".confirmStatus";
break;
case -1:
classTd = ".removeStatus";
break;
default:
classTd = ".unknownStatus"
break;
}
td[4].querySelector(".activeStatus").classList.add("hidden");
td[4].querySelector(classTd).classList.remove("hidden");
trAll[i].addEventListener("click", function(e){
var id = e.currentTarget.querySelector("td").textContent;
location.href="/html/user.html?id="+id;
});
}
});
document.getElementById("addUser").addEventListener("click", function(){
location.href="/html/adduser.html";
});
document.getElementById("searchUser").addEventListener("keydown", function(ev){
if(ev.key === "Enter"){
var param = buildParam("", "");
location.href="/html/users.html?"+param;
}
});
document.getElementById("inputStatus").addEventListener("change", function(e){
var param = buildParam(e, "inputRoles");
location.href="/html/users.html?"+param;
});
document.getElementById("inputRoles").addEventListener("change", function(e){
var param = buildParam(e, "inputStatus");
location.href="/html/users.html?"+param;
});