timeline-tweet-bs.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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">
  94. <p><a href="{{ tweet.card.source_url }}">{{ tweet.card.display_url }}</a></p>
  95. <p><strong>{{ tweet.card.title }}</strong></p>
  96. <p>{{ tweet.card.content }}</p>
  97. </div>
  98. {% endif %}
  99. {% if False and tweet.replied_tweet %}
  100. <a href="{{ tweet.replied_tweet.url }}">View Parent</a>
  101. <a href="{{ url_for('.get_tweet_html', tweet_id=tweet.replied_tweet.conversation_id) }}">View Conversation</a>
  102. {% endif %}
  103. {% if tweet.public_metrics %}
  104. <p>
  105. {% for k, v in tweet.public_metrics.items() %}
  106. {% if v != None %}
  107. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  108. {% endif %}
  109. {% endfor %}
  110. </p>
  111. {% endif %}
  112. {% if tweet.non_public_metrics %}
  113. <p>
  114. {% for k, v in tweet.non_public_metrics.items() %}
  115. {% if v != None %}
  116. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  117. {% endif %}
  118. {% endfor %}
  119. </p>
  120. {% endif %}
  121. {% if tweet.attachments %}
  122. <ul>
  123. {% for a in tweet.attachments %}
  124. {% if a.content_type == 'application/vnd-hogumathi.livestream-details+json' %}
  125. <li class="livestream-details">
  126. <dl>
  127. {% if a.content.scheduled_start_time %}
  128. <dt>Scheduled Start Time</dt>
  129. <dd>{{ a.content.scheduled_start_time }}</dd>
  130. {% endif %}
  131. {% if a.content.start_time %}
  132. <dt>Start Time</dt>
  133. <dd>{{ a.content.start_time }}</dd>
  134. {% endif %}
  135. {% if a.content.chat_embed_url %}
  136. <dt>Chat</dt>
  137. <dd>
  138. <iframe class="w-100" height="400" src="{{ a.content.chat_embed_url }}" referrerpolicy="origin"></iframe>
  139. </dd>
  140. {% endif %}
  141. </dl>
  142. </li>
  143. {% else %}
  144. <li><a href="{{ a.url }}">{{ a.name }}</a> {{ a.content_type }} ({{ a.size }})
  145. {% endif %}
  146. </li>
  147. {% endfor %}
  148. </ul>
  149. {% endif %}
  150. {% if show_conversation_id %}
  151. <p>
  152. Conversation: {{ tweet.conversation_id }}
  153. </p>
  154. {% endif %}
  155. </div>