Prechádzať zdrojové kódy

[videos] Wire up generic video list view

Colin Powell 4 dní pred
rodič
commit
a2f507a976

+ 1 - 1
vrobbler/apps/videos/urls.py

@@ -5,7 +5,6 @@ app_name = "videos"
 
 
 urlpatterns = [
-    # path('', views.scrobble_endpoint, name='scrobble-list'),
     path("movies/", views.MovieListView.as_view(), name="movie_list"),
     path("series/", views.SeriesListView.as_view(), name="series_list"),
     path(
@@ -13,6 +12,7 @@ urlpatterns = [
         views.SeriesDetailView.as_view(),
         name="series_detail",
     ),
+    path('videos/', views.VideoListView(), name='video_list'),
     path(
         "video/<slug:slug>/",
         views.VideoDetailView.as_view(),

+ 1 - 1
vrobbler/templates/scrobbles/_last_scrobbles.html

@@ -27,7 +27,7 @@
         <p>No tasks today</p>
         {% endif %}
 
-        <h3><a href="{% url 'videos:movie_list' %}">Videos</a></h3>
+        <h3><a href="{% url 'videos:video_list' %}">Videos</a></h3>
         {% if Video %}
         {% with scrobbles=Video count=Video_count time=Video_time %}
         {% include "scrobbles/_scrobble_table.html" %}

+ 32 - 0
vrobbler/templates/videos/video_list.html

@@ -0,0 +1,32 @@
+{% extends "base_list.html" %}
+{% block title %}Videos{% endblock %}
+{% block head_extra %}
+<style>
+  dl {
+    width: 210px;
+    float: left;
+    margin-right: 10px;
+  }
+  dt a {
+    color: white;
+    text-decoration: none;
+    font-size: smaller;
+  }
+  img {
+    height: 200px;
+    width: 200px;
+    object-fit: cover;
+  }
+  dd .right {
+    float: right;
+  }
+</style>
+{% endblock %}
+
+{% block lists %}
+<div class="row">
+  <div class="col-md">
+    <div class="table-responsive">{% include "_scrobblable_list.html" %}</div>
+  </div>
+</div>
+{% endblock %}