base.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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>UnTube</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. <li class="nav-item">
  75. <a class="nav-link" href="{% url 'settings' %}">Settings</a>
  76. </li>
  77. </ul>
  78. <div class="navbar-nav justify-content-end">
  79. <!--
  80. <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">
  81. -->
  82. <a class="nav-link btn-lg me-1 mt-1" href="{% url 'search' %}" {% if user.profile.open_search_new_tab %}target="_blank"{% endif %}>
  83. <i class="fas fa-search"></i>
  84. </a>
  85. <a href="{% url 'profile' %}" class="mt-1">
  86. <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">
  87. </a>
  88. </div>
  89. <a class="btn btn-outline-danger" href="{% url 'log_out' %}">
  90. Log out
  91. </a>
  92. </div>
  93. </div>
  94. </nav>
  95. <div class="container-fluid text-dark">
  96. <div class="row">
  97. <main class="ms-lg-auto px-lg-5">
  98. {% block content %}
  99. {% endblock %}
  100. </main>
  101. </div>
  102. </div>
  103. <br>
  104. <script src="{% static 'htmx/htmx.min.js' %}" type="application/javascript"></script>
  105. <script src="{% static 'clipboard.js/clipboard.min.js' %}" type="application/javascript"></script>
  106. <script src="{% static 'jquery3.6.0/js/jquery-3.6.0.min.js' %}" type="application/javascript"></script>
  107. <script src="{% static 'bootstrap5.0.1/js/bootstrap.bundle.js' %}" type="application/javascript"></script>
  108. <!-- <script src="{% static 'htmx/extensions/class-tools.js' %}" type="application/javascript"></script> -->
  109. <script type="application/javascript">
  110. $(document).ready(function() {
  111. $(".toast").toast('show');
  112. });
  113. document.body.addEventListener('htmx:configRequest', (event) => {
  114. event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
  115. })
  116. // window.onbeforeunload = function() {
  117. //return "Dude, are you sure you want to leave? Think of the kittens!";
  118. //}
  119. var moveCopyBtn = document.getElementById('move-copy-vids-btn');
  120. var moveCopyCollapse = document.getElementById('moveItemsToCollapse');
  121. var bsMoveCopyCollapse = new bootstrap.Collapse(moveCopyCollapse, {
  122. toggle: false
  123. });
  124. var deleteBtn = document.getElementById('delete-vids-btn');
  125. var deleteCollapse = document.getElementById('deleteItemsCollapse');
  126. var bsDeleteCollapse = new bootstrap.Collapse(deleteCollapse, {
  127. toggle: false
  128. });
  129. document.getElementById('manageBtn').addEventListener('click', function () {
  130. bsMoveCopyCollapse.hide();
  131. bsDeleteCollapse.hide();
  132. });
  133. moveCopyCollapse.addEventListener('show.bs.collapse', function () {
  134. moveCopyBtn.classList = "btn btn-success";
  135. bsDeleteCollapse.hide();
  136. });
  137. moveCopyCollapse.addEventListener('hide.bs.collapse', function () {
  138. moveCopyBtn.classList = "btn btn-outline-success";
  139. });
  140. deleteCollapse.addEventListener('show.bs.collapse', function () {
  141. deleteBtn.classList = "btn btn-danger";
  142. bsMoveCopyCollapse.hide();
  143. });
  144. deleteCollapse.addEventListener('hide.bs.collapse', function () {
  145. deleteBtn.classList = "btn btn-outline-danger";
  146. });
  147. <!-- end -->
  148. document.getElementById('select-all-btn').onclick = function() {
  149. document.getElementById('select-all-btn').style.display = "none";
  150. document.getElementById('deselect-all-btn').style.display = "block";
  151. var checkboxes = document.getElementsByClassName('video-checkboxes');
  152. for (var checkbox of checkboxes) {
  153. checkbox.checked = true;
  154. }
  155. }
  156. document.getElementById('deselect-all-btn').onclick = function() {
  157. document.getElementById('deselect-all-btn').style.display = "none";
  158. document.getElementById('select-all-btn').style.display = "block";
  159. var checkboxes = document.getElementsByClassName('video-checkboxes');
  160. for (var checkbox of checkboxes) {
  161. checkbox.checked = false;
  162. }
  163. }
  164. function row1_hide() {
  165. document.getElementById("row1").style.display = "none";
  166. 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.
  167. for(var i=0, len=checkboxes.length; i<len; i++)
  168. {
  169. checkboxes[i].style.display = "block";
  170. }
  171. document.getElementById("row2").style.display = "block";
  172. }
  173. function row1_show() {
  174. document.getElementById("row1").style.display = "block";
  175. 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.
  176. for(var i=0, len=checkboxes.length; i<len; i++)
  177. {
  178. checkboxes[i].style.display = "none";
  179. }
  180. document.getElementById("row2").style.display = "none";
  181. }
  182. function select_all_checkboxes(source) {
  183. checkboxes = document.getElementsByClassName('big-checkbox');
  184. for(var i=0, n=checkboxes.length;i<n;i++) {
  185. checkboxes[i].checked = source.checked;
  186. }
  187. }
  188. var clipboard = new ClipboardJS('.copy-btn');
  189. //Get the button
  190. let mybutton = document.getElementById("btn-back-to-top");
  191. // When the user scrolls down 20px from the top of the document, show the button
  192. window.onscroll = function () {
  193. scrollFunction();
  194. };
  195. function scrollFunction() {
  196. if (
  197. document.body.scrollTop > 150 ||
  198. document.documentElement.scrollTop > 150
  199. ) {
  200. mybutton.style.display = "block";
  201. } else {
  202. mybutton.style.display = "none";
  203. }
  204. }
  205. // When the user clicks on the button, scroll to the top of the document
  206. mybutton.addEventListener("click", backToTop);
  207. function backToTop() {
  208. document.body.scrollTop = 0;
  209. document.documentElement.scrollTop = 0;
  210. }
  211. </script>
  212. <!--
  213. <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>
  214. <script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
  215. <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
  216. -->
  217. </body>
  218. </html>