all_playlists.html 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 mb-3">
  4. <h1 class="h2"><span style="border-bottom: 3px #e24949 dashed;">{{ library_type_display|title }}</span> <span class="badge bg-primary rounded-pill">{{ playlists.count }}</span></h1>
  5. {% if playlists %}
  6. <div class="btn-toolbar mb-2 mb-md-0">
  7. <!--
  8. <div class="btn-group me-2">
  9. <button type="button" class="btn btn-outline-info">Grid</button>
  10. <button type="button" class="btn btn-outline-info">List</button>
  11. </div>
  12. <div class="btn-group">
  13. <button type="button" class="btn btn-success dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
  14. Sort By
  15. </button>
  16. <ul class="dropdown-menu">
  17. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' library_type 'playlist-duration-in-seconds' %}" hx-trigger="click" hx-target="#search-results">Duration</a></li>
  18. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' library_type 'video-count' %}" hx-trigger="click" hx-target="#search-results"># Videos</a></li>
  19. <li class="dropdown-item"><a hx-get="{% url 'order_playlists_by' library_type 'recently-accessed' %}" hx-trigger="click" hx-target="#search-results">Recently Accessed</a></li>
  20. </ul>
  21. </div>
  22. -->
  23. </div>
  24. {% endif %}
  25. </div>
  26. {% if playlists %}
  27. <input class="form-control border border-secondary" type="text"
  28. name="search" placeholder="Begin to search playlists..."
  29. hx-post="{% url 'search_library' library_type %}"
  30. hx-trigger="keyup changed delay:700ms"
  31. hx-target="#search-results"
  32. hx-indicator=".htmx-indicator"
  33. aria-describedby="searchHelp">
  34. <div id="searchHelp" class="form-text">For a more extensive playlist search and filtering, <a href="{% url 'search' %}?mode=playlists&type={{ library_type }}">click here</a>.</div>
  35. <br>
  36. <div id="search-results" class="row row-cols-1 row-cols-md-4 g-4">
  37. {% include 'intercooler/playlists.html' with show_controls=True %}
  38. </div>
  39. {% else %}
  40. <div class="card bg-dark text-white mb-3">
  41. <div class="card-body">
  42. <div class="d-flex justify-content-center h3">
  43. Nothing here!
  44. </div>
  45. <div class="d-flex justify-content-center h5">
  46. {% if library_type == "watching" %}
  47. You can mark a playlist as watching by heading over to the playlist and marking it from the dropdown.
  48. {% elif library_type == "all" %}
  49. There's no playlists in your UnTube right now.
  50. {% elif library_type == "imported" %}
  51. To import public playlists into your UnTube collection you can head over to <a href="{% url 'manage_view_page' 'import' %}" class="btn btn-sm btn-primary ms-2">Import</a>
  52. {% elif library_type == "plan-to-watch" %}
  53. You can mark a playlist as plan to watch by heading over to the playlist and marking it from the dropdown.
  54. {% elif library_type == "favorites" %}
  55. You can mark a playlist as favorite by heading over to the playlist page and pressing the star icon.
  56. {% elif library_type == "yt-mix" %}
  57. No YouTube mixes imported. Head over to Import to import the ones you like.
  58. {% elif library_type == "user-owned" %}
  59. {% if user.profile.imported_yt_playlists %}
  60. Looks like you have no playlists on YouTube.
  61. {% else %}
  62. You can always head over to your <a href="{% url 'profile' %}" class="btn btn-sm btn-primary ms-2 me-2">Profile</a> to import all of your public/private YouTube playlists.
  63. {% endif %}
  64. {% else %}
  65. {{ library_type }}
  66. {% endif %}
  67. </div>
  68. </div>
  69. </div>
  70. {% endif %}
  71. <br>
  72. {% endblock %}