浏览代码

[scrobbles] Add life events to status page

Colin Powell 11 月之前
父节点
当前提交
2c5516ae4e
共有 2 个文件被更改,包括 17 次插入0 次删除
  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["browsing"] = progress_plays.filter(
             web_page__isnull=False
         ).first()
+        data["participating"] = progress_plays.filter(
+            life_event__isnull=False
+        ).first()
 
         long_plays = user_scrobble_qs.filter(
             long_play_complete=False, played_to_completion=True

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

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