timeline-tweet.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <div class="dtc w-10">
  2. <img src="{{ tweet.avi_icon_url }}" alt="Avi">
  3. </div>
  4. <div class="dtc w-90 v-top">
  5. <p class="w-100 mt0 pt0">
  6. <strong><a href="{{ tweet.author_url }}" class="w-100">{{ tweet.display_name }}</a></strong>
  7. {% if tweet.author_is_verified %}
  8. <small class="verified">[verified]</small>
  9. {% endif %}
  10. <a href="{{ tweet.author_url }}" class="silver">@{{ tweet.handle }}</a>
  11. <a href="{{ tweet.url }}">{{ tweet.created_at }}</a> [<a href="{{ tweet.source_url }}" target="tweet_{{ tweet.id }}">source</a>]
  12. </p>
  13. <p class="w-100">
  14. {% if tweet.html %}
  15. {{ tweet.html | safe }}
  16. {% else %}
  17. {{ tweet.text | replace('<', '&lt;') | replace('\n', '<br>') | safe }}
  18. {% endif %}
  19. </p>
  20. {% if tweet.quoted_tweet %}
  21. <div class="dt qt-box">
  22. <div class="dt-row">
  23. {% with tweet = tweet.quoted_tweet %}
  24. {% include "partial/timeline-tweet.html" %}
  25. {% endwith %}
  26. </div>
  27. </div>
  28. {% endif %}
  29. {% if tweet.replied_tweet %}
  30. <p style="color: silver">
  31. Replying to:
  32. </p>
  33. <div class="reply_to w-100" style="border: 1px solid silver; padding: 6px">
  34. <div class="dt reply-box">
  35. <div class="dt-row">
  36. {% with tweet = tweet.replied_tweet %}
  37. {% include "partial/timeline-tweet.html" %}
  38. {% endwith %}
  39. </div>
  40. </div>
  41. </div>
  42. {% elif tweet.replied_tweet_id %}
  43. <p style="color: silver">
  44. Replying to:
  45. </p>
  46. <p class="reply_to w-100" style="border: 1px solid silver; padding: 6px">
  47. <a href="{{ url_for('.get_tweet_html', tweet_id=tweet.replied_tweet_id, view='replies', marked_reply=tweet.id ) }}">View in Thread</a>.
  48. </p>
  49. {% endif %}
  50. {% if tweet.note %}
  51. <p class="note w-100" style="border: 1px solid black; background-color: yellow; padding: 6px">
  52. {{ tweet.note.replace('\n', '<br>') | safe }}
  53. </p>
  54. {% endif %}
  55. {% if tweet.photos %}
  56. <p class="w-100">
  57. <ul>
  58. {% for photo in tweet.photos %}
  59. <li><img class="w-100" src="{{ photo.preview_image_url }}" crossorigin="" referrerpolicy="no-referrer" onclick="this.src='{{ photo.url }}'"></li>
  60. {% endfor %}
  61. </ul>
  62. </p>
  63. {% endif %}
  64. {% if tweet.videos %}
  65. <p class="w-100">
  66. <p>VIDEOS</p>
  67. <ul>
  68. {% for video in tweet.videos %}
  69. <li><img class="w-100" src="{{ video.preview_image_url }}" referrerpolicy="no-referrer" onclick="this.src='{{ video.image_url }}'"></li>
  70. {% endfor %}
  71. </ul>
  72. </p>
  73. {% endif %}
  74. {% if tweet.card %}
  75. <div class="card-box w-100">
  76. <p><a href="{{ tweet.card.source_url }}">{{ tweet.card.display_url }}</a></p>
  77. <p><strong>{{ tweet.card.title }}</strong></p>
  78. <p>{{ tweet.card.content }}</p>
  79. </div>
  80. {% endif %}
  81. {% if False and tweet.replied_tweet %}
  82. <a href="{{ tweet.replied_tweet.url }}">View Parent</a>
  83. <a href="{{ url_for('.get_tweet_html', tweet_id=tweet.replied_tweet.conversation_id) }}">View Conversation</a>
  84. {% endif %}
  85. {% if tweet.public_metrics %}
  86. <p class="w-100">
  87. {% for k, v in tweet.public_metrics.items() %}
  88. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  89. {% endfor %}
  90. </p>
  91. {% endif %}
  92. {% if tweet.non_public_metrics %}
  93. <p class="w-100">
  94. {% for k, v in tweet.non_public_metrics.items() %}
  95. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  96. {% endfor %}
  97. </p>
  98. {% endif %}
  99. </div>