Commit aa544137 authored by fred's avatar fred

display recently edited episodes on homepage

parent c7507e67
......@@ -105,6 +105,17 @@ Aucune actu.
{% endfor %}
</ul>
<h3>Épisodes récemment édités</h3>
<ul class="episode-list">
{% for episode in recent_episodes|slice:":10" %}
<li>{{ episode.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'emission-view' slug=episode.emission.slug %}">{{ episode.emission.title }}</a> /
<a href="{% url 'episode-view' slug=episode.slug emission_slug=episode.emission.slug %}">{{ episode.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
......
......@@ -23,6 +23,8 @@ class Home(TemplateView):
context['news_categories'] = self.request.user.news_categories.all().order_by('title')
if self.request.user.has_perm('emissions.add_focus'):
context['focused_items'] = Focus.objects.select_related().filter(current=True)
context['recent_episodes'] = Episode.objects.select_related(
).order_by('-last_update_timestamp')
return context
......
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