87 lines
2.8 KiB
Cheetah
87 lines
2.8 KiB
Cheetah
{{ define "adminconversations.pages.tmpl" }}
|
|
{{ template "head" . }}
|
|
|
|
<div class="columns">
|
|
{{ template "sidebar" . }}
|
|
|
|
<div class="column is-10">
|
|
<section class="section">
|
|
<h1 class="title is-4">💬 Historique des messages — Utilisateur #{{ .UserID }}</h1>
|
|
|
|
<!-- Filtres JS -->
|
|
<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)">
|
|
</div>
|
|
<div class="column is-2">
|
|
<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)">
|
|
</div>
|
|
<div class="column is-2">
|
|
<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)">
|
|
</div>
|
|
<div class="column is-2">
|
|
<input type="text" class="input is-small" placeholder="✅ Statut"
|
|
onkeyup="filterTable(5, this.value)">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tableau HTMX -->
|
|
<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>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="conversationRows"
|
|
hx-get="/api/user/{{ .UserID }}/conversations"
|
|
hx-trigger="load"
|
|
hx-target="this"
|
|
hx-swap="innerHTML">
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<h2 class="title is-5 mt-5">🧵 Conversation complète</h2>
|
|
<div id="threadViewer" class="box mt-3"></div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function filterTable(colIndex, filterValue) {
|
|
const table = document.getElementById("conversationTable");
|
|
const rows = table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
|
|
filterValue = filterValue.toLowerCase();
|
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
const td = rows[i].getElementsByTagName("td")[colIndex];
|
|
if (td) {
|
|
const text = td.textContent || td.innerText;
|
|
rows[i].style.display = text.toLowerCase().includes(filterValue) ? "" : "none";
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
{{ end }}
|