123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- {% load static %}
- {% load humanize %}
- <!doctype html>
- <html class="no-js" lang="">
- <head>
- <title>{% block page_title %}Scrobble all the things{% endblock %} @ Vrobbler</title>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="description" content="">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
- <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>
- <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.10/clipboard.min.js"></script>
- <style type="text/css">
- dl {
- display: flex;
- flex-flow: column wrap;
- border: 1px solid #777;
- }
- dt {
- padding: 2px 4px;
- background: #000;
- color: #fff;
- }
- dd {
- margin: 0;
- padding: 4px;
- min-height: 3em;
- border-right: 1px solid #777;
- }
- .latest-scrobble {
- width: 50%;
- }
- .progress-bar {
- width: 100%;
- background-color: #e0e0e0;
- padding: 3px;
- border-radius: 3px;
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
- }
- .progress-bar-fill {
- display: block;
- height: 22px;
- background-color: #659cef;
- border-radius: 3px;
- transition: width 500ms ease-in-out;
- }
- .bd-placeholder-img {
- font-size: 1.125rem;
- text-anchor: middle;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- }
- @media (min-width: 768px) {
- .bd-placeholder-img-lg {
- font-size: 3.5rem;
- }
- }
- body {
- font-size: .875rem;
- }
- .feather {
- width: 16px;
- height: 16px;
- vertical-align: text-bottom;
- }
- /*
- * Sidebar
- */
- .sidebar {
- position: fixed;
- top: 0;
- /* rtl:raw:
- right: 0;
- */
- bottom: 0;
- /* rtl:remove */
- left: 0;
- z-index: 100; /* Behind the navbar */
- padding: 48px 0 0; /* Height of navbar */
- box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
- }
- @media (max-width: 767.98px) {
- .sidebar {
- top: 5rem;
- }
- }
- .sidebar-sticky {
- position: relative;
- top: 0;
- height: calc(100vh - 48px);
- padding-top: .5rem;
- overflow-x: hidden;
- overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
- }
- .sidebar .nav-link {
- font-weight: 500;
- color: #333;
- }
- .sidebar .nav-link .feather {
- margin-right: 4px;
- color: #727272;
- }
- .sidebar .nav-link.active {
- color: #2470dc;
- }
- .sidebar .nav-link:hover .feather,
- .sidebar .nav-link.active .feather {
- color: inherit;
- }
- .sidebar-heading {
- font-size: .75rem;
- text-transform: uppercase;
- }
- /*
- * Navbar
- */
- .navbar-brand {
- padding-top: .75rem;
- padding-bottom: .75rem;
- font-size: 1rem;
- background-color: rgba(0, 0, 0, .25);
- box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
- }
- .navbar .navbar-toggler {
- top: .25rem;
- right: 1rem;
- }
- .navbar .form-control {
- padding: .75rem 1rem;
- border-width: 0;
- border-radius: 0;
- }
- .form-control-dark {
- color: #fff;
- background-color: rgba(255, 255, 255, .1);
- border-color: rgba(255, 255, 255, .1);
- }
- .form-control-dark:focus {
- border-color: transparent;
- box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
- }
- </style>
- {% block head_extra %}{% endblock %}
- <link rel="apple-touch-icon" href="/apple-touch-icon.png">
- <!-- Place favicon.ico in the root directory -->
- </head>
- <body>
- <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
- <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#">Vrobbler</a>
- <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">
- <span class="navbar-toggler-icon"></span>
- </button>
- <input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
- <div class="navbar-nav">
- <div class="nav-item text-nowrap">
- {% if user.is_authenticated %}
- <a class="nav-link px-3" href="{% url "account_logout" %}">Sign out</a>
- {% else %}
- <a class="nav-link px-3" href="{% url "account_login" %}">Sign in</a>
- {% endif %}
- </div>
- </div>
- </header>
- <div class="container-fluid">
- <div class="row">
- <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
- <div class="position-sticky pt-3">
- {% if now_playing_list %}
- <ul style="padding-right:10px;">
- <b>Now playing</b>
- {% for scrobble in now_playing_list %}
- {% if scrobble.video %}
- <div>
- {{scrobble.video.title}}<br/>
- <small>{{scrobble.created|naturaltime}}<br/>
- from {{scrobble.source}}</small>
- <div class="progress-bar">
- <span class="progress-bar-fill" style="width: {{scrobble.percent_played}}%;"></span>
- </div>
- </div>
- {% endif %}
- {% if scrobble.track %}
- <div>
- {{scrobble.track.title}}<br/>
- <em>{{scrobble.track.artist}}</em><br/>
- <small>{{scrobble.created|naturaltime}}<br/>
- from {{scrobble.source}}</small>
- <div class="progress-bar" style="margin-right:5px;">
- <span class="progress-bar-fill" style="width: {{scrobble.percent_played}}%;"></span>
- </div>
- </div>
- {% endif %}
- <hr/>
- {% endfor %}
- </ul>
- {% endif %}
- <ul class="nav flex-column">
- <li class="nav-item">
- <a class="nav-link active" aria-current="page" href="#">
- <span data-feather="music"></span>
- Tracks
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">
- <span data-feather="user"></span>
- Artists
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">
- <span data-feather="film"></span>
- Movies
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">
- <span data-feather="tv"></span>
- Series
- </a>
- </li>
- {% if user.is_authenticated %}
- <li class="nav-item">
- <a class="nav-link" href="/admin/">
- <span data-feather="key"></span>
- Admin
- </a>
- </li>
- {% endif %}
- </ul>
- {% block extra_nav %}
- {% endblock %}
- </div>
- </nav>
- {% block content %}
- {% endblock %}
- </div>
- </div>
- {% block extra_js %}
- <script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
- <script><!-- comment ------------------------------------------------->
- /* globals Chart:false, feather:false */
- (function () {
- 'use strict'
- feather.replace({ 'aria-hidden': 'true' })
- // Graphs
- var ctx = document.getElementById('myChart')
- // eslint-disable-next-line no-unused-vars
- var myChart = new Chart(ctx, {
- type: 'line',
- data: {
- labels: [
- {% for day in weekly_data.keys %}
- "{{day}}"{% if not forloop.last %},{% endif %}
- {% endfor %}
- ],
- datasets: [{
- data: [
- {% for count in weekly_data.values %}
- {{count}}{% if not forloop.last %},{% endif %}
- {% endfor %}
- ],
- lineTension: 0,
- backgroundColor: 'transparent',
- borderColor: '#007bf0',
- borderWidth: 4,
- pointBackgroundColor: '#007bff'
- }]
- },
- options: {
- scales: {
- yAxes: [{
- ticks: {
- beginAtZero: false
- }
- }]
- },
- legend: {
- display: false
- }
- }
- })
- })()
- </script>
- {% endblock %}
- </body>
- </html>
|