1
0

notif.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% for message in notif.messages %}
  2. <tr class="{{ "historical_message" if message.is_historical else "message" }}">
  3. <td class="sender_avatar">
  4. {% if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
  5. {% if message.sender_avatar_url %}
  6. <img alt="" class="sender_avatar" src="{{ message.sender_avatar_url|mxc_to_http(32,32) }}" />
  7. {% else %}
  8. {% if message.sender_hash % 3 == 0 %}
  9. <img class="sender_avatar" src="https://vector.im/beta/img/76cfa6.png" />
  10. {% elif message.sender_hash % 3 == 1 %}
  11. <img class="sender_avatar" src="https://vector.im/beta/img/50e2c2.png" />
  12. {% else %}
  13. <img class="sender_avatar" src="https://vector.im/beta/img/f4c371.png" />
  14. {% endif %}
  15. {% endif %}
  16. {% endif %}
  17. </td>
  18. <td class="message_contents">
  19. {% if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
  20. <div class="sender_name">{% if message.msgtype == "m.emote" %}*{% endif %} {{ message.sender_name }}</div>
  21. {% endif %}
  22. <div class="message_body">
  23. {% if message.msgtype == "m.text" %}
  24. {{ message.body_text_html }}
  25. {% elif message.msgtype == "m.emote" %}
  26. {{ message.body_text_html }}
  27. {% elif message.msgtype == "m.notice" %}
  28. {{ message.body_text_html }}
  29. {% elif message.msgtype == "m.image" %}
  30. <img src="{{ message.image_url|mxc_to_http(640, 480, scale) }}" />
  31. {% elif message.msgtype == "m.file" %}
  32. <span class="filename">{{ message.body_text_plain }}</span>
  33. {% endif %}
  34. </div>
  35. </td>
  36. <td class="message_time">{{ message.ts|format_ts("%H:%M") }}</td>
  37. </tr>
  38. {% endfor %}
  39. <tr class="notif_link">
  40. <td></td>
  41. <td>
  42. <a href="{{ notif.link }}">View {{ room.title }}</a>
  43. </td>
  44. <td></td>
  45. </tr>