citations
This commit is contained in:
184
citations/html/accueil.html
Normal file
184
citations/html/accueil.html
Normal file
@@ -0,0 +1,184 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Citations - L'Il'eau chiens - Admin</title>
|
||||
<link href="/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/node_modules/bs-icon/icons.css">
|
||||
<link rel="shortcut icon" href="favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<link rel="stylesheet" href="/css/citations.css">
|
||||
<link rel="shortcut icon" href="/favicon.png" type="image/png">
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-xxl bg-body-tertiary">
|
||||
<div class="container-fluid align-items-center">
|
||||
<a class="navbar-brand" href="#">L'Il'eau chiens - Admin</a>
|
||||
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" aria-current="page" href="#">Blog</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" href="#">Boutique</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" href="#">Prestations</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" href="#">FAQ</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" href="#">Fiche renseignements</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link left-label" href="#">Partenaires</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active left-label" href="#">Citations</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#"><i class="bi bi-megaphone me-1"></i> Message d'actu</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#"><i class="bi bi-box-arrow-up-right me-1"></i> Voir le site</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#"><i class="bi bi-gear me-1"></i> Configuration</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userMenu" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-person-circle me-1"></i> <span id="userFirstName">Prénom</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userMenu">
|
||||
<li><a class="dropdown-item" href="#">Profil</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#">Sortir</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
<main class="my-5 fs-6">
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1 class="title my-4 fs-2">Liste des citations</h1>
|
||||
</header>
|
||||
<main>
|
||||
<div class="ajouter">
|
||||
<a href="#" class="btn btn-primary btn-sm my-2">Ajouter une citation</a>
|
||||
</div>
|
||||
<section class="chiens my-4">
|
||||
<h2 class="fs-4">Citations chiens</h2>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>Citations</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Le chien est le seul être sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Un chien est la seule chose sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="chats my-4">
|
||||
<h2 class="fs-4">Citations chats</h2>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>Citations</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Le chien est le seul être sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Un chien est la seule chose sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="chats my-4">
|
||||
<h2 class="fs-4">Citations divers</h2>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>Citations</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Le chien est le seul être sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Un chien est la seule chose sur terre qui vous aime plus qu'il ne s'aime lui-même. (Josh Billings)</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-outline-primary me-2">Modifier</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-danger">Supprimer</a>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<script src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="../js/contentReduct.js"></script>
|
||||
|
||||
</html>
|
||||
43
citations/js/contentReduct.js
Normal file
43
citations/js/contentReduct.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Réduit le contenu des cellules td des tableaux
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const BREAKPOINT_SM = 1000;
|
||||
(() => {
|
||||
// Récupère les cellules td (premier d'un tr) à traiter
|
||||
const getTargetCells = () => {
|
||||
const tbodyRows = Array.from(document.querySelectorAll("tbody tr"));
|
||||
let cells = tbodyRows.map((row) => row.querySelector("td")).filter(Boolean);
|
||||
if (cells.length === 0) {
|
||||
const allRows = Array.from(document.querySelectorAll("tr"));
|
||||
cells = allRows.map((row) => row.querySelector("td")).filter(Boolean);
|
||||
}
|
||||
return cells;
|
||||
};
|
||||
|
||||
const tdElts = getTargetCells();
|
||||
|
||||
tdElts.forEach((td) => {
|
||||
if (!td.dataset.fullText) {
|
||||
td.dataset.fullText = td.textContent.trim();
|
||||
}
|
||||
});
|
||||
|
||||
const applyTruncation = () => {
|
||||
const narrow = window.innerWidth < BREAKPOINT_SM;
|
||||
tdElts.forEach((td) => {
|
||||
const full = td.dataset.fullText ?? td.textContent;
|
||||
const text = (full || "").trim();
|
||||
if (narrow) {
|
||||
td.textContent = text.length > 40 ? text.slice(0, 40) + '...': text;
|
||||
} else {
|
||||
td.textContent = full;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
applyTruncation();
|
||||
window.addEventListener("resize", applyTruncation);
|
||||
})();
|
||||
Reference in New Issue
Block a user