base.html 12 KB

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