Commit 2a780882 authored by fred's avatar fred

home: add recent newsitems

parent 7cd3dec0
......@@ -410,6 +410,7 @@ class Home(TemplateView):
'soundfile', 'episode', 'newsitem__category').order_by('?')[:12]
context['emissions'] = Emission.objects.filter(archived=False,
creation_timestamp__gte=datetime(2013, 9, 13)).order_by('title')
context['newsitems'] = NewsItem.objects.order_by('-date')[:3]
context['soundfiles'] = SoundFile.objects.prefetch_related('episode__emission__categories').filter(
podcastable=True, fragment=False) \
......
......@@ -30,6 +30,21 @@
{% with focus as news %}
{% newsroll %}
{% endwith %}
{% if newsitems %}
<div id="recent-news">
<h3 class="sectionLabel right"><a href="{% url 'news' %}">Toutes</a></h3>
<h3 class="sectionLabel">Dernières actus&nbsp;<a class="button icon-rss inBlock" href="{% url 'atom-feed' %}"></a></h3>
<ul class="custom list">
{% for content in newsitems %}
<li class="item">{% news_inline %}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if soundfiles %}
<div id="recent-sounds">
......
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