Commit 69e217c6 authored by Simon Daron's avatar Simon Daron

Actu & future episodes

parent 140b7a73
......@@ -68,7 +68,7 @@ class EmissionDetailView(DetailView, EmissionMixin):
context = super(EmissionDetailView, self).get_context_data(**kwargs)
context['sectionName'] = "Emissions"
context['schedules'] = Schedule.objects.select_related().filter(emission=self.object).order_by('datetime')
context['news'] = NewsItem.objects.all().filter(emission=self.object.id)
context['news'] = NewsItem.objects.all().filter(emission=self.object.id).order_by('-datetime')[:3]
context.update(self.get_emission_context(self.object))
return context
emission = EmissionDetailView.as_view()
......
......@@ -162,7 +162,7 @@ $(function() {
$(this).trigger('activate');
}else{$(this).trigger('deactivate');}
return false;
}).trigger('activate');
});
$("#DirectStreamPanikControler").on('click',function(e) {
e.preventDefault();
var stream = $('#DirectStreamPanik').get(0);
......
......@@ -29,7 +29,7 @@
{% endif %}
{% if futurEpisodes %}
<div>
<h5 class="sectionLabel marged">Prochains épisodes</h5>
<h5 class="sectionLabel marged">Bientôt</h5>
{% for episode in futurEpisodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume date="daytime" %}
......@@ -38,17 +38,15 @@
{% endif %}
{% if episodes %}
<div>
<h5 class="sectionLabel marged">Derniers épisodes</h5>
<h5 class="sectionLabel marged">Dernier épisode</h5>
{% with episodes|slice:"0:1" as episodes %}
{% for episode in episodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume date="daytime" %}
{% endfor %}
{% endwith %}
{% with episodes|slice:"1:1" as episodes %}
{% for episode in episodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume model="inline" date="daytime" %}
{% if futurEpisodes %}
{% episode_resume model="inline" date="daytime" %}
{% else %}
{% episode_resume date="daytime" %}
{% endif %}
{% endfor %}
{% endwith %}
</div>
......
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