base.html 12 KB

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