playlists.html 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {% if watching %}
  2. <div class="row row-cols-1 row-cols-md-3 g-4 text-dark">
  3. {% for playlist in playlists %}
  4. <div class="col">
  5. <div class="card">
  6. <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
  7. <div class="card-body">
  8. <h5 class="card-title text-white">
  9. {{ playlist.name }}
  10. {% if playlist.is_private_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
  11. {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
  12. </h5>
  13. <p class="card-text">
  14. <span class="badge bg-{% if playlist.get_watch_time_left == "0secs." %}success{% else %}primary{% endif %} text-white">{{ playlist.get_watched_videos_count }}/{{ playlist.get_watchable_videos_count }} viewed</span>
  15. <span class="badge bg-light text-black-50">{{ playlist.playlist_duration }} </span>
  16. {% if playlist.get_watch_time_left != "0secs." %}<span class="badge bg-dark text-white-50">{{ playlist.get_watch_time_left }} left</span>{% endif %}
  17. </p>
  18. {% if playlist.tags.all %}
  19. <small>
  20. <i class="fas fa-tags fa-sm" style="color: yellow"></i>
  21. {% for tag in playlist.tags.all %}
  22. <span class="badge rounded-pill bg-primary mb-lg-1">
  23. {{ tag.name }}
  24. </span>
  25. {% endfor %}
  26. </small>
  27. {% endif %}
  28. </div>
  29. </a>
  30. </div>
  31. </div>
  32. {% endfor %}
  33. </div>
  34. {% else %}
  35. <div class="row row-cols-1 row-cols-md-3 g-4">
  36. {% if playlists %}
  37. {% for playlist in playlists %}
  38. <div class="col">
  39. <div class="card" style="background-color: #515355;">
  40. <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
  41. <div class="card-body">
  42. <h5 class="card-title text-white">
  43. {{ playlist.name }}
  44. </h5>
  45. <p class="card-text">
  46. {% 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 %}
  47. {% if playlist.is_private_on_yt %}<small><span class="badge bg-secondary text-white">Private</span></small> {% endif %}
  48. {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-black-50">YT</span></small> {% endif %}
  49. {% if playlist.marked_as == "watching" %}<small><span class="badge bg-primary text-white">WATCHING</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. {% else %}
  77. <h5 class="text-dark align-content-center">Nothing playlists found :(</h5>
  78. {% endif %}
  79. </div>
  80. {% endif %}
  81. <br>