Commit ddcad4b4 authored by fred's avatar fred

also list recent changes in newsitems and soundfiles on homepage

parent b096b066
......@@ -116,6 +116,30 @@ Aucune actu.
{% endfor %}
</ul>
<h3>Actus récemment édités</h3>
<ul class="episode-list">
{% for newsitem in recent_newsitems|slice:":20" %}
<li>{{ newsitem.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
{% endfor %}
</ul>
<h3>Sons récemment édités</h3>
<ul class="episode-list">
{% for soundfile in recent_soundfiles|slice:":20" %}
<li>{{ soundfile.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'emission-view' slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.emission.title }}</a> /
<a href="{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.title }}</a>
{% if soundfile.fragment %} ({{soundfile.title}}){% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
......
......@@ -25,6 +25,10 @@ class Home(TemplateView):
context['focused_items'] = Focus.objects.select_related().filter(current=True)
context['recent_episodes'] = Episode.objects.select_related(
).order_by('-last_update_timestamp')
context['recent_newsitems'] = NewsItem.objects.select_related(
).order_by('-last_update_timestamp')
context['recent_soundfiles'] = SoundFile.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