Commit 75dbe2d4 authored by fred's avatar fred
Browse files

news: also include news without images in the sidebar

parent 819ef0ce
...@@ -433,7 +433,7 @@ class NewsItemView(DetailView): ...@@ -433,7 +433,7 @@ class NewsItemView(DetailView):
context = super(NewsItemView, self).get_context_data(**kwargs) context = super(NewsItemView, self).get_context_data(**kwargs)
context['sectionName'] = "News" context['sectionName'] = "News"
context['categories'] = NewsCategory.objects.all() context['categories'] = NewsCategory.objects.all()
context['news'] = NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[:10] context['news'] = NewsItem.objects.all().order_by('-date')
return context return context
newsitemview = NewsItemView.as_view() newsitemview = NewsItemView.as_view()
...@@ -444,7 +444,7 @@ class News(TemplateView): ...@@ -444,7 +444,7 @@ class News(TemplateView):
context['sectionName'] = "News" context['sectionName'] = "News"
newsitem_ids = [x.newsitem_id for x in Focus.objects.filter(newsitem__isnull=False)] newsitem_ids = [x.newsitem_id for x in Focus.objects.filter(newsitem__isnull=False)]
context['focus'] = NewsItem.objects.filter(id__in=newsitem_ids).select_related('category').order_by('-date')[0:9] context['focus'] = NewsItem.objects.filter(id__in=newsitem_ids).select_related('category').order_by('-date')[0:9]
context['news'] = NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[:30] context['news'] = NewsItem.objects.all().order_by('-date')
return context return context
news = News.as_view() news = News.as_view()
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</form> </form>
<ul class="custom list newsList"> <ul class="custom list newsList">
{% for content in news %} {% for content in news|slice:":10" %}
<li class="{% if content == newsitem %}current{% endif %}">{% news_inline %}</li> <li class="{% if content == newsitem %}current{% endif %}">{% news_inline %}</li>
{% endfor %} {% endfor %}
</ul> </ul>
......
...@@ -53,7 +53,7 @@ principes torquatos, vix ne essent partiendo. ...@@ -53,7 +53,7 @@ principes torquatos, vix ne essent partiendo.
</form> </form>
<ul class="custom list newsList"> <ul class="custom list newsList">
{% for content in news %} {% for content in news|slice:":20" %}
<li class="{% if content == newsitem %}current{% endif %}">{% news_inline %}</li> <li class="{% if content == newsitem %}current{% endif %}">{% news_inline %}</li>
{% endfor %} {% endfor %}
</ul> </ul>
......
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