slugify episode name into url

This commit is contained in:
Evert Prants 2017-11-11 12:53:25 +02:00
parent 1f71c26fe7
commit c6672da6c6
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@
<div class="season-name">{% if season.name %}{{season.number}} - {{season.name}}{% else %}Season {{season.number}}{%endif%}</div> <div class="season-name">{% if season.name %}{{season.number}} - {{season.name}}{% else %}Season {{season.number}}{%endif%}</div>
<div class="episodes"> <div class="episodes">
{% for episode in season.episodes.all %} {% for episode in season.episodes.all %}
<a class="episode" data-season="{{season.number}}" data-number="{{episode.episode}}" data-title="{{episode.name}}" href="episode/{{season.number}}/{{episode.episode}}">{{episode.episode}} - {{episode.name}} <a class="episode" data-season="{{season.number}}" data-number="{{episode.episode}}" data-title="{{episode.name}}" href="episode/{{season.number}}/{{episode.episode}}-{{episode.name|slugify}}">{{episode.episode}} - {{episode.name}}
<span class="submission_cnt">{{episode.submissions.all|length}} Available Links</span> <span class="submission_cnt">{{episode.submissions.all|length}} Available Links</span>
</a> </a>
{% endfor %} {% endfor %}

View File

@ -20,6 +20,6 @@ from . import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view()), url(r'^$', views.IndexView.as_view()),
url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})/?$', views.EpisodeView.as_view()), url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})(-[\w-]+)?/?$', views.EpisodeView.as_view()),
url(r'^vote/(?P<subid>\d+)/(?P<positive>[0-1])/?$', views.SubmissionVoteSubmit.as_view()) url(r'^vote/(?P<subid>\d+)/(?P<positive>[0-1])/?$', views.SubmissionVoteSubmit.as_view())
] ]