Merge pull request 'fix #4: survue de programmation de la journee (cfr horaire-check)' (#27) from fix-1.0-4 into develop-1.0
Reviewed-on: #27
This commit is contained in:
commit
95a847cee0
|
@ -30,7 +30,7 @@ class AdminSite(admin.AdminSite):
|
||||||
'programs': Program.objects.active().values('pk', 'title') \
|
'programs': Program.objects.active().values('pk', 'title') \
|
||||||
.order_by('title'),
|
.order_by('title'),
|
||||||
# today's diffusions
|
# today's diffusions
|
||||||
'diffusions': Diffusion.objects.on_air().date().order_by('start') \
|
'diffusions': Diffusion.objects.date().order_by('start') \
|
||||||
.select_related('episode'),
|
.select_related('episode'),
|
||||||
# TODO: only for dashboard
|
# TODO: only for dashboard
|
||||||
# last comments
|
# last comments
|
||||||
|
|
|
@ -252,7 +252,7 @@ class Diffusion(BaseRerun):
|
||||||
return self.type == self.TYPE_ON_AIR and \
|
return self.type == self.TYPE_ON_AIR and \
|
||||||
self.start <= now and self.end >= now
|
self.start <= now and self.end >= now
|
||||||
|
|
||||||
# TODO: property?
|
@property
|
||||||
def is_live(self):
|
def is_live(self):
|
||||||
""" True if Diffusion is live (False if there are sounds files). """
|
""" True if Diffusion is live (False if there are sounds files). """
|
||||||
return self.type == self.TYPE_ON_AIR and \
|
return self.type == self.TYPE_ON_AIR and \
|
||||||
|
|
|
@ -16,7 +16,31 @@
|
||||||
<tr {% if diffusion.is_now %}class="is-selected"{% endif %}>
|
<tr {% if diffusion.is_now %}class="is-selected"{% endif %}>
|
||||||
<td>{{ diffusion.start|time }} - {{ diffusion.end|time }}</td>
|
<td>{{ diffusion.start|time }} - {{ diffusion.end|time }}</td>
|
||||||
<td><img src="{% thumbnail episode.cover 64x64 crop %}"/></td>
|
<td><img src="{% thumbnail episode.cover 64x64 crop %}"/></td>
|
||||||
<td><a href="{% url "admin:aircox_episode_change" episode.pk %}">{{ episode.title }}</a></td>
|
<td>
|
||||||
|
<a href="{% url "admin:aircox_episode_change" episode.pk %}">{{ episode.title }}</a>
|
||||||
|
|
||||||
|
{% if diffusion.type == diffusion.TYPE_ON_AIR %}
|
||||||
|
<span class="tag is-info">
|
||||||
|
<span class="icon is-small">
|
||||||
|
{% if diffusion.is_live %}
|
||||||
|
<i class="fa fa-microphone"
|
||||||
|
title="{% trans "Live diffusion" %}"></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="fa fa-music"
|
||||||
|
title="{% trans "Differed diffusion" %}"></i>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{{ diffusion.get_type_display }}
|
||||||
|
</span>
|
||||||
|
{% elif diffusion.type == diffusion.TYPE_CANCEL %}
|
||||||
|
<span class="tag is-danger">
|
||||||
|
{{ diffusion.get_type_display }}</span>
|
||||||
|
{% elif diffusion.type == diffusion.TYPE_UNCONFIRMED %}
|
||||||
|
<span class="tag is-warning">
|
||||||
|
{{ diffusion.get_type_display }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user