From 799b4ec633885af5795b4f325d2ab332f136b181 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 22 Dec 2016 16:34:39 +0100 Subject: [PATCH] include nonstop playlist links in week view --- panikweb/views.py | 6 +++++- panikweb_templates/static/css/specifics.css | 4 ++++ panikweb_templates/templates/includes/week.html | 2 +- panikweb_templates/templates/nonstop_playlist.html | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/panikweb/views.py b/panikweb/views.py index a95d7e5..04cfafa 100644 --- a/panikweb/views.py +++ b/panikweb/views.py @@ -143,9 +143,13 @@ class NonstopPlaylistView(TemplateView): 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( diff --git a/panikweb_templates/static/css/specifics.css b/panikweb_templates/static/css/specifics.css index 3171c2f..6d546f1 100644 --- a/panikweb_templates/static/css/specifics.css +++ b/panikweb_templates/static/css/specifics.css @@ -1995,3 +1995,7 @@ div#chat.moderation .msg-in span.from:hover::after { content: "\f056"; font-size: 80%; } + +div.programCell a.playlist { + font-size: 80%; +} diff --git a/panikweb_templates/templates/includes/week.html b/panikweb_templates/templates/includes/week.html index dac2054..2ad14dd 100644 --- a/panikweb_templates/templates/includes/week.html +++ b/panikweb_templates/templates/includes/week.html @@ -13,7 +13,7 @@ {% elif cell.emission %} {% with cell.emission as emission %}{% emission_resume %}{% endwith %} {% else %} - {{ cell.label }} - Musique en continu + {{ cell.label }} - Musique en continu - playlist {% endif %} diff --git a/panikweb_templates/templates/nonstop_playlist.html b/panikweb_templates/templates/nonstop_playlist.html index 4c44757..61f0464 100644 --- a/panikweb_templates/templates/nonstop_playlist.html +++ b/panikweb_templates/templates/nonstop_playlist.html @@ -28,6 +28,12 @@ {% endfor %} + {% if not tracks|length %} +

+ {% if future %}Pas encore de playlist connue, à plus tard ?{% else %}Pas de playlist connue.{% endif %} +

+ {% endif %} +

N.B. Débordements d'émissions et autres manifestations radiophoniques spontanées peuvent amener cette liste à ne pas être -- 2.39.2