base.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. {% load static %}
  2. {% with domain="http://127.0.0.1:8000/" %}
  3. <!doctype html>
  4. <html lang="en">
  5. <head>
  6. <link rel="icon" href="{% static 'fontawesome-free-5.15.3-web/svgs/solid/underline.svg' %}">
  7. <meta charset="utf-8">
  8. <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">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <meta name="description" content="UnTube is a simple Youtube playlist manager. Modify and keep track of your YouTube playlists with ease.">
  11. <meta name="author" content="Mohammed Abu Bakar Khan">
  12. <title>UnTube - A Youtube Playlist Manager</title>
  13. <style type="text/css">
  14. html {
  15. scroll-behavior: smooth;
  16. }
  17. body {
  18. margin: 0;
  19. //background: linear-gradient(-45deg, #e2b968, #68af5b, #8a97bc, #d69ab2);
  20. //background: linear-gradient(-45deg, #B2A3FF, #84bcf3, #AE876B, #B0E7AE);
  21. //background: linear-gradient(-45deg, #0645a4, #2480cd, #84bcf3, #b7d6f7);
  22. //background: linear-gradient(-45deg, #AE876B, #ABA27B, #A7BC8A, #A3D69A);
  23. //background-size: 400% 400%;
  24. //animation: gradient 10s ease infinite;
  25. }
  26. @keyframes gradient {
  27. 0% {
  28. background-position: 0% 50%;
  29. }
  30. 50% {
  31. background-position: 100% 50%;
  32. }
  33. 100% {
  34. background-position: 0% 50%;
  35. }
  36. }
  37. .scrollToTopBtn {
  38. background-color: black;
  39. border: none;
  40. border-radius: 50%;
  41. color: white;
  42. cursor: pointer;
  43. font-size: 16px;
  44. line-height: 58px;
  45. width: 58px;
  46. /* place it at the bottom right corner */
  47. position: relative;
  48. bottom: 20px;
  49. right: 0px;
  50. left: 30px;
  51. /* hide with opacity */
  52. opacity: 0;
  53. /* also add a translate effect */
  54. transform: translateY(100px);
  55. /* and a transition */
  56. transition: all .5s ease
  57. }
  58. .showBtn {
  59. opacity: 1;
  60. transform: translateY(0)
  61. }
  62. #btn-back-to-top {
  63. display: none; /* Hidden by default */
  64. position: fixed; /* Fixed/sticky position */
  65. bottom: 20px; /* Place the button at the bottom of the page */
  66. right: 30px; /* Place the button 30px from the right */
  67. z-index: 99999; /* Make sure it does not overlap */
  68. border: none; /* Remove borders */
  69. outline: none; /* Remove outline */
  70. background-color: red; /* Set a background color */
  71. color: white; /* Text color */
  72. cursor: pointer; /* Add a mouse pointer on hover */
  73. padding: 15px; /* Some padding */
  74. border-radius: 10px; /* Rounded corners */
  75. font-size: 18px; /* Increase font size */
  76. }
  77. #btn-back-to-top:hover {
  78. background-color: #555; /* Add a dark-grey background on hover */
  79. }
  80. .big-checkbox {width: 30px; height: 30px;}
  81. </style>
  82. <link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Open+Sans&display=swap" rel="stylesheet">
  83. <link href="{% static 'fontawesome-free-5.15.3-web/css/all.min.css' %}" rel="stylesheet">
  84. <link href="{% static 'bootstrap5.0.1/css/bootstrap.min.css' %}" rel="stylesheet">
  85. <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bbbootstrap/libraries@main/choices.min.css">
  86. <script src="{% static 'htmx/htmx.min.js' %}" type="application/javascript"></script>
  87. <script src="{% static 'clipboard.js/clipboard.min.js' %}" type="application/javascript"></script>
  88. <script src="{% static 'jquery3.6.0/js/jquery-3.6.0.min.js' %}" type="application/javascript"></script>
  89. <script src="{% static 'bootstrap5.0.1/js/bootstrap.bundle.min.js' %}" type="application/javascript"></script>
  90. <script src="https://cdn.jsdelivr.net/gh/bbbootstrap/libraries@main/choices.min.js"></script>
  91. <script src="{% static 'htmx/extensions/class-tools.js' %}" type="application/javascript"></script>
  92. </head>
  93. <body class="text-dark" style="font-family: 'Fredoka One', monospace; background-color: #FDF4DC;">
  94. {% if user.profile.show_import_page %}
  95. <meta http-equiv="refresh" content="0;url={{ domain }}import/init" />
  96. {% endif %}
  97. <nav class="navbar navbar-expand-lg navbar-light" id="navbar">
  98. <div class="container-fluid">
  99. <a class="navbar-brand" href="{% url 'home' %}"><h3><kbd>UnTube</kbd></h3></a>
  100. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  101. <span class="navbar-toggler-icon"></span>
  102. </button>
  103. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  104. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  105. <li class="nav-item">
  106. <a class="nav-link" aria-current="page" href="{% url 'home' %}">Dashboard</a>
  107. </li>
  108. <li class="nav-item dropdown">
  109. <a class="nav-link dropdown-toggle" href="#" id="libraryDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  110. Library
  111. </a>
  112. <ul class="dropdown-menu" aria-labelledby="libraryDropdown" style="z-index: 1021;">
  113. <li><a class="dropdown-item" href="{% url 'all_playlists' 'home' %}">Playlists</a></li>
  114. <li><a class="dropdown-item" href="{% url 'all_videos' 'home' %}">Videos</a></li>
  115. </ul>
  116. </li>
  117. <li class="nav-item dropdown">
  118. <a class="nav-link dropdown-toggle" href="#" id="quickViewDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  119. Quick View
  120. </a>
  121. <ul class="dropdown-menu" aria-labelledby="quickViewDropdown" style="z-index: 1021;">
  122. <li><a class="dropdown-item" href="{% url 'all_playlists' 'favorites' %}">Favorites</a></li>
  123. <li><a class="dropdown-item" href="{% url 'all_playlists' 'watching' %}">Watching</a></li>
  124. <li><a class="dropdown-item" href="{% url 'all_playlists' 'plan-to-watch' %}">Plan to Watch</a></li>
  125. <li><a class="dropdown-item" href="{% url 'all_playlists' 'user-owned' %}">Your YT Playlists</a></li>
  126. <li><a class="dropdown-item" href="{% url 'all_playlists' 'imported' %}">Imported</a></li>
  127. <li><hr class="dropdown-divider"></li>
  128. <li><a class="dropdown-item" href="{% url 'all_playlists' 'all' %}">View all</a></li>
  129. </ul>
  130. </li>
  131. <li class="nav-item">
  132. <a class="nav-link" href="{% url 'manage_playlists' %}">Manage</a>
  133. </li>
  134. <!--
  135. <li class="nav-item">
  136. <a class="nav-link" href="{% url 'settings' %}">Settings</a>
  137. </li>
  138. -->
  139. </ul>
  140. <div class="navbar-nav justify-content-end">
  141. <!--
  142. <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">
  143. -->
  144. <a class="nav-link btn-lg me-1 mt-2" href="{% url 'search' %}" {% if user.profile.open_search_new_tab %}target="_blank"{% endif %}>
  145. <i class="fas fa-search"></i>
  146. </a>
  147. <li class="nav-item dropdown">
  148. <a class="nav-link dropdown-toggle" href="#" id="quickViewDropdown" role="button" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false">
  149. <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" width="42" height="42">
  150. </a>
  151. <ul class="dropdown-menu dropdown-menu-lg-end" aria-labelledby="quickViewDropdown" style="z-index: 1021;">
  152. <li class="dropdown-item overflow-auto">Logged in as <span style="border-bottom: 3px #020000 dashed;">{{ user.username }}</span></li>
  153. <li><a class="dropdown-item" href="{% url 'profile' %}">Profile</a></li>
  154. <li><a class="dropdown-item" href="{% url 'settings' %}">Settings</a></li>
  155. <li><hr class="dropdown-divider"></li>
  156. <li><a class="dropdown-item" href="{% url 'log_out' %}">Log out</a></li>
  157. </ul>
  158. </li>
  159. </div>
  160. </div>
  161. </div>
  162. </nav>
  163. <div class="container-fluid text-dark">
  164. <div class="row">
  165. <main class="ms-lg-auto px-lg-5">
  166. {% if messages %}
  167. {% for message in messages %}
  168. <div class="alert alert-success alert-dismissible fade show" role="alert">
  169. {{ message }}
  170. <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  171. </div>
  172. {% endfor %}
  173. {% endif %}
  174. {% block content %}
  175. {% endblock %}
  176. </main>
  177. </div>
  178. </div>
  179. <br>
  180. <script type="application/javascript">
  181. $(document).ready(function(){
  182. // multiple choices select search box
  183. var multipleCancelButton = new Choices('#choices-multiple-remove-button', {
  184. removeItemButton: true,
  185. });
  186. });
  187. // copy functionality
  188. var clipboard = new ClipboardJS('.copy-btn');
  189. // send csrf_token when htmx does a post request
  190. document.body.addEventListener('htmx:configRequest', (event) => {
  191. event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
  192. })
  193. var scrollToTopBtn = document.querySelector(".scrollToTopBtn")
  194. var rootElement = document.documentElement
  195. function handleScroll() {
  196. // Do something on scroll
  197. var scrollTotal = rootElement.scrollHeight - rootElement.clientHeight
  198. if ((rootElement.scrollTop / scrollTotal ) > 0.10) {
  199. // Show button
  200. scrollToTopBtn.classList.add("showBtn")
  201. } else {
  202. // Hide button
  203. scrollToTopBtn.classList.remove("showBtn");
  204. }
  205. }
  206. function scrollToTop() {
  207. // Scroll to top logic
  208. rootElement.scrollTo({
  209. top: 0,
  210. behavior: "smooth"
  211. })
  212. }
  213. scrollToTopBtn.addEventListener("click", scrollToTop)
  214. document.addEventListener("scroll", handleScroll)
  215. // window.onbeforeunload = function() {
  216. //return "Dude, are you sure you want to leave? Think of the kittens!";
  217. //}
  218. </script>
  219. <!--
  220. <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>
  221. <script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
  222. <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
  223. -->
  224. </body>
  225. </html>
  226. {% endwith %}