timeline-tweet-bs.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <div style="width: 60px; max-width: 60px; min-width: 60px">
  2. <img loading="lazy" src="{{ tweet.avi_icon_url }}" alt="Avi">
  3. </div>
  4. <div class="d-flex flex-column flex-grow-1">
  5. <p class="mt-0 pt-0">
  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>
  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="d-flex flex-row">
  22. {% with tweet = tweet.quoted_tweet %}
  23. {% include "partial/timeline-tweet-bs.html" %}
  24. {% endwith %}
  25. </div>
  26. {% endif %}
  27. {% if not skip_embed_replies %}
  28. {% if tweet.replied_tweet %}
  29. <p style="color: silver">
  30. Replying to:
  31. </p>
  32. <div class="reply_to" style="border: 1px solid silver; padding: 6px">
  33. <div class="d-flex flex-row reply-box">
  34. {% with tweet = tweet.replied_tweet %}
  35. {% include "partial/timeline-tweet-bs.html" %}
  36. {% endwith %}
  37. </div>
  38. </div>
  39. {% elif tweet.replied_tweet_id %}
  40. <p style="color: silver">
  41. Replying to:
  42. </p>
  43. {% if tweet.actions.view_replied_tweet %}
  44. <p class="reply_to w-100" style="border: 1px solid silver; padding: 6px">
  45. <a href="{{ url_for(tweet.actions.view_replied_tweet.route, **tweet.actions.view_replies.route_params) }}">View in Thread</a>.
  46. </p>
  47. {% endif %}
  48. {% endif %}
  49. {% endif %}
  50. {% if tweet.note %}
  51. <p class="note" 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. <ul>
  57. {% for photo in tweet.photos %}
  58. <li><img loading="lazy" class="w-100" src="{{ photo.preview_image_url }}" crossorigin="" referrerpolicy="no-referrer" onclick="this.src='{{ photo.url }}'"></li>
  59. {% endfor %}
  60. </ul>
  61. {% endif %}
  62. {% if tweet.videos %}
  63. <ul>
  64. {% for video in tweet.videos %}
  65. <li><img loading="lazy" class="w-100"
  66. src="{{ video.preview_image_url }}" referrerpolicy="no-referrer"
  67. {% if video.image_url %}
  68. onclick="this.src='{{ video.image_url }}'; this.onclick = undefined"
  69. {% endif %}
  70. {% if video.url %}
  71. ondblclick="swapVideoPlayer(this, '{{ video.url }}', '{{ video.content_type }}')"
  72. {% endif %}
  73. >
  74. <dl>
  75. {% if video.duration_str %}
  76. <dt>Duration</dt>
  77. <dd>{{ video.duration_str }}</dt>
  78. {% elif video.duration_ms %}
  79. <dt>Duration</dt>
  80. <dd>{{ video.duration_ms / 1000 / 60 }} minutes</dt>
  81. {% endif %}
  82. </dl>
  83. {% if video.public_metrics and video.public_metrics.view_count %}
  84. <p class="w-100">
  85. view count: {{ video.public_metrics.view_count }}
  86. </p>
  87. {% endif %}
  88. </li>
  89. {% endfor %}
  90. </ul>
  91. {% endif %}
  92. {% if tweet.card %}
  93. <div class="card-box d-flex">
  94. {% if tweet.card.preview_image_url %}
  95. <img
  96. class="me-1"
  97. style=" max-height: 150px; max-width: 150px;"
  98. src="{{ tweet.card.preview_image_url }}">
  99. {% endif %}
  100. <div class="d-flex flex-column">
  101. <span><a href="{{ tweet.card.source_url }}">{{ tweet.card.display_url }}</a></span>
  102. <span><strong>{{ tweet.card.title }}</strong></span>
  103. <p>{{ tweet.card.content }}</p>
  104. </div>
  105. </div>
  106. {% endif %}
  107. {% if False and tweet.replied_tweet %}
  108. <a href="{{ tweet.replied_tweet.url }}">View Parent</a>
  109. <a href="{{ url_for('.get_tweet_html', tweet_id=tweet.replied_tweet.conversation_id) }}">View Conversation</a>
  110. {% endif %}
  111. {% if tweet.public_metrics %}
  112. <p>
  113. {% for k, v in tweet.public_metrics.items() %}
  114. {% if v != None %}
  115. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  116. {% endif %}
  117. {% endfor %}
  118. </p>
  119. {% endif %}
  120. {% if tweet.non_public_metrics %}
  121. <p>
  122. {% for k, v in tweet.non_public_metrics.items() %}
  123. {% if v != None %}
  124. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  125. {% endif %}
  126. {% endfor %}
  127. </p>
  128. {% endif %}
  129. {% if tweet.attachments %}
  130. <ul>
  131. {% for a in tweet.attachments %}
  132. {% if a.content_type == 'application/vnd-hogumathi.livestream-details+json' %}
  133. <li class="livestream-details">
  134. <dl>
  135. {% if a.content.scheduled_start_time %}
  136. <dt>Scheduled Start Time</dt>
  137. <dd>{{ a.content.scheduled_start_time }}</dd>
  138. {% endif %}
  139. {% if a.content.start_time %}
  140. <dt>Start Time</dt>
  141. <dd>{{ a.content.start_time }}</dd>
  142. {% endif %}
  143. {% if a.content.chat_embed_url %}
  144. <dt>Chat</dt>
  145. <dd>
  146. <iframe class="w-100" height="400" src="{{ a.content.chat_embed_url }}" referrerpolicy="origin"></iframe>
  147. </dd>
  148. {% endif %}
  149. </dl>
  150. </li>
  151. {% else %}
  152. <li><a href="{{ a.url }}">{{ a.name }}</a> {{ a.content_type }} ({{ a.size }})
  153. {% endif %}
  154. </li>
  155. {% endfor %}
  156. </ul>
  157. {% endif %}
  158. {% if show_conversation_id %}
  159. <p>
  160. Conversation: {{ tweet.conversation_id }}
  161. </p>
  162. {% endif %}
  163. </div>