From 25b37d6f45102961d6b0e19aefad3330674d698a Mon Sep 17 00:00:00 2001 From: Evert Date: Tue, 27 Feb 2018 20:14:28 +0200 Subject: [PATCH] Add a page with full list of shows --- LandingPage/templates/shows.html | 16 ++++++++++++++++ LandingPage/urls.py | 1 + LandingPage/views.py | 8 +++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 LandingPage/templates/shows.html diff --git a/LandingPage/templates/shows.html b/LandingPage/templates/shows.html new file mode 100644 index 0000000..969774e --- /dev/null +++ b/LandingPage/templates/shows.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% block content %} +
+

Show Index

+
+ {% for show in shows %} + + {% if forloop.counter|divisibleby:3 %} +
+ {% endif %} + {% endfor %} +
+
+{% endblock %} diff --git a/LandingPage/urls.py b/LandingPage/urls.py index 4a601a3..fcced34 100644 --- a/LandingPage/urls.py +++ b/LandingPage/urls.py @@ -22,6 +22,7 @@ urlpatterns = [ url(r'^logout/$', views.LogoutView), url(r'^login/redirect$', views.LoginRedirect.as_view()), url(r'^login$', views.Login.as_view()), + url(r'^shows/$', views.Shows.as_view()), url(r'^$', views.LandingPage.as_view()), ] diff --git a/LandingPage/views.py b/LandingPage/views.py index fd54be4..946f09b 100644 --- a/LandingPage/views.py +++ b/LandingPage/views.py @@ -92,5 +92,11 @@ class LandingPage(TemplateView): 'boards': DiscussionBoard.objects.count() } return ctx - +class Shows(TemplateView): + template_name = "shows.html" + + def get_context_data(self, **kwargs): + ctx = super().get_context_data() + ctx['shows'] = Show.objects.all() + return ctx