Forráskód Böngészése

Add a progress bar to in progress scrobble

Colin Powell 2 éve
szülő
commit
fe39118b55

+ 25 - 0
templates/base.html

@@ -0,0 +1,25 @@
+<!doctype html>
+<html class="no-js" lang="">
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="x-ua-compatible" content="ie=edge">
+        <title>Untitled</title>
+        <meta name="description" content="">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+
+        <link rel="apple-touch-icon" href="/apple-touch-icon.png">
+        <!-- Place favicon.ico in the root directory -->
+
+    </head>
+    <body>
+        <!--[if lt IE 8]>
+            <p class="browserupgrade">
+            You are using an <strong>outdated</strong> browser. Please
+            <a href="http://browsehappy.com/">upgrade your browser</a> to improve
+            your experience.
+            </p>
+        <![endif]-->
+
+
+    </body>
+</html>

+ 18 - 22
vrobbler/templates/base.html

@@ -21,7 +21,7 @@
         }
         dt {
             padding: 2px 4px;
-            background: #777;
+            background: #000;
             color: #fff;
         }
         dd {
@@ -30,29 +30,25 @@
             min-height: 3em;
             border-right: 1px solid #777;
         }
-        #library-update-status { margin-right:10px; }
-        .card img { width:18em; padding: 1em; }
-        .card-block { padding: 1em 0 1em 0; }
-        .system-badge { padding: 1em; font-size: normal; }
-        .updating { color:#aaa; margin-right: 8px; }
-        .high { color: green; }
-        .medium { color: #aaa;}
-        .low { color: red; }
-        .card {
-            height: auto;
-            display: flex;
+        .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);
         }
-        .card-columns{
-            display: grid;
-            overflow: hidden;
-            grid-template-columns: repeat(2, 1fr);
-            grid-auto-rows: 1fr;
-            grid-column-gap: 20px;
-            grid-row-gap: 10px;
+
+        .progress-bar-fill {
+            display: block;
+            height: 22px;
+            background-color: #659cef;
+            border-radius: 3px;
+            transition: width 500ms ease-in-out;
         }
-        {% for system in game_systems %}
-        .{{system.retropie_slug}} { background: #{{system.get_color}}; }
-        {% endfor %}
         </style>
         {% block head_extra %}{% endblock %}
 

+ 14 - 6
vrobbler/templates/scrobbles/scrobble_list.html

@@ -5,16 +5,24 @@
 {% block content %}
     {% if now_playing_list %}
     <h2>Now playing</h2>
-    <ul>
-        {% for scrobble in now_playing_list %}
-        <li>{{scrobble.timestamp|date:"D, M j Y"}}: <a href="https://www.imdb.com/title/{{scrobble.video.imdb_id}}">{{scrobble.video}}</a></li>
-        {% endfor %}
-    </ul>
+    {% for scrobble in now_playing_list %}
+        <dl class="latest-scrobble">
+            <dt>{{scrobble.video.title}} - {{scrobble.video}}</dt>
+            <dd>
+                {{scrobble.timestamp|date:"D, M j Y"}} |
+                <a href="https://www.imdb.com/title/{{scrobble.video.imdb_id}}">IMDB</a>
+                <div class="progress-bar">
+                    <span class="progress-bar-fill" style="width: {{scrobble.percent_played}}%;"></span>
+                </div>
+            </dd>
+        </dl>
+        <br />
+    {% endfor %}
     {% endif %}
     <h2>Last scrobbles</h2>
     <ul>
         {% for scrobble in object_list %}
-        <li>{{scrobble.timestamp|date:"D, M j Y"}}: <a href="https://www.imdb.com/title/{{scrobble.video.imdb_id}}">{{scrobble.video}}</a></li>
+        <li>{{scrobble.timestamp|date:"D, M j Y"}}: <a href="https://www.imdb.com/title/{{scrobble.video.imdb_id}}">{{scrobble.video}}{% if scrobble.video.video_type == 'E' %} - {{scrobble.video.title}}{% endif %}</a></li>
         {% endfor %}
     </ul>
 {% endblock %}