base.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. {% load static %}
  2. {% with domain="http://127.0.0.1:8000/" %}
  3. <!doctype html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8">
  7. <meta name="keywords" content="youtube, playlists, playlist panager, youtube playlists, untube, google">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <meta name="description" content="UnTube is a simple Youtube playlist manager. Modify and keep track of your YouTube playlists with ease.">
  10. <meta name="author" content="Mohammed Abu Bakar Khan">
  11. <title>UnTube</title>
  12. <style type="text/css">
  13. body {
  14. background: linear-gradient(-45deg, #B2A3FF, #84bcf3, #AE876B, #B0E7AE);
  15. //background: linear-gradient(-45deg, #0645a4, #2480cd, #84bcf3, #b7d6f7);
  16. //background: linear-gradient(-45deg, #AE876B, #ABA27B, #A7BC8A, #A3D69A);
  17. background-size: 400% 400%;
  18. animation: gradient 10s ease infinite;
  19. }
  20. @keyframes gradient {
  21. 0% {
  22. background-position: 0% 50%;
  23. }
  24. 50% {
  25. background-position: 100% 50%;
  26. }
  27. 100% {
  28. background-position: 0% 50%;
  29. }
  30. }
  31. #btn-back-to-top {
  32. position: fixed;
  33. bottom: 20px;
  34. right: 20px;
  35. display: none;
  36. }
  37. .big-checkbox {width: 30px; height: 30px;}
  38. </style>
  39. <link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Open+Sans&display=swap" rel="stylesheet">
  40. <link href="{% static 'fontawesome-free-5.15.3-web/css/all.min.css' %}" rel="stylesheet">
  41. <link href="{% static 'bootstrap5.0.1/css/bootstrap.min.css' %}" rel="stylesheet">
  42. <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bbbootstrap/libraries@main/choices.min.css">
  43. </head>
  44. <body class="text-dark" style="font-family: 'Fredoka One', monospace; filter: contrast(80%);">
  45. {% if user.profile.show_import_page %}
  46. <meta http-equiv="refresh" content="0;url={{ domain }}import/init" />
  47. {% endif %}
  48. <nav class="navbar navbar-expand-lg navbar-light" id="navbar">
  49. <div class="container-fluid">
  50. <a class="navbar-brand" href="{% url 'home' %}"><h3><kbd>UnTube</kbd></h3></a>
  51. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  52. <span class="navbar-toggler-icon"></span>
  53. </button>
  54. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  55. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  56. <li class="nav-item">
  57. <a class="nav-link" aria-current="page" href="{% url 'home' %}">Dashboard</a>
  58. </li>
  59. <li class="nav-item">
  60. <a class="nav-link" href="{% url 'all_playlists' 'home' %}">Library</a>
  61. </li>
  62. <li class="nav-item dropdown">
  63. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  64. Quick View
  65. </a>
  66. <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
  67. <li><a class="dropdown-item" href="{% url 'all_playlists' 'favorites' %}">Favorites</a></li>
  68. <li><a class="dropdown-item" href="{% url 'all_playlists' 'watching' %}">Watching</a></li>
  69. <li><a class="dropdown-item" href="{% url 'all_playlists' 'plan-to-watch' %}">Plan to Watch</a></li>
  70. <li><a class="dropdown-item" href="{% url 'all_playlists' 'user-owned' %}">Your YT Playlists</a></li>
  71. <li><a class="dropdown-item" href="{% url 'all_playlists' 'imported' %}">Imported</a></li>
  72. <li><hr class="dropdown-divider"></li>
  73. <li><a class="dropdown-item" href="{% url 'all_playlists' 'all' %}">View all</a></li>
  74. </ul>
  75. </li>
  76. <li class="nav-item">
  77. <a class="nav-link" href="{% url 'manage_playlists' %}">Manage</a>
  78. </li>
  79. <!--
  80. <li class="nav-item">
  81. <a class="nav-link" href="{% url 'settings' %}">Settings</a>
  82. </li>
  83. -->
  84. </ul>
  85. <div class="navbar-nav justify-content-end">
  86. <!--
  87. <input class="form-control border border-secondary bg-dark text-white-50 me-lg-2 bg-dark mb-1" id="unTubeSearchBar" type="text" placeholder="Search UnTube">
  88. -->
  89. <a class="nav-link btn-lg me-1 mt-1" href="{% url 'search' %}" {% if user.profile.open_search_new_tab %}target="_blank"{% endif %}>
  90. <i class="fas fa-search"></i>
  91. </a>
  92. <a href="{% url 'profile' %}" class="mt-1">
  93. <img src="https://robohash.org/{{ user.username }}.png?set=set{{ user.profile.robohash_set }}" alt="{{ user.username }}" class="border border-3 border-primary rounded-circle me-2" width="42" height="42">
  94. </a>
  95. </div>
  96. <a class="btn btn-outline-danger" href="{% url 'log_out' %}">
  97. Log out
  98. </a>
  99. </div>
  100. </div>
  101. </nav>
  102. <div class="container-fluid text-dark">
  103. <div class="row">
  104. <main class="ms-lg-auto px-lg-5">
  105. {% block content %}
  106. {% endblock %}
  107. </main>
  108. </div>
  109. </div>
  110. <br>
  111. <script src="{% static 'htmx/htmx.min.js' %}" type="application/javascript"></script>
  112. <script src="{% static 'clipboard.js/clipboard.min.js' %}" type="application/javascript"></script>
  113. <script src="{% static 'jquery3.6.0/js/jquery-3.6.0.min.js' %}" type="application/javascript"></script>
  114. <script src="{% static 'bootstrap5.0.1/js/bootstrap.bundle.js' %}" type="application/javascript"></script>
  115. <script src="https://cdn.jsdelivr.net/gh/bbbootstrap/libraries@main/choices.min.js"></script>
  116. <!-- <script src="{% static 'htmx/extensions/class-tools.js' %}" type="application/javascript"></script> -->
  117. <script type="application/javascript">
  118. $(document).ready(function(){
  119. var multipleCancelButton = new Choices('#choices-multiple-remove-button', {
  120. removeItemButton: true,
  121. });
  122. });
  123. function triggerSubmit() {
  124. var startsWithCB = document.getElementById("starts-with-cb");
  125. var containsCB = document.getElementById("contains-cb");
  126. if (startsWithCB.checked) {
  127. startsWithCB.click();
  128. } else {
  129. containsCB.click();
  130. }
  131. }
  132. document.body.addEventListener('htmx:configRequest', (event) => {
  133. event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
  134. })
  135. // window.onbeforeunload = function() {
  136. //return "Dude, are you sure you want to leave? Think of the kittens!";
  137. //}
  138. var moveCopyBtn = document.getElementById('move-copy-vids-btn');
  139. var moveCopyCollapse = document.getElementById('moveItemsToCollapse');
  140. var bsMoveCopyCollapse = new bootstrap.Collapse(moveCopyCollapse, {
  141. toggle: false
  142. });
  143. var deleteBtn = document.getElementById('delete-vids-btn');
  144. var deleteCollapse = document.getElementById('deleteItemsCollapse');
  145. var bsDeleteCollapse = new bootstrap.Collapse(deleteCollapse, {
  146. toggle: false
  147. });
  148. document.getElementById('manageBtn').addEventListener('click', function () {
  149. bsMoveCopyCollapse.hide();
  150. bsDeleteCollapse.hide();
  151. });
  152. moveCopyCollapse.addEventListener('show.bs.collapse', function () {
  153. bsDeleteCollapse.hide();
  154. });
  155. deleteCollapse.addEventListener('show.bs.collapse', function () {
  156. bsMoveCopyCollapse.hide();
  157. });
  158. <!-- end -->
  159. document.getElementById('select-all-btn').onclick = function() {
  160. document.getElementById('select-all-btn').style.display = "none";
  161. document.getElementById('deselect-all-btn').style.display = "block";
  162. var checkboxes = document.getElementsByClassName('video-checkboxes');
  163. for (var checkbox of checkboxes) {
  164. checkbox.checked = true;
  165. }
  166. }
  167. document.getElementById('deselect-all-btn').onclick = function() {
  168. document.getElementById('deselect-all-btn').style.display = "none";
  169. document.getElementById('select-all-btn').style.display = "block";
  170. var checkboxes = document.getElementsByClassName('video-checkboxes');
  171. for (var checkbox of checkboxes) {
  172. checkbox.checked = false;
  173. }
  174. }
  175. function row1_hide() {
  176. document.getElementById("row1").style.display = "none";
  177. var checkboxes = document.getElementsByClassName('video-checkboxes'); //Cache the collection here, so that even a new element added with the same class later we can avoid querying this again by using the cached collection.
  178. for(var i=0, len=checkboxes.length; i<len; i++)
  179. {
  180. checkboxes[i].style.display = "block";
  181. }
  182. document.getElementById("row2").style.display = "block";
  183. }
  184. function row1_show() {
  185. document.getElementById("row1").style.display = "block";
  186. var checkboxes = document.getElementsByClassName('video-checkboxes'); //Cache the collection here, so that even a new element added with the same class later we can avoid querying this again by using the cached collection.
  187. for(var i=0, len=checkboxes.length; i<len; i++)
  188. {
  189. checkboxes[i].style.display = "none";
  190. }
  191. document.getElementById("row2").style.display = "none";
  192. }
  193. function select_all_checkboxes(source) {
  194. checkboxes = document.getElementsByClassName('big-checkbox');
  195. for(var i=0, n=checkboxes.length;i<n;i++) {
  196. checkboxes[i].checked = source.checked;
  197. }
  198. }
  199. var clipboard = new ClipboardJS('.copy-btn');
  200. //Get the button
  201. let mybutton = document.getElementById("btn-back-to-top");
  202. // When the user scrolls down 20px from the top of the document, show the button
  203. window.onscroll = function () {
  204. scrollFunction();
  205. };
  206. function scrollFunction() {
  207. if (
  208. document.body.scrollTop > 150 ||
  209. document.documentElement.scrollTop > 150
  210. ) {
  211. mybutton.style.display = "block";
  212. } else {
  213. mybutton.style.display = "none";
  214. }
  215. }
  216. // When the user clicks on the button, scroll to the top of the document
  217. mybutton.addEventListener("click", backToTop);
  218. function backToTop() {
  219. document.body.scrollTop = 0;
  220. document.documentElement.scrollTop = 0;
  221. }
  222. </script>
  223. <!--
  224. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
  225. <script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
  226. <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
  227. -->
  228. </body>
  229. </html>
  230. {% endwith %}