Docfile commited on
Commit
af0ef9e
·
verified ·
1 Parent(s): c5d8c3f

Update templates/thread.html

Browse files
Files changed (1) hide show
  1. templates/thread.html +7 -3
templates/thread.html CHANGED
@@ -8,6 +8,9 @@
8
  {% for msg in messages %}
9
  <div class="message {% if msg.removed %}bg-gray-200 text-gray-500{% else %}bg-white{% endif %} p-4 rounded-md shadow-sm"> <!-- Style du message, condition pour les messages supprimés -->
10
  {% if not msg.removed %}
 
 
 
11
  <p class="text-gray-800">{{ msg.content | safe }}</p> <!-- Contenu du message -->
12
  <div class="text-sm text-gray-500 mt-1 mb-2"> <!-- Informations sur le message -->
13
  Posté le {{ msg.timestamp.strftime('%d/%m/%Y %H:%M:%S') }} - Votes: {{ msg.vote_count }}
@@ -36,7 +39,7 @@
36
 
37
  </button>
38
  </form>
39
- <button onclick="quoteMessage('{{ msg.id }}', '{{ msg.content|escapejs }}')"
40
  class="text-blue-500 hover:text-blue-700 transition-colors duration-200">
41
  Citer
42
  </button>
@@ -84,9 +87,10 @@ function previewMessage() {
84
  });
85
  }
86
 
87
- function quoteMessage(messageId, content) {
88
  const replyArea = document.getElementById('reply-content');
89
- const quotedContent = `<div class="quoted-text"><p class="quoted-message-id">ID du message: ${messageId}</p>${content}</div>`;
 
90
  replyArea.value = quotedContent + "\n\n" + replyArea.value;
91
  replyArea.focus();
92
  }
 
8
  {% for msg in messages %}
9
  <div class="message {% if msg.removed %}bg-gray-200 text-gray-500{% else %}bg-white{% endif %} p-4 rounded-md shadow-sm"> <!-- Style du message, condition pour les messages supprimés -->
10
  {% if not msg.removed %}
11
+ <!-- Affichage du nom d'utilisateur -->
12
+ <p class="text-blue-600 font-semibold mb-1">{{ user_id_to_username[msg.user_id] }}</p>
13
+
14
  <p class="text-gray-800">{{ msg.content | safe }}</p> <!-- Contenu du message -->
15
  <div class="text-sm text-gray-500 mt-1 mb-2"> <!-- Informations sur le message -->
16
  Posté le {{ msg.timestamp.strftime('%d/%m/%Y %H:%M:%S') }} - Votes: {{ msg.vote_count }}
 
39
 
40
  </button>
41
  </form>
42
+ <button onclick="quoteMessage('{{ msg.id }}', '{{ msg.content|escapejs }}', '{{ user_id_to_username[msg.user_id] }}')"
43
  class="text-blue-500 hover:text-blue-700 transition-colors duration-200">
44
  Citer
45
  </button>
 
87
  });
88
  }
89
 
90
+ function quoteMessage(messageId, content, username) {
91
  const replyArea = document.getElementById('reply-content');
92
+ // Ajout du nom d'utilisateur à la citation
93
+ const quotedContent = `<div class="quoted-text"><p class="quoted-message-id">ID: ${messageId} - ${username} a dit:</p>${content}</div>`;
94
  replyArea.value = quotedContent + "\n\n" + replyArea.value;
95
  replyArea.focus();
96
  }