Add a page with full list of shows
This commit is contained in:
parent
c9350f357d
commit
25b37d6f45
16
LandingPage/templates/shows.html
Normal file
16
LandingPage/templates/shows.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
<div class="container mt-4 mb-4">
|
||||||
|
<h1>Show Index</h1>
|
||||||
|
<div class="row">
|
||||||
|
{% for show in shows %}
|
||||||
|
<div class="col">
|
||||||
|
<a href="/show/{{show.abbr}}">{{show.name}}</a>
|
||||||
|
</div>
|
||||||
|
{% if forloop.counter|divisibleby:3 %}
|
||||||
|
<div class="w-100"></div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
@ -22,6 +22,7 @@ urlpatterns = [
|
|||||||
url(r'^logout/$', views.LogoutView),
|
url(r'^logout/$', views.LogoutView),
|
||||||
url(r'^login/redirect$', views.LoginRedirect.as_view()),
|
url(r'^login/redirect$', views.LoginRedirect.as_view()),
|
||||||
url(r'^login$', views.Login.as_view()),
|
url(r'^login$', views.Login.as_view()),
|
||||||
|
url(r'^shows/$', views.Shows.as_view()),
|
||||||
url(r'^$', views.LandingPage.as_view()),
|
url(r'^$', views.LandingPage.as_view()),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -93,4 +93,10 @@ class LandingPage(TemplateView):
|
|||||||
}
|
}
|
||||||
return ctx
|
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
|
||||||
|
Reference in New Issue
Block a user