search_untube_results.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {% load humanize %}
  2. {% if search_query %}
  3. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  4. <h1 class="h2">Playlists <span class="badge bg-primary rounded-pill">{{ playlists.count|default:"0" }}</span></h1>
  5. </div>
  6. <div>
  7. {% include 'intercooler/playlists.html' %}
  8. </div>
  9. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  10. <h1 class="h2">Videos <span class="badge bg-primary rounded-pill">{{ videos_count }}</span></h1>
  11. </div>
  12. <div>
  13. <div class="row row-cols-1 row-cols-md-3 g-4">
  14. {% if playlist_items %}
  15. {% for playlist_item in playlist_items %}
  16. <div class="col">
  17. <div class="card" style="background-color: #1A4464;">
  18. <div class="card-body">
  19. <h5 class="card-title text-light">
  20. {{ playlist_item.video.name|truncatewords:"15" }}<br>
  21. <small>
  22. <a class="badge bg-white text-black-50" href="{% url 'playlist' playlist_item.playlist.playlist_id %}">{{ playlist_item.playlist.name }}</a>
  23. <span class="badge bg-dark text-white-50">{{ playlist_item.video.duration }}</span>
  24. </small>
  25. {% if playlist_item.video.is_unavailable_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
  26. {% if playlist_item.video.has_cc %}<small><span class="badge bg-danger text-dark">CC</span></small> {% endif %}
  27. </h5>
  28. <br>
  29. <span class="d-flex justify-content-center">
  30. <a href="https://www.youtube.com/watch?v={{ playlist_item.video.video_id }}" class="btn btn-info me-1" target="_blank" id="share_link" style=""><i class="fas fa-external-link-alt" aria-hidden="true"></i></a>
  31. <input class="form-control me-1 visually-hidden" id="video-{{ video.video_id }}" value="https://www.youtube.com/watch?v={{ playlist_item.video.video_id }}">
  32. <button class="copy-btn btn btn-success me-1" data-clipboard-target="#video-{{ playlist_item.video.video_id }}">
  33. <i class="far fa-copy" aria-hidden="true"></i>
  34. </button>
  35. <button class="btn btn-dark" type="button" hx-get="{% url 'mark_video_favorite' playlist_item.playlist.playlist_id playlist_item.video.video_id %}" hx-target="#video-{{ forloop.counter }}-fav">
  36. <div id="video-{{ forloop.counter }}-fav">
  37. {% if playlist_item.video.is_favorite %}
  38. <i class="fas fa-heart" style="color: #fafa06"></i>
  39. {% else %}
  40. <i class="far fa-heart"></i>
  41. {% endif %}
  42. </div>
  43. </button>
  44. </span>
  45. </div>
  46. </div>
  47. </div>
  48. {% endfor %}
  49. {% else %}
  50. <h5 class="text-dark align-content-center">Nothing found :(</h5>
  51. {% endif %}
  52. </div>
  53. </div>
  54. {% else %}
  55. {% if all_playlists %}
  56. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  57. <h1 class="h2">All Playlists <span class="badge bg-primary rounded-pill">{{ all_playlists.count }}</span></h1>
  58. </div>
  59. <div>
  60. <div class="row row-cols-1 row-cols-md-3 g-4">
  61. {% for playlist in all_playlists %}
  62. <div class="col">
  63. <div class="card" style="background-color: #515355;">
  64. <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
  65. <div class="card-body">
  66. <h5 class="card-title text-white">
  67. {{ playlist.name }}
  68. </h5>
  69. <p class="card-text">
  70. {% 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 %}
  71. {% if playlist.is_private_on_yt %}<small><span class="badge bg-secondary text-white">Private</span></small> {% endif %}
  72. {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-black-50">YT</span></small> {% endif %}
  73. {% if playlist.marked_as == "watching" %}<small><span class="badge bg-primary text-white">WATCHING</span></small>{% endif %}
  74. </p>
  75. {% if playlist.tags.all %}
  76. <p class="card-text">
  77. <span class="d-flex justify-content-start flex-wrap">
  78. <small>
  79. <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
  80. <i class="fas fa-tags"></i>
  81. </span>
  82. </small>
  83. {% for tag in playlist.tags.all %}
  84. <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
  85. {{ tag.name }}
  86. </span>
  87. {% endfor %}
  88. </span>
  89. </p>
  90. {% endif %}
  91. <small>
  92. <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
  93. <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
  94. </small>
  95. </div>
  96. </a>
  97. </div>
  98. </div>
  99. {% endfor %}
  100. </div>
  101. </div>
  102. {% endif %}
  103. {% endif %}
  104. <br>