compose-form.html 1.0 KB

12345678910111213141516171819202122232425
  1. {% if twitter_user %}
  2. <form class="compose" hx-post="{{ url_for('twitter_v2_facade.post_tweets_create', me=me) }}" hx-swap="outerHTML">
  3. {% else %}
  4. <form class="compose" hx-post="{{ url_for('.post_tweets_create', me=me) }}" hx-swap="outerHTML">
  5. {% endif %}
  6. <h2>Compose</h2>
  7. <ul>
  8. <li><textarea name="text" placeholder="Only the finest..." style="width: 100%" onchange="this.onkeyup()" onkeyup="this.form.querySelector('.compose-length').innerHTML = this.value.length" rows="6" cols="30"></textarea>
  9. <li><p class="compose-length w-100" style="text-align: right">0</p>
  10. <li><input type="text" name="reply_to_tweet_id" placeholder="Reply to Tweet ID" style="width: 100%">
  11. <li><input type="text" name="quote_tweet_id" placeholder="Quote Tweet ID" style="width: 100%">
  12. <li><button type="submit" style="margin-top: 0.33em">Post</button>
  13. </ul>
  14. {% if new_tweet_id %}
  15. <script>
  16. Toast.fire({
  17. icon: 'success',
  18. title: 'Tweet was sent; <a style="text-align: right" href="{{ url_for('.get_tweet_html', tweet_id=new_tweet_id) }}">View</a>.'
  19. });
  20. </script>
  21. {% endif %}
  22. </form>