-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
partie admin onglets utilisateurs et demandes terminés (reste l'ongle…
…t accueil et offres + rediriger vers page candidat et afficher bouton administrer)
- Loading branch information
Showing
8 changed files
with
210 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Demandes</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" | ||
crossorigin="anonymous"></script> | ||
</head> | ||
<body> | ||
|
||
<%- include('../partials/adminHeader.ejs') %>. | ||
|
||
<div class="container col-xxl-8 px-4 py-5"> | ||
|
@@ -21,66 +8,123 @@ | |
<h5>Entreprise</h5> | ||
<select class="form-select" id="entrepriseFilter"> | ||
<option value="">Toutes les entreprises</option> | ||
<option value="Carrefour">Carrefour</option> | ||
<option value="Renault">Renault</option> | ||
<option value="Orpi">Orpi</option> | ||
<% organisations.forEach((organisation) => { %> | ||
<option value="<%= organisation.nom %>"><%= organisation.nom %></option> | ||
<% }) %> | ||
</select> | ||
|
||
<table class="table mt-4"> | ||
<thead> | ||
<tr> | ||
<th scope="col">id</th> | ||
<th scope="col">Nom</th> | ||
<th scope="col">Prénom</th> | ||
<th scope="col">Entreprise</th> | ||
<th scope="col">Détails</th> | ||
<th scope="col">Statut</th> | ||
</tr> | ||
</thead> | ||
<tbody id="demandesTableBody"> | ||
<% users.forEach((user) => { %> | ||
<tr class="demandeRow"> | ||
<td><%= user.email %></td> | ||
<td><%= user.nom %></td> | ||
<td><%= user.prenom %></td> | ||
<td><%= user.organisation.nom %></td> | ||
<td> | ||
<a href="/admin/demande/<%= user.email %>" class="btn btn-outline-primary btn-sm">Détails</a> | ||
</td> | ||
<td> | ||
<a href="/admin/refuserDemande/<%= user.email %>" type="button" | ||
class="btn btn-danger btn-sm">Refuser</a> | ||
<a href="/admin/accepterDemande/<%= user.email %>" type="button" | ||
class="btn btn-success btn-sm">Accepter</a> | ||
</td> | ||
</tr> | ||
<% }) %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
function filterDemandes() { | ||
const entrepriseFilter = document.querySelector("#entrepriseFilter").value; | ||
<div class="accordion mt-4" id="demandesAccordion"> | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="nouvellesDemandesHeader"> | ||
<button class="accordion-button" type="button" data-bs-toggle="collapse" | ||
data-bs-target="#nouvellesDemandesCollapse" aria-expanded="true" | ||
aria-controls="nouvellesDemandesCollapse"> | ||
Nouvelles demandes | ||
</button> | ||
</h2> | ||
<div id="nouvellesDemandesCollapse" class="accordion-collapse collapse show" | ||
aria-labelledby="nouvellesDemandesHeader" data-bs-parent="#demandesAccordion"> | ||
<div class="accordion-body"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">id</th> | ||
<th scope="col">Nom</th> | ||
<th scope="col">Prénom</th> | ||
<th scope="col">Entreprise</th> | ||
<th scope="col">Détails</th> | ||
<th scope="col">Statut</th> | ||
</tr> | ||
</thead> | ||
<tbody id="demandesTableBody"> | ||
<% users.forEach((user) => { %> | ||
<tr class="demandeRow"> | ||
<td><%= user.email %></td> | ||
<td><%= user.nom %></td> | ||
<td><%= user.prenom %></td> | ||
<td><%= user.organisation.nom %></td> | ||
<td> | ||
<a href="/admin/demande/<%= user.email %>" | ||
class="btn btn-outline-primary btn-sm">Détails</a> | ||
</td> | ||
<td> | ||
<a href="/admin/refuserDemande/<%= user.email %>" type="button" | ||
class="btn btn-danger btn-sm">Refuser</a> | ||
<a href="/admin/accepterDemande/<%= user.email %>" type="button" | ||
class="btn btn-success btn-sm">Accepter</a> | ||
</td> | ||
</tr> | ||
<% }) %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="anciennesDemandesHeader"> | ||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" | ||
data-bs-target="#anciennesDemandesCollapse" aria-expanded="false" | ||
aria-controls="anciennesDemandesCollapse"> | ||
Anciennes demandes | ||
</button> | ||
</h2> | ||
<div id="anciennesDemandesCollapse" class="accordion-collapse collapse" | ||
aria-labelledby="anciennesDemandesHeader" data-bs-parent="#demandesAccordion"> | ||
<div class="accordion-body"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">id</th> | ||
<th scope="col">Nom</th> | ||
<th scope="col">Prénom</th> | ||
<th scope="col">Entreprise</th> | ||
<th scope="col">Détails</th> | ||
<th scope="col">Statut</th> | ||
</tr> | ||
</thead> | ||
<tbody id="oldDemandesTableBody"> | ||
<% oldUsers.forEach((user) => { %> | ||
<tr class="demandeRow"> | ||
<td><%= user.email %></td> | ||
<td><%= user.nom %></td> | ||
<td><%= user.prenom %></td> | ||
<td><%= user.organisation.nom %></td> | ||
<td> | ||
<a href="/admin/demande/<%= user.email %>" | ||
class="btn btn-outline-primary btn-sm">Détails</a> | ||
</td> | ||
<td class="<%= user.demande_organisation === 'acceptation' ? 'text-success' : (user.demande_organisation === 'refus' ? 'text-danger' : '') %>"> | ||
<%= user.demande_organisation === 'acceptation' ? 'Accepté' : (user.demande_organisation === 'refus' ? 'Refusé' : '') %> | ||
</td> | ||
</tr> | ||
<% }) %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
const demandeRows = document.querySelectorAll(".demandeRow"); | ||
demandeRows.forEach((row) => { | ||
const entrepriseCell = row.querySelector("td:nth-child(4)"); | ||
const entrepriseValue = entrepriseCell.textContent.trim(); | ||
<script> | ||
function filterDemandes() { | ||
const entrepriseFilter = document.querySelector("#entrepriseFilter").value; | ||
const shouldShowRow = ( | ||
entrepriseFilter === "" || entrepriseValue === entrepriseFilter | ||
); | ||
const demandeRows = document.querySelectorAll(".demandeRow"); | ||
demandeRows.forEach((row) => { | ||
const entrepriseCell = row.querySelector("td:nth-child(4)"); | ||
const entrepriseValue = entrepriseCell.textContent.trim(); | ||
row.style.display = shouldShowRow ? "table-row" : "none"; | ||
}); | ||
} | ||
const shouldShowRow = ( | ||
entrepriseFilter === "" || entrepriseValue === entrepriseFilter | ||
); | ||
const entrepriseFilter = document.querySelector("#entrepriseFilter"); | ||
entrepriseFilter.addEventListener("change", filterDemandes); | ||
</script> | ||
row.style.display = shouldShowRow ? "table-row" : "none"; | ||
}); | ||
} | ||
</body> | ||
</html> | ||
const entrepriseFilter = document.querySelector("#entrepriseFilter"); | ||
entrepriseFilter.addEventListener("change", filterDemandes); | ||
</script> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.