videos.html 5.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {% load humanize %}
  2. {% if videos_details and videos.count != 0 %}
  3. <h4 class="mt-3 mb-3"><span class="badge bg-dark text-white">{{ videos_details }}, Results: {{ videos.count }}</span></h4>
  4. {% endif %}
  5. <div class="list-group" id="video-checkboxes">
  6. {% if videos %}
  7. {% for video in videos %}
  8. <li class="list-group-item d-flex justify-content-between align-items-center bg-transparent" style="background-color: #40B3A2">
  9. {% if video.is_unavailable_on_yt and not video.was_deleted_on_yt %}
  10. <div class="d-flex justify-content-between align-items-center">
  11. <div>
  12. <input class="video-checkboxes" style="display: none" type="checkbox" value="{{ video.video_id }}" name="video-id">
  13. </div>
  14. <div class="ms-4" style="max-width: 115px; max-height: 100px;">
  15. <img src="https://i.ytimg.com/vi/9219YrnwDXE/maxresdefault.jpg" class="img-fluid" alt="">
  16. </div>
  17. <div class="ms-4">
  18. <a class="link-dark" href="https://www.youtube.com/watch?v={{ video.video_id }}&list={{ video.playlist.playlist_id }}" target="_blank">
  19. {{ video.video_position }}. {{ video.name }}
  20. </a>
  21. <br><br>
  22. </div>
  23. </div>
  24. {% else %}
  25. <div class="d-flex justify-content-between align-items-center" >
  26. <div>
  27. <input class="video-checkboxes" style="display: none" type="checkbox" value="{{ video.video_id }}" name="video-id">
  28. </div>
  29. <div class="ms-4" style="max-width: 115px; max-height: 100px;">
  30. <img src="{% if video.thumbnail_url %}{{ video.thumbnail_url }}{% else %}https://i.ytimg.com/vi/9219YrnwDXE/maxresdefault.jpg{% endif %}" class="img-fluid" alt="">
  31. </div>
  32. <div class="ms-4">
  33. {{ video.video_position }}.
  34. <a class="link-dark" href="https://www.youtube.com/watch?v={{ video.video_id }}&list={{ video.playlist.playlist_id }}" target="_blank">
  35. {{ video.name|truncatewords:"16" }}
  36. </a> by {{ video.channel_name }}<br>
  37. <span class="badge bg-secondary">{{ video.duration }}</span>
  38. {% if video.has_cc %}<span class="badge bg-secondary">CC</span>{% endif %}
  39. {% if video.published_at %}<span class="badge bg-secondary">{{ video.published_at }}</span>{% endif %}
  40. {% if video.view_count %}<span class="badge bg-info">{{ video.view_count|intword|intcomma }} views</span>{% endif %}
  41. {% if video.is_duplicate %}<span class="badge bg-primary">duplicate</span>{% endif %}
  42. {% if video.is_unavailable_on_yt and video.was_deleted_on_yt %}<span class="badge bg-dark">UNAVAILABLE</span>{% endif %}
  43. {% if video.video_details_modified %}
  44. <span class="badge bg-danger">UPDATED - {% if video.was_deleted_on_yt %}WENT PRIVATE/DELETED{% else %}NEWLY ADDED{% endif %}</span>
  45. {% endif %}<br>
  46. <br>
  47. </div>
  48. </div>
  49. <div class="ms-5">
  50. <a class="btn btn-sm btn-info mb-1" type="button" href="https://www.youtube.com/watch?v={{ video.video_id }}" class="btn btn-info me-1" target="_blank"><i class="fas fa-external-link-alt" aria-hidden="true"></i></a>
  51. <input class="form-control me-1 visually-hidden" id="video-{{ video.video_id }}" value="https://www.youtube.com/watch?v={{ video.video_id }}">
  52. <button class="copy-btn btn btn-success mb-1" data-clipboard-target="#video-{{ video.video_id }}">
  53. <i class="far fa-copy" aria-hidden="true"></i>
  54. </button>
  55. <button class="btn btn-sm btn-primary mb-1" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasWithBackdrop" aria-controls="offcanvasBottom" hx-get="{% url 'video_details' playlist.playlist_id video.video_id %}" hx-trigger="click" hx-target="#video-details">Details</button>
  56. <button class="btn btn-sm btn-warning mb-1" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasForVideoNotes" aria-controls="offcanvasBottom" hx-get="{% url 'video_notes' playlist.playlist_id video.video_id %}" hx-trigger="click" hx-target="#video-notes">Notes</button>
  57. <button class="btn btn-sm btn-dark mb-1" type="button" hx-get="{% url 'mark_video_favorite' playlist.playlist_id video.video_id %}" hx-target="#video-{{ forloop.counter }}-fav">
  58. <div id="video-{{ forloop.counter }}-fav">
  59. {% if video.is_favorite %}
  60. <i class="fas fa-heart"></i>
  61. {% else %}
  62. <i class="far fa-heart"></i>
  63. {% endif %}
  64. </div>
  65. </button>
  66. {% if playlist.marked_as == "watching" %}
  67. <button class="btn btn-sm btn-light mb-1" type="button">
  68. <i class="far fa-check-circle"></i>
  69. </button>
  70. {% endif %}
  71. </div>
  72. {% endif %}
  73. </li>
  74. {% endfor %}
  75. {% else %}
  76. <h3>{{ display_text }}</h3>
  77. {% endif %}
  78. </div>