all_playlists.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div id="search-results">
  4. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 mb-3">
  5. <h1 class="h2"><span style="border-bottom: 3px #ffffff dashed;">{{ playlist_type_display|title }}</span> <span class="badge bg-primary rounded-pill">{{ playlists.count }}</span></h1>
  6. {% if playlists %}
  7. <div class="btn-toolbar mb-2 mb-md-0">
  8. <!--
  9. <div class="btn-group me-2">
  10. <button type="button" class="btn btn-outline-info">Grid</button>
  11. <button type="button" class="btn btn-outline-info">List</button>
  12. </div>
  13. -->
  14. <div class="btn-group">
  15. <button type="button" class="btn btn-success dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
  16. Sort By
  17. </button>
  18. <ul class="dropdown-menu">
  19. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' playlist_type 'playlist-duration-in-seconds' %}" hx-trigger="click" hx-target="#search-results">Duration</a></li>
  20. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' playlist_type 'video-count' %}" hx-trigger="click" hx-target="#search-results"># Videos</a></li>
  21. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' playlist_type 'recently-accessed' %}" hx-trigger="click" hx-target="#search-results">Recently Accessed</a></li>
  22. </ul>
  23. </div>
  24. </div>
  25. {% endif %}
  26. </div>
  27. {% if playlists %}
  28. <div class="">
  29. <input class="form-control border border-secondary" type="text"
  30. name="search" placeholder="Begin to search playlists..."
  31. hx-post="{% url 'search_playlists' playlist_type %}"
  32. hx-trigger="keyup changed delay:500ms"
  33. hx-target="#search-results"
  34. hx-indicator=".htmx-indicator">
  35. <br>
  36. </div>
  37. <div class="row row-cols-1 row-cols-md-3 g-4">
  38. {% for playlist in playlists %}
  39. <div class="col">
  40. <div class="card" style="background-color: #515355;">
  41. <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action text-white-50" aria-current="true">
  42. <div class="card-body">
  43. <h5 class="card-title text-white">
  44. {{ playlist.name }}
  45. </h5>
  46. <p class="card-text">
  47. {% if playlist.is_user_owned %}<small><span class="badge bg-light text-black-50">OWNED</span></small>{% else %}<small><span class="badge bg-light text-black-50">IMPORTED</span></small>{% endif %}
  48. {% if playlist.is_private_on_yt %}<small><span class="badge bg-secondary text-white">Private</span></small> {% endif %}
  49. {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-black-50">YT</span></small> {% endif %}
  50. </p>
  51. {% if playlist.tags.all %}
  52. <p class="card-text">
  53. <span class="d-flex justify-content-start flex-wrap">
  54. <small>
  55. <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
  56. <i class="fas fa-tags"></i>
  57. </span>
  58. </small>
  59. {% for tag in playlist.tags.all %}
  60. <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
  61. {{ tag.name }}
  62. </span>
  63. {% endfor %}
  64. </span>
  65. </p>
  66. {% endif %}
  67. <small>
  68. <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
  69. <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
  70. </small>
  71. </div>
  72. </a>
  73. </div>
  74. </div>
  75. {% endfor %}
  76. </div>
  77. {% else %}
  78. <div class="card bg-dark text-white mb-3">
  79. <div class="card-body">
  80. <div class="d-flex justify-content-center h3">
  81. Nothing here!
  82. </div>
  83. <div class="d-flex justify-content-center h5">
  84. {% if playlist_type == "watching" %}
  85. You can mark a playlist as watching by heading over to the playlist and marking it from the dropdown.
  86. {% elif playlist_type == "all" %}
  87. There's no playlists in your UnTube right now.
  88. {% elif playlist_type == "imported" %}
  89. To import public playlists into your UnTube collection you can head over to <a href="{% url 'manage_playlists' %}" class="btn btn-sm btn-primary ms-2">Manage</a>
  90. {% elif playlist_type == "plan-to-watch" %}
  91. You can mark a playlist as plan to watch by heading over to the playlist and marking it from the dropdown.
  92. {% elif playlist_type == "favorites" %}
  93. You can mark a playlist as favorite by heading over to the playlist page and pressing the star icon.
  94. {% elif playlist_type == "user-owned" %}
  95. {% if user.profile.imported_yt_playlists %}
  96. Looks like you have no playlists on YouTube.
  97. {% else %}
  98. You can always head over to your <a href="{% url 'profile' %}" class="btn btn-sm btn-primary p-2">Profile</a> to import all of your public/private YouTube playlists.
  99. {% endif %}
  100. {% else %}
  101. {{ playlist_type }}
  102. {% endif %}
  103. </div>
  104. </div>
  105. </div>
  106. {% endif %}
  107. <br>
  108. </div>
  109. {% endblock %}