Quellcode durchsuchen

[scrobbles] Add webpages to status

Colin Powell vor 1 Jahr
Ursprung
Commit
a269949a23
2 geänderte Dateien mit 17 neuen und 0 gelöschten Zeilen
  1. 3 0
      vrobbler/apps/scrobbles/views.py
  2. 14 0
      vrobbler/templates/scrobbles/status.html

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

@@ -762,6 +762,9 @@ class ScrobbleStatusView(LoginRequiredMixin, TemplateView):
         data["sporting"] = progress_plays.filter(
             sport_event__isnull=False
         ).first()
+        data["browsing"] = progress_plays.filter(
+            web_page__isnull=False
+        ).first()
 
         long_plays = user_scrobble_qs.filter(
             long_play_complete=False, played_to_completion=True

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

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