base.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. {% load static %}
  2. {% load humanize %}
  3. <!doctype html>
  4. <html class="no-js" lang="">
  5. <head>
  6. <title>{% block page_title %}Scrobble all the things{% endblock %} @ Vrobbler</title>
  7. <meta charset="utf-8">
  8. <meta http-equiv="x-ua-compatible" content="ie=edge">
  9. <meta name="description" content="">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <link rel="shortcut icon" type="image/png" href="{% static 'images/favicon.ico' %}"/>
  12. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  13. <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
  14. <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" crossorigin="anonymous"></script>
  15. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
  16. <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.10/clipboard.min.js"></script>
  17. <style type="text/css">
  18. dl {
  19. display: flex;
  20. flex-flow: column wrap;
  21. border: 1px solid #777;
  22. }
  23. dt {
  24. padding: 2px 4px;
  25. background: #000;
  26. color: #fff;
  27. }
  28. dd {
  29. margin: 0;
  30. padding: 4px;
  31. min-height: 3em;
  32. border-right: 1px solid #777;
  33. }
  34. .now-playing { margin-right:20px;}
  35. .now-playing p { margin:0; }
  36. .now-playing .right { float:right; margin-right:10px; }
  37. .latest-scrobble {
  38. width: 50%;
  39. }
  40. .now-playing img { height:75px; width: 75px; object-fit: cover; }
  41. .progress-bar {
  42. width: 100%;
  43. background-color: #e0e0e0;
  44. padding: 3px;
  45. border-radius: 3px;
  46. box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
  47. }
  48. .progress-bar-fill {
  49. display: block;
  50. height: 22px;
  51. background-color: #659cef;
  52. border-radius: 3px;
  53. transition: width 500ms ease-in-out;
  54. }
  55. .bd-placeholder-img {
  56. font-size: 1.125rem;
  57. text-anchor: middle;
  58. -webkit-user-select: none;
  59. -moz-user-select: none;
  60. user-select: none;
  61. }
  62. @media (min-width: 768px) {
  63. .bd-placeholder-img-lg {
  64. font-size: 3.5rem;
  65. }
  66. }
  67. body {
  68. font-size: .875rem;
  69. }
  70. .feather {
  71. width: 16px;
  72. height: 16px;
  73. vertical-align: text-bottom;
  74. }
  75. /*
  76. * Sidebar
  77. */
  78. .sidebar {
  79. position: fixed;
  80. top: 0;
  81. /* rtl:raw:
  82. right: 0;
  83. */
  84. bottom: 0;
  85. /* rtl:remove */
  86. left: 0;
  87. z-index: 100; /* Behind the navbar */
  88. padding: 48px 0 0; /* Height of navbar */
  89. box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  90. }
  91. @media (max-width: 767.98px) {
  92. .sidebar {
  93. top: 5rem;
  94. }
  95. }
  96. .sidebar-sticky {
  97. position: relative;
  98. top: 0;
  99. height: calc(100vh - 48px);
  100. padding-top: .5rem;
  101. overflow-x: hidden;
  102. overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
  103. }
  104. .sidebar .nav-link {
  105. font-weight: 500;
  106. color: #333;
  107. }
  108. .sidebar .nav-link .feather {
  109. margin-right: 4px;
  110. color: #727272;
  111. }
  112. .sidebar .nav-link.active {
  113. color: #2470dc;
  114. }
  115. .sidebar .nav-link:hover .feather,
  116. .sidebar .nav-link.active .feather {
  117. color: inherit;
  118. }
  119. .sidebar-heading {
  120. font-size: .75rem;
  121. text-transform: uppercase;
  122. }
  123. /*
  124. * Navbar
  125. */
  126. .navbar-brand {
  127. padding-top: .75rem;
  128. padding-bottom: .75rem;
  129. font-size: 1rem;
  130. background-color: rgba(0, 0, 0, .25);
  131. box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
  132. }
  133. .navbar .navbar-toggler {
  134. top: .25rem;
  135. right: 1rem;
  136. }
  137. .navbar .form-control {
  138. padding: .75rem 1rem;
  139. border-width: 0;
  140. border-radius: 0;
  141. }
  142. .form-control-dark {
  143. color: #fff;
  144. background-color: rgba(255, 255, 255, .1);
  145. border-color: rgba(255, 255, 255, .1);
  146. }
  147. .form-control-dark:focus {
  148. border-color: transparent;
  149. box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
  150. }
  151. #scrobble-form { width: 100% }
  152. </style>
  153. {% block head_extra %}{% endblock %}
  154. <link rel="apple-touch-icon" href="{% static 'images/apple-touch-icon.png' %}">
  155. </head>
  156. <body>
  157. <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
  158. <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#">Vrobbler</a>
  159. <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
  160. <span class="navbar-toggler-icon"></span>
  161. </button>
  162. {% if user.is_authenticated %}
  163. <form id="scrobble-form" action="{% url 'scrobbles:lookup-manual-scrobble' %}" method="post">
  164. {% csrf_token %}
  165. {{ imdb_form }}
  166. </form>
  167. {% endif %}
  168. <div class="navbar-nav">
  169. <div class="nav-item text-nowrap">
  170. {% if user.is_authenticated %}
  171. <a class="nav-link px-3" href="{% url "account_logout" %}">Sign out</a>
  172. {% else %}
  173. <a class="nav-link px-3" href="{% url "account_login" %}">Sign in</a>
  174. {% endif %}
  175. </div>
  176. </div>
  177. </header>
  178. <div class="container-fluid">
  179. <div class="row">
  180. <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
  181. <div class="position-sticky pt-3">
  182. {% if messages %}
  183. <ul style="padding-right:10px;">
  184. {% for message in messages %}
  185. <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
  186. {% endfor %}
  187. </ul>
  188. {% endif %}
  189. <ul class="nav flex-column">
  190. <li class="nav-item">
  191. <a class="nav-link active" aria-current="page" href="/">
  192. <span data-feather="music"></span>
  193. Dashboard
  194. </a>
  195. </li>
  196. {% if user.is_authenticated %}
  197. <li class="nav-item">
  198. <a class="nav-link" aria-current="page" href="/charts/">
  199. <span data-feather="bar-chart"></span>
  200. Charts
  201. </a>
  202. </li>
  203. <li class="nav-item">
  204. <a class="nav-link" aria-current="page" href="/locations/">
  205. <span data-feather="map"></span>
  206. Locations
  207. </a>
  208. </li>
  209. <li class="nav-item">
  210. <a class="nav-link" href="/long-plays/">
  211. <span data-feather="playv"></span>
  212. Long plays
  213. </a>
  214. </li>
  215. <li class="nav-item">
  216. <a class="nav-link" href="/moods/">
  217. <span data-feather="smiley"></span>
  218. Moods
  219. </a>
  220. </li>
  221. <li class="nav-item">
  222. <a class="nav-link" href="/books/">
  223. <span data-feather="book"></span>
  224. Books
  225. </a>
  226. </li>
  227. <li class="nav-item">
  228. <a class="nav-link" href="/video-games/">
  229. <span data-feather="video"></span>
  230. Video games
  231. </a>
  232. </li>
  233. <li class="nav-item">
  234. <a class="nav-link" href="/board-games/">
  235. <span data-feather="board"></span>
  236. Board games
  237. </a>
  238. </li>
  239. <li class="nav-item">
  240. <a class="nav-link" href="/trails/">
  241. <span data-feather="trail"></span>
  242. Trails
  243. </a>
  244. </li>
  245. <li class="nav-item">
  246. <a class="nav-link" href="/beers/">
  247. <span data-feather="beer"></span>
  248. Beers
  249. </a>
  250. </li>
  251. <li class="nav-item">
  252. <a class="nav-link" href="/imports/">
  253. <span data-feather="log"></span>
  254. Imports
  255. </a>
  256. </li>
  257. <li class="nav-item">
  258. <a class="nav-link" href="/admin/">
  259. <span data-feather="key"></span>
  260. Admin
  261. </a>
  262. </li>
  263. {% endif %}
  264. </ul>
  265. {% block extra_nav %}
  266. {% endblock %}
  267. <hr/>
  268. {% if now_playing_list and user.is_authenticated %}
  269. <ul>
  270. <b>Now playing</b>
  271. {% for scrobble in now_playing_list %}
  272. <div class="now-playing">
  273. {% if scrobble.media_obj.primary_image_url %}<div style="float:left;padding-right:10px;padding-bottom:10px;"><img src="{{scrobble.media_obj.primary_image_url}}" /></div>{% endif %}
  274. <p><a href="{{scrobble.media_obj.get_absolute_url}}">{{scrobble.media_obj.title}}</a></p>
  275. {% if scrobble.media_obj.subtitle %}<p><em><a href="{{scrobble.media_obj.subtitle.get_absolute_url}}">{{scrobble.media_obj.subtitle}}</a></em></p>{% endif %}
  276. {% if scrobble.logdata %}{% if scrobble.logdata.description %}<p><em>{{scrobble.logdata.description}}</em></p>{% endif %}{% endif %}
  277. <p><small>{{scrobble.timestamp|naturaltime}} from {{scrobble.source}}</small></p>
  278. <div class="progress-bar" style="margin-right:5px;">
  279. <span class="progress-bar-fill" style="width: {{scrobble.percent_played}}%;"></span>
  280. </div>
  281. <p class="action-buttons">
  282. <a href="{% url "scrobbles:cancel" scrobble.uuid %}">Cancel</a>
  283. <a class="right" href="{% url "scrobbles:finish" scrobble.uuid %}">Finish</a>
  284. </p>
  285. {% if not forloop.last %}<hr/>{% endif %}
  286. </div>
  287. {% endfor %}
  288. </ul>
  289. {% if now_playing_list|length > 1 %}<hr/>{% endif %}
  290. {% endif %}
  291. {% if active_imports %}
  292. {% for import in active_imports %}
  293. <ul style="padding-right:10px;">
  294. <li>Import in progress ({{import.processing_started|naturaltime}})</li>
  295. </ul>
  296. {% endfor %}
  297. {% endif %}
  298. </div>
  299. </nav>
  300. {% block content %}
  301. {% endblock %}
  302. </div>
  303. </div>
  304. {% block extra_js %}{% endblock %}
  305. </body>
  306. </html>