]> git.0d.be Git - panikweb.git/commitdiff
include nonstop playlist links in week view
authorFrédéric Péters <fpeters@0d.be>
Thu, 22 Dec 2016 15:34:39 +0000 (16:34 +0100)
committerFrédéric Péters <fpeters@0d.be>
Thu, 22 Dec 2016 15:34:39 +0000 (16:34 +0100)
panikweb/views.py
panikweb_templates/static/css/specifics.css
panikweb_templates/templates/includes/week.html
panikweb_templates/templates/nonstop_playlist.html

index a95d7e535d73514115492e54174d1bb792e1f0f7..04cfafa7e6e1fdbd006bfa2c1c85b51fd9572968 100644 (file)
@@ -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(
index 3171c2f47c25746e4ab05f4501a29c9af30e7266..6d546f1eb7c84822aba05ab0be6f76742c5760ef 100644 (file)
@@ -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%;
+}
index dac2054e7a5864b0aecec647ea1e254204df3ac7..2ad14dd9051c59c07cbfb335f011bdd03999325f 100644 (file)
@@ -13,7 +13,7 @@
                                {% 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>
index 4c44757978a0c91b0660d494c337f654ccf76d74..61f046479bcc440f2e874b0ca8e10e71a0ad5c58 100644 (file)
                {% 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