Commit a64b70e2 authored by Simon Daron's avatar Simon Daron

News view with navigation model

parent f5a039b5
......@@ -441,7 +441,8 @@ class News(TemplateView):
def get_context_data(self, **kwargs):
context = super(News, self).get_context_data(**kwargs)
context['sectionName'] = "News"
context['news'] = NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[:14]
context['focus'] = list(NewsItem.objects.select_related('category').filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[0:9])
context['news'] = NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[:30]
return context
news = News.as_view()
......
......@@ -5,29 +5,46 @@
{% news_nav %}
{% endblock %}
{% block main %}
<div class="news">
{% with news|slice:"0:3" as news %}
<div class="wrapper">
<ul class="custom columns news newsSpecial cf by3">
{% for content in news %}
<li class="item">
{% news_inline klass="special"%}
</li>
{% endfor %}
</ul>
</div>
{% endwith %}
{% with news|slice:"3:" as news %}
<div class="wrapper">
<ul class="custom columns list news cf">
{% for content in news %}
<li class="item">
{% news_inline%}
</li>
{% endfor %}
</ul>
<div class="detail marged news cf">
<div class="wrapper navigation">
<div class="leftPart">
<div class="news">
<h5 class="sectionLabel">Focus</h5>
{% with focus as news %}
<ul class="custom columns cf padded">
{% for content in news %}
<li class="">
{% news_inline klass="special"%}
</li>
{% endfor %}
</ul>
{% endwith %}
</div>
</div>
<div class="rightPart">
<div class="sub">
{% if newsitem.emission %}
<h5 class="sectionLabel">proposé par</h5>
{% with newsitem.emission as emission %}
<div class="">{% emission_resume %}</div>
{% endwith %}
{% endif %}
<h5 class="sectionLabel right">
<a href="{% url 'newsArchives' %}">
<span class="iconLabel">Toutes</span>
</a>
</h5>
<h5 class="sectionLabel">
<span class="iconLabel">Dernières actus</span>
</h5>
<ul class="custom list newsList">
{% for content in news %}
<li class="{% if content == newsitem %}current{% endif %}">{% news_inline %}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endwith %}
</div>
{% endblock %}
{% block links %}
......
......@@ -4,7 +4,7 @@
<a class="block cf" href="{% url 'newsitem-view' slug=content.slug %}">
<div class="logo">
{% if class == "special" and content.image %}
<img class="nomal" src="{{ content.image|thumbnail:'320x240' }}"/>
<img class="normal" src="{{ content.image|thumbnail:'640x480' }}"/>
{% elif content.image %}
<img class="left" src="{{ content.image|thumbnail:'60x60' }}"/>
{% else %}
......
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