Просмотр исходного кода

[scrobbles] Add working to status page

Colin Powell 8 месяцев назад
Родитель
Сommit
24223ebe13
2 измененных файлов с 16 добавлено и 0 удалено
  1. 1 0
      vrobbler/apps/scrobbles/views.py
  2. 15 0
      vrobbler/templates/scrobbles/status.html

+ 1 - 0
vrobbler/apps/scrobbles/views.py

@@ -791,6 +791,7 @@ class ScrobbleStatusView(LoginRequiredMixin, TemplateView):
         data["participating"] = progress_plays.filter(
             life_event__isnull=False
         ).first()
+        data["working"] = progress_plays.filter(task__isnull=False).first()
 
         long_plays = user_scrobble_qs.filter(
             long_play_complete=False, played_to_completion=True

+ 15 - 0
vrobbler/templates/scrobbles/status.html

@@ -149,5 +149,20 @@
             </div>
             {% endif %}
         </div>
+        <hr />
+        <h3>Working</h3>
+        <div class="working">
+            {% if working %}
+            <div class="titles">
+                <p><a href="{{working.media_obj.get_absolute_url}}">{{working.media_obj}}</a></p>
+                {% if working.media_obj.subtitle %}<p><em><a href="{{working.media_obj.subtitle.get_absolute_url}}">{{working.media_obj.subtitle}}</a></em></p>{% endif %}
+            </div>
+            <p><small>{{working.timestamp|naturaltime}} from {{working.source}}</small></p>
+            {% else %}
+            <div class="titles">
+                <p>Nothing</p>
+            </div>
+            {% endif %}
+        </div>
     </body>
 </html>