def get_context_data(self, **kwargs):
context = super(NonstopPlaylistView, self).get_context_data(**kwargs)
- context['emission'] = Emission.objects.get(slug=kwargs.get('slug'))
+ try:
+ context['emission'] = Emission.objects.get(slug=kwargs.get('slug'))
+ except Emission.DoesNotExist:
+ raise Http404()
context['date'] = date(int(kwargs.get('year')),
int(kwargs.get('month')), int(kwargs.get('day')))
+ context['future'] = (context['date'] >= date.today())
nonstop_object = Nonstop.objects.get(slug=kwargs.get('slug'))
start = datetime(
{% elif cell.emission %}
{% with cell.emission as emission %}{% emission_resume %}{% endwith %}
{% else %}
- <a href="{% url 'emission-view' slug=cell.slug %}" class="nonstop"><em>{{ cell.label }}</em></a> - <span class="smooth categories category">Musique en continu</span>
+ <a href="{% url 'emission-view' slug=cell.slug %}" class="nonstop"><em>{{ cell.label }}</em></a> - <span class="smooth categories category">Musique en continu</span> - <a class="playlist" href="{% url 'nonstop-playlist' slug=cell.slug year=cell.datetime.year month=cell.datetime.month day=cell.datetime.day %}">playlist</a>
{% endif %}
</div>
</li>
{% endfor %}
</table>
+ {% if not tracks|length %}
+ <p>
+ {% if future %}Pas encore de playlist connue, à plus tard ?{% else %}Pas de playlist connue.{% endif %}
+ </p>
+ {% endif %}
+
<p class="playlist-disclaimer">
N.B. Débordements d'émissions et autres manifestations
radiophoniques spontanées peuvent amener cette liste à ne pas être