base.html 13 KB

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