notif.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. <div class="notif">
  2. <div>
  3. {% for message in notif.messages %}
  4. <div class="message {% if message.is_historical %}historical{% endif %}">
  5. {% if message.sender_avatar_url %}
  6. <img class="sender_avatar" src="{{ message.sender_avatar_url|mxc_to_http(48,48) }}" />
  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. <img class="sender_avatar" src="{{ message.sender_avatar_url }}" />
  16. {% endif %}
  17. <div class="sender_name">{{ message.sender_name }}</div>
  18. <div class="message_time">{{ message.ts|format_ts("%H:%M") }}</div>
  19. <div class="message_body">
  20. {% if message.msgtype == "m.text" %}
  21. {{ message.body_text_html }}
  22. {% elif message.msgtype == "m.image" %}
  23. <img src="{{ message.image_url|mxc_to_http(640, 480, scale) }}" />
  24. {% elif message.msgtype == "m.file" %}
  25. <span class="filename">{{ message.body_text_plain }}</span>
  26. {% endif %}
  27. </div>
  28. </div>
  29. {% endfor %}
  30. </div>
  31. <div class="notif_link">
  32. <a href="{{ notif.link }}">View</a>
  33. </div>
  34. </div>