base.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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, videos, delete videos, delete playlists, delete multiple videos, move multiple videos, merge playlists, video manager, playlist manager, 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 dropdown">
  60. <a class="nav-link dropdown-toggle" href="#" id="libraryDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  61. Library
  62. </a>
  63. <ul class="dropdown-menu" aria-labelledby="libraryDropdown">
  64. <li><a class="dropdown-item" href="{% url 'all_playlists' 'home' %}">Playlists</a></li>
  65. <li><a class="dropdown-item" href="{% url 'all_videos' 'home' %}">Videos</a></li>
  66. </ul>
  67. </li>
  68. <li class="nav-item dropdown">
  69. <a class="nav-link dropdown-toggle" href="#" id="quickViewDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  70. Quick View
  71. </a>
  72. <ul class="dropdown-menu" aria-labelledby="quickViewDropdown">
  73. <li><a class="dropdown-item" href="{% url 'all_playlists' 'favorites' %}">Favorites</a></li>
  74. <li><a class="dropdown-item" href="{% url 'all_playlists' 'watching' %}">Watching</a></li>
  75. <li><a class="dropdown-item" href="{% url 'all_playlists' 'plan-to-watch' %}">Plan to Watch</a></li>
  76. <li><a class="dropdown-item" href="{% url 'all_playlists' 'user-owned' %}">Your YT Playlists</a></li>
  77. <li><a class="dropdown-item" href="{% url 'all_playlists' 'imported' %}">Imported</a></li>
  78. <li><hr class="dropdown-divider"></li>
  79. <li><a class="dropdown-item" href="{% url 'all_playlists' 'all' %}">View all</a></li>
  80. </ul>
  81. </li>
  82. <li class="nav-item">
  83. <a class="nav-link" href="{% url 'manage_playlists' %}">Manage</a>
  84. </li>
  85. <!--
  86. <li class="nav-item">
  87. <a class="nav-link" href="{% url 'settings' %}">Settings</a>
  88. </li>
  89. -->
  90. </ul>
  91. <div class="navbar-nav justify-content-end">
  92. <!--
  93. <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">
  94. -->
  95. <a class="nav-link btn-lg me-1 mt-1" href="{% url 'search' %}" {% if user.profile.open_search_new_tab %}target="_blank"{% endif %}>
  96. <i class="fas fa-search"></i>
  97. </a>
  98. <a href="{% url 'profile' %}" class="mt-1">
  99. <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">
  100. </a>
  101. </div>
  102. <a class="btn btn-outline-danger" href="{% url 'log_out' %}">
  103. Log out
  104. </a>
  105. </div>
  106. </div>
  107. </nav>
  108. <div class="container-fluid text-dark">
  109. <div class="row">
  110. <main class="ms-lg-auto px-lg-5">
  111. {% block content %}
  112. {% endblock %}
  113. </main>
  114. </div>
  115. </div>
  116. <br>
  117. <script src="{% static 'htmx/htmx.min.js' %}" type="application/javascript"></script>
  118. <script src="{% static 'clipboard.js/clipboard.min.js' %}" type="application/javascript"></script>
  119. <script src="{% static 'jquery3.6.0/js/jquery-3.6.0.min.js' %}" type="application/javascript"></script>
  120. <script src="{% static 'bootstrap5.0.1/js/bootstrap.bundle.min.js' %}" type="application/javascript"></script>
  121. <script src="https://cdn.jsdelivr.net/gh/bbbootstrap/libraries@main/choices.min.js"></script>
  122. <!-- <script src="{% static 'htmx/extensions/class-tools.js' %}" type="application/javascript"></script> -->
  123. <script type="application/javascript">
  124. $(document).ready(function(){
  125. var multipleCancelButton = new Choices('#choices-multiple-remove-button', {
  126. removeItemButton: true,
  127. });
  128. });
  129. function triggerSubmit() {
  130. var startsWithCB = document.getElementById("starts-with-cb");
  131. var containsCB = document.getElementById("contains-cb");
  132. if (startsWithCB.checked) {
  133. startsWithCB.click();
  134. } else {
  135. containsCB.click();
  136. }
  137. }
  138. document.body.addEventListener('htmx:configRequest', (event) => {
  139. event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
  140. })
  141. // window.onbeforeunload = function() {
  142. //return "Dude, are you sure you want to leave? Think of the kittens!";
  143. //}
  144. var moveCopyBtn = document.getElementById('move-copy-vids-btn');
  145. var moveCopyCollapse = document.getElementById('moveItemsToCollapse');
  146. var bsMoveCopyCollapse = new bootstrap.Collapse(moveCopyCollapse, {
  147. toggle: false
  148. });
  149. var deleteBtn = document.getElementById('delete-vids-btn');
  150. var deleteCollapse = document.getElementById('deleteItemsCollapse');
  151. var bsDeleteCollapse = new bootstrap.Collapse(deleteCollapse, {
  152. toggle: false
  153. });
  154. document.getElementById('manageBtn').addEventListener('click', function () {
  155. bsMoveCopyCollapse.hide();
  156. bsDeleteCollapse.hide();
  157. });
  158. moveCopyCollapse.addEventListener('show.bs.collapse', function () {
  159. bsDeleteCollapse.hide();
  160. });
  161. deleteCollapse.addEventListener('show.bs.collapse', function () {
  162. bsMoveCopyCollapse.hide();
  163. });
  164. <!-- end -->
  165. document.getElementById('select-all-btn').onclick = function() {
  166. document.getElementById('select-all-btn').style.display = "none";
  167. document.getElementById('deselect-all-btn').style.display = "block";
  168. var checkboxes = document.getElementsByClassName('video-checkboxes');
  169. for (var checkbox of checkboxes) {
  170. checkbox.checked = true;
  171. }
  172. }
  173. document.getElementById('deselect-all-btn').onclick = function() {
  174. document.getElementById('deselect-all-btn').style.display = "none";
  175. document.getElementById('select-all-btn').style.display = "block";
  176. var checkboxes = document.getElementsByClassName('video-checkboxes');
  177. for (var checkbox of checkboxes) {
  178. checkbox.checked = false;
  179. }
  180. }
  181. function row1_hide() {
  182. document.getElementById("row1").style.display = "none";
  183. 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.
  184. for(var i=0, len=checkboxes.length; i<len; i++)
  185. {
  186. checkboxes[i].style.display = "block";
  187. }
  188. document.getElementById("row2").style.display = "block";
  189. }
  190. function row1_show() {
  191. document.getElementById("row1").style.display = "block";
  192. 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.
  193. for(var i=0, len=checkboxes.length; i<len; i++)
  194. {
  195. checkboxes[i].style.display = "none";
  196. }
  197. document.getElementById("row2").style.display = "none";
  198. }
  199. function select_all_checkboxes(source) {
  200. checkboxes = document.getElementsByClassName('big-checkbox');
  201. for(var i=0, n=checkboxes.length;i<n;i++) {
  202. checkboxes[i].checked = source.checked;
  203. }
  204. }
  205. var clipboard = new ClipboardJS('.copy-btn');
  206. //Get the button
  207. let mybutton = document.getElementById("btn-back-to-top");
  208. // When the user scrolls down 20px from the top of the document, show the button
  209. window.onscroll = function () {
  210. scrollFunction();
  211. };
  212. function scrollFunction() {
  213. if (
  214. document.body.scrollTop > 150 ||
  215. document.documentElement.scrollTop > 150
  216. ) {
  217. mybutton.style.display = "block";
  218. } else {
  219. mybutton.style.display = "none";
  220. }
  221. }
  222. // When the user clicks on the button, scroll to the top of the document
  223. mybutton.addEventListener("click", backToTop);
  224. function backToTop() {
  225. document.body.scrollTop = 0;
  226. document.documentElement.scrollTop = 0;
  227. }
  228. </script>
  229. <!--
  230. <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>
  231. <script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
  232. <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
  233. -->
  234. </body>
  235. </html>
  236. {% endwith %}