user_playlist_updates.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {% load static %}
  2. {% if playlists or deleted_playlist_names %}
  3. <div id="user-pl-updates">
  4. <div class="alert alert-success alert-dismissible fade show" role="alert">
  5. <h4 class="alert-heading">Updates</h4>
  6. <p>
  7. {% if playlists %}
  8. The following new playlists were detected on your YouTube channel and are not on UnTube:
  9. <ul>
  10. {% for playlist in playlists %}
  11. <li>
  12. <a href="https://www.youtube.com/playlist?list={{ playlist.playlist_id }}" class="text-decoration-none" target="_blank">
  13. {{ playlist.name }}
  14. </a>
  15. {% if playlist.video_count == 1 %}
  16. ({{ playlist.video_count }} video)
  17. {% else %}
  18. ({{ playlist.video_count }} videos)
  19. {% endif %}
  20. </li>
  21. {% endfor %}
  22. </ul>
  23. {% endif %}
  24. {% if deleted_playlist_names %}
  25. The following playlists were deleted on YouTube (and have also been removed from UnTube):
  26. <ul>
  27. {% for playlist in deleted_playlist_names %}
  28. <li>
  29. {{ playlist }}
  30. </li>
  31. {% endfor %}
  32. </ul>
  33. {% endif %}
  34. <button class="btn btn-success" {% if playlists %}hx-get="{% url 'user_playlists_updates' 'init-update' %}" hx-trigger="click" hx-target="#user-pl-updates"{% else %}type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"{% endif %}>
  35. {% if deleted_playlist_names and not playlists %}
  36. OK
  37. {% else %}
  38. Import
  39. {% endif %}
  40. </button>
  41. </p>
  42. <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  43. </div>
  44. </div>
  45. {% endif %}