Add a page with full list of shows

This commit is contained in:
Evert Prants 2018-02-27 20:14:28 +02:00
parent c9350f357d
commit 25b37d6f45
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 24 additions and 1 deletions

View 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 %}

View File

@ -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()),
]

View File

@ -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