Skip to content

Commit

Permalink
Displaying programme info when episode data doesn't exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Iago committed Feb 13, 2016
1 parent 902b3df commit 244069a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

<div class="col-lg-5 col-lg-offset-1 spacing">
<h4>{% firstof episode.title|upper episode|upper %}</h4>
<p>{{ episode.summary|safe }}</p>

<p>{% firstof episode.summary|safe episode.programme.synopsis|safe '' %}</p>

<h4>{% trans "Podcast" %}</h4>
<p>
Expand Down
33 changes: 17 additions & 16 deletions radio/apps/programmes/templates/programmes/programme_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,25 @@ <h4>{% trans 'Programme Details' %}</h4>
{% endif %}
</div><! --/container -->

{% if episode_list %}
<div class="container mhb">
<div class="row">
<h3 class="text-center">{% trans 'Episodes' %}</h3>
{% for episode in episode_list %}

{% ifchanged episode.season %}
{% if not forloop.first %}</div> {% endif %}
<div class="col-lg-3">
<h4>{% trans "Season" %} {{episode.season}}</h4>
<div class="hline"></div>
{% endifchanged %}
<p><a href="{% url 'programmes:episode_detail' programme.slug episode.season episode.number_in_season %}">{{ episode }}</a></p>
{% if forloop.last %}</div>{% endif %}

<div class="container mhb">
<div class="row">
<h3 class="text-center">{% trans 'Episodes' %}</h3>
{% for episode in episode_list %}

{% ifchanged episode.season %}
{% if not forloop.first %}</div> {% endif %}
<div class="col-lg-3">
<h4>{% trans "Season" %} {{episode.season}}</h4>
<div class="hline"></div>
{% endifchanged %}
<p><a href="{% url 'programmes:episode_detail' programme.slug episode.season episode.number_in_season %}">{{ episode }}</a></p>
{% if forloop.last %}</div>{% endif %}

{% endfor %}
{% endfor %}
</div>
</div>
</div>
{% endif %}

{% if role_list %}
<div class="container mhb">
Expand Down
2 changes: 1 addition & 1 deletion radio/apps/radio/templates/radio/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h4>{% trans 'More About Us.' %}</h4>
<h4>{% trans 'Latest Episodes' %}</h4>
<div class="hline"></div>
{% for episode in latest_episodes %}
<p><a href="{{ episode.get_absolute_url }}">{{ episode.title }}</a></p>
<p><a href="{{ episode.get_absolute_url }}">{% firstof episode.title|title episode|title %}</a></p>
{% empty %}
<p>{% trans "There are currently no podcast" %}</p>
{% endfor %}
Expand Down

0 comments on commit 244069a

Please sign in to comment.