2
0

base.html 13 KB

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