KKKKK
This commit is contained in:
parent
c3ae311666
commit
8152bdb417
@ -8,47 +8,41 @@
|
||||
<section class="section">
|
||||
<h1 class="title is-4">💬 Historique des messages — Utilisateur #{{ .UserID }}</h1>
|
||||
|
||||
<!-- Filtres JS -->
|
||||
<!-- Filtres -->
|
||||
<div class="box mb-4">
|
||||
<h2 class="subtitle is-6">🔍 Filtres personnalisés</h2>
|
||||
<div class="columns is-multiline">
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="📅 Date"
|
||||
onkeyup="filterTable(0, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="📅 Date" onkeyup="filterTable(0, this.value)">
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="➡️ Direction"
|
||||
onkeyup="filterTable(1, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="➡️ Direction" onkeyup="filterTable(1, this.value)">
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="📨 Expéditeur"
|
||||
onkeyup="filterTable(2, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="📨 Expéditeur" onkeyup="filterTable(2, this.value)">
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="📦 Type"
|
||||
onkeyup="filterTable(3, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="📦 Type" onkeyup="filterTable(3, this.value)">
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="💬 Contenu"
|
||||
onkeyup="filterTable(4, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="💬 Contenu" onkeyup="filterTable(4, this.value)">
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<input type="text" class="input is-small" placeholder="✅ Statut"
|
||||
onkeyup="filterTable(5, this.value)">
|
||||
<input type="text" class="input is-small" placeholder="✅ Statut" onkeyup="filterTable(5, this.value)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tableau HTMX -->
|
||||
<!-- Tableau -->
|
||||
<table class="table is-fullwidth is-striped is-hoverable" id="conversationTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Direction</th>
|
||||
<th>Expéditeur</th>
|
||||
<th>Type</th>
|
||||
<th>Contenu</th>
|
||||
<th>Statut</th>
|
||||
<th onclick="sortTable(0)">📅 Date</th>
|
||||
<th onclick="sortTable(1)">➡️ Direction</th>
|
||||
<th onclick="sortTable(2)">📨 Expéditeur</th>
|
||||
<th onclick="sortTable(3)">📦 Type</th>
|
||||
<th onclick="sortTable(4)">💬 Contenu</th>
|
||||
<th onclick="sortTable(5)">✅ Statut</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="conversationRows"
|
||||
@ -60,7 +54,6 @@
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 class="title is-5 mt-5">🧵 Conversation complète</h2>
|
||||
<div id="threadViewer" class="box mt-3"></div>
|
||||
</section>
|
||||
@ -81,6 +74,24 @@ function filterTable(colIndex, filterValue) {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
function sortTable(colIndex) {
|
||||
const table = document.getElementById("conversationTable");
|
||||
const tbody = table.tBodies[0];
|
||||
const rows = Array.from(tbody.querySelectorAll("tr"));
|
||||
|
||||
const isAscending = table.getAttribute("data-sort-dir") !== "asc";
|
||||
table.setAttribute("data-sort-dir", isAscending ? "asc" : "desc");
|
||||
|
||||
rows.sort((a, b) => {
|
||||
const cellA = a.children[colIndex].innerText.toLowerCase();
|
||||
const cellB = b.children[colIndex].innerText.toLowerCase();
|
||||
return isAscending
|
||||
? cellA.localeCompare(cellB, 'fr', { numeric: true })
|
||||
: cellB.localeCompare(cellA, 'fr', { numeric: true });
|
||||
});
|
||||
|
||||
rows.forEach(row => tbody.appendChild(row));
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user