Commit fb504721 authored by fred's avatar fred

update to reflect the change from newsitem datetime to a simple date

parent 4dba776c
......@@ -68,7 +68,7 @@ class EmissionDetailView(DetailView, EmissionMixin):
context = super(EmissionDetailView, self).get_context_data(**kwargs)
context['sectionName'] = "Emissions"
context['schedules'] = Schedule.objects.select_related().filter(emission=self.object).order_by('datetime')
context['news'] = NewsItem.objects.all().filter(emission=self.object.id).order_by('-datetime')[:3]
context['news'] = NewsItem.objects.all().filter(emission=self.object.id).order_by('-date')[:3]
context.update(self.get_emission_context(self.object))
return context
emission = EmissionDetailView.as_view()
......@@ -376,7 +376,7 @@ class Home(TemplateView):
def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs)
context['sectionName'] = "Home"
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:5])
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[0:5])
context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title'))
schedules = Schedule.objects.select_related().order_by('datetime')
days = []
......@@ -415,7 +415,7 @@ class NewsItemView(DetailView):
def get_context_data(self, **kwargs):
context = super(NewsItemView, self).get_context_data(**kwargs)
context['sectionName'] = "News"
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9])
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[0:9])
context['categories'] = NewsCategory.objects.all()
return context
newsitemview = NewsItemView.as_view()
......@@ -425,8 +425,8 @@ class News(TemplateView):
def get_context_data(self, **kwargs):
context = super(News, self).get_context_data(**kwargs)
context['sectionName'] = "News"
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9])
context['news'] = list(NewsItem.objects.all().exclude(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[3:45])
context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[0:9])
context['news'] = list(NewsItem.objects.all().exclude(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[3:45])
context['categories'] = NewsCategory.objects.all()
return context
......@@ -437,8 +437,8 @@ class NewsArchives(TemplateView):
def get_context_data(self, **kwargs):
context = super(NewsArchives, self).get_context_data(**kwargs)
context['sectionName'] = "News"
context['focus'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:6])
context['news'] = list(NewsItem.objects.all().order_by('-datetime')[0:600])
context['focus'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-date')[0:6])
context['news'] = list(NewsItem.objects.all().order_by('-date')[0:600])
context['categories'] = NewsCategory.objects.all()
return context
......
......@@ -7,8 +7,8 @@
<div class="wrapper text">
<div class="leftPart">
<header>
{% if newsitem.datetime %}
<div class="date cf center label">{{ newsitem.datetime|date:"D m/M" }}</div>
{% if newsitem.date %}
<div class="date cf center label">{{ newsitem.date|date:"D m/M" }}</div>
{% endif %}
<h3 class="squashed title">
{{ newsitem.title }}
......
......@@ -40,7 +40,7 @@
{% for NewsItem in newsAll %}
<li class="item ellipsis small ">
<a href="{% url 'news-view' slug=NewsItem.slug %}">
<span class="title"><strong>{{ NewsItem.datetime|date:"D m/M" }}</strong>&nbsp;-&nbsp;{{ NewsItem.title }}</span>
<span class="title"><strong>{{ NewsItem.date|date:"D m/M" }}</strong>&nbsp;-&nbsp;{{ NewsItem.title }}</span>
</a>
</li>
{% endfor %}
......
......@@ -9,8 +9,8 @@
{% else %}
<img class="logo left" width="60" height="60" src="{% static "img/defaultLogo.png" %}"/>
{% endif %}
{% if content.datetime %}
<div class="smooth {% if class == "special" %}center marged {% endif %}">{{ content.datetime|date:"D m/M"|lower }}</div>
{% if content.date %}
<div class="smooth {% if class == "special" %}center marged {% endif %}">{{ content.date|date:"D m/M"|lower }}</div>
{% endif %}
<div class="content">
<h5 class="title {% if not class %}ellipsis{% endif %}">{{ content.title }}</h5>
......
......@@ -10,7 +10,7 @@
<a title="{{content.title|striptags|addslashes}}" class="block news relative" href="{% url 'news-view' slug=content.slug %}">
{% if content.image %}
<div class="absolute">
<h5 class="title ellipsis">{{ content.datetime|date:"D m/m" }}</h5>
<h5 class="title ellipsis">{{ content.date|date:"D m/m" }}</h5>
</div>
<img class="logo" src="{{ content.image|thumbnail:'240x320' }}"/>
{% endif %}
......
<a href="{% url 'news-view' slug=result.object.slug %}">
<span class="icon-bullhorn" ></span>
<strong>{{ result.object.title }}</strong>
{% if result.object.datetime %}
<div class="smooth">{{ result.object.datetime|date:"D m/M"|lower }}</div>
{% if result.object.date %}
<div class="smooth">{{ result.object.date|date:"D m/M"|lower }}</div>
{% endif %}
</a>
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