Commit d479c141 authored by fred's avatar fred

make nonstop labels into links

parent 750cfe7a
...@@ -184,15 +184,15 @@ class Grid(TemplateView): ...@@ -184,15 +184,15 @@ class Grid(TemplateView):
if nonstop.start < nonstop.end: if nonstop.start < nonstop.end:
nonstops.append([nonstop.start.hour + nonstop.start.minute/60., nonstops.append([nonstop.start.hour + nonstop.start.minute/60.,
nonstop.end.hour + nonstop.end.minute/60., nonstop.end.hour + nonstop.end.minute/60.,
nonstop.title]) nonstop.title, nonstop.slug])
else: else:
# crossing midnight # crossing midnight
nonstops.append([nonstop.start.hour + nonstop.start.minute/60., nonstops.append([nonstop.start.hour + nonstop.start.minute/60.,
24, 24,
nonstop.title]) nonstop.title, nonstop.slug])
nonstops.append([0, nonstops.append([0,
nonstop.end.hour + nonstop.end.minute/60., nonstop.end.hour + nonstop.end.minute/60.,
nonstop.title]) nonstop.title, nonstop.slug])
nonstops.sort() nonstops.sort()
for i in range(nb_lines): for i in range(nb_lines):
...@@ -203,6 +203,7 @@ class Grid(TemplateView): ...@@ -203,6 +203,7 @@ class Grid(TemplateView):
nonstop = [x for x in nonstops if i>=x[0]*2 and i<x[1]*2][0] nonstop = [x for x in nonstops if i>=x[0]*2 and i<x[1]*2][0]
for time_cell in grid[-1]: for time_cell in grid[-1]:
time_cell.nonstop = nonstop[2] time_cell.nonstop = nonstop[2]
time_cell.nonstop_slug = nonstop[3]
if nonstop[1] == 5: if nonstop[1] == 5:
# the one ending at 5am will be cut down, so we inscribe # the one ending at 5am will be cut down, so we inscribe
# its duration manually # its duration manually
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
{% if categories %} {% if categories %}
<nav id="gridNav" class="checkable"> <nav id="gridNav" class="checkable">
<ul class="by{{ categories.count }}"> <ul class="by{{ categories.count }}">
{% if class = "grid" %} {% if class = "emissions" %}
<li><button class="check icon-check-empty" data-about="#Main" data-highlight=".nonstop"></li>
{% elif class = "emissions" %}
<li><button class="check icon-check" data-about="#Main" data-toggle=".nocat">?</button></li> <li><button class="check icon-check" data-about="#Main" data-toggle=".nocat">?</button></li>
{% endif %} {% endif %}
{% for category in categories %} {% for category in categories %}
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<tr> <tr>
<th class="heure">{{ time_header }}</th> <th class="heure">{{ time_header }}</th>
{% for cell in time_cells %} {% for cell in time_cells %}
<td class="small cell {% if cell.schedules|length > 1 %}many {% endif %}{% if cell.schedules %}scheduled{% else %}nonstop{% endif %}" {% if cell.w > 1 %}colspan="{{cell.w}}"{% endif %} <td class="small cell {% if cell.schedules|length > 1 %}many {% endif %}{% if cell.schedules %}scheduled{% else %}nonstop musique-en-continu{% endif %}" {% if cell.w > 1 %}colspan="{{cell.w}}"{% endif %}
{% if cell.h > 1 %}rowspan="{{cell.h}}"{% endif %}> {% if cell.h > 1 %}rowspan="{{cell.h}}"{% endif %}>
{% if cell.time_label %} {% if cell.time_label %}
<div class="time-label">{{ cell.time_label }}</div> <div class="time-label">{{ cell.time_label }}</div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<div class="continu"><strong>{{ cell }}</strong></div> <div class="continu"><strong><a href="{% url 'emission-view' slug=cell.nonstop_slug %}">{{ cell }}</a></strong></div>
{% if cell.w > 1 and cell.h > 1%}<p>la musique en continu</p>{% endif %} {% if cell.w > 1 and cell.h > 1%}<p>la musique en continu</p>{% endif %}
{% endif %} {% endif %}
</td> </td>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
{% else %} {% else %}
<em class="block nonstop ellipsis"> <em class="block nonstop ellipsis">
<strong class="" style="visibility:hidden;">{{ cell.datetime|date:"H:i" }}</strong> <strong class="" style="visibility:hidden;">{{ cell.datetime|date:"H:i" }}</strong>
<span>{{ cell.label }}</span> <span><a href="{% url 'emission-view' slug=cell.slug %}">{{ cell.label }}</a></span>
</em> </em>
{% endif %} {% endif %}
</li> </li>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment