This commit is contained in:
cangui 2025-05-09 17:05:31 +02:00
parent ecc1c44b60
commit 14cdf9c0e3
2 changed files with 36 additions and 34 deletions

View File

@ -2,38 +2,39 @@
{{ template "head" . }} {{ template "head" . }}
<div class="columns"> <div class="columns">
{{ template "sidebar" . }} {{ template "sidebar" . }}
<h2>Historique des messages de l'utilisateur #{{ .UserID }}</h2> <div class="column is-10">
<h2>Historique des messages de l'utilisateur #{{ .UserID }}</h2>
<div class="mb-3"> <div class="mb-3">
<label>Filtrer par type :</label> <label>Filtrer par type :</label>
<select id="filterType" name="type" hx-get="/api/user/{{ .UserID }}/conversations" hx-target="#conversationRows" hx-trigger="change" hx-include="#filterType"> <select id="filterType" name="type" hx-get="/api/user/{{ .UserID }}/conversations" hx-target="#conversationRows"
<option value="">Tous</option> hx-trigger="change" hx-include="#filterType">
<option value="text">Texte</option> <option value="">Tous</option>
<option value="image">Image</option> <option value="text">Texte</option>
<option value="video">Vidéo</option> <option value="image">Image</option>
<option value="interactive">Interactif</option> <option value="video">Vidéo</option>
</select> <option value="interactive">Interactif</option>
</select>
</div>
<table class="table">
<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>
<h3>Conversation complète</h3>
<div id="threadViewer" class="mt-3"></div>
</div>
</div> </div>
{{ end }}
<table class="table">
<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>
<h3>Conversation complète</h3>
<div id="threadViewer" class="mt-3"></div>
{{ end }}

View File

@ -5,9 +5,10 @@
<li><a href="/dashboard">🏠 Dashboard</a></li> <li><a href="/dashboard">🏠 Dashboard</a></li>
{{ if eq .User.Role "ADMIN" }} {{ if eq .User.Role "ADMIN" }}
<li><a href="/admin/users">👤 Utilisateurs</a></li> <li><a href="/admin/user/new">👤 Utilisateurs</a></li>
<li><a href="/test/send">📤 Test envoi</a></li> <li><a href="/test/send">📤 Test envoi</a></li>
<li><a href="/test/send2">📤 Test envoi template</a></li> <li><a href="/test/send2">📤 Test envoi template</a></li>
{{ end }} {{ end }}
<li><a href="/admin/user/{{ .User.ID }}/conversations">💬 Mes conversations</a></li> <li><a href="/admin/user/{{ .User.ID }}/conversations">💬 Mes conversations</a></li>