From 3c543b357eec27c32f91aee06527e5270d98975e Mon Sep 17 00:00:00 2001
From: "Jonathan S. Katz"
Date: Tue, 20 Aug 2013 23:14:21 -0400
Subject: [PATCH] List 5 events on homepage; move navigation / RSS feed links
for events above "Upcoming Training"
List 5 events on homepage; move navigation / RSS feed links for events above "Upcoming Training"
To maintain the balance of the end columns, this patch also extends the list of
News articles and Planet postings to 7
---
pgweb/core/views.py | 6 +++---
templates/index.html | 28 ++++++++++++++--------------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/pgweb/core/views.py b/pgweb/core/views.py
index 9a5c670d..488afb88 100644
--- a/pgweb/core/views.py
+++ b/pgweb/core/views.py
@@ -36,15 +36,15 @@ from django.template.context import RequestContext
# Front page view
@cache(minutes=10)
def home(request):
- news = NewsArticle.objects.filter(approved=True)[:5]
- events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today).order_by('enddate', 'startdate')[:3]
+ news = NewsArticle.objects.filter(approved=True)[:7]
+ events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today).order_by('enddate', 'startdate')[:5]
try:
quote = Quote.objects.filter(approved=True).order_by('?')[0]
except:
# if there is no quote available, just ignore error
quote = None
versions = Version.objects.filter(supported=True)
- planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:5]
+ planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:7]
traininginfo = Event.objects.filter(approved=True, training=True).extra(where=("startdate <= (CURRENT_DATE + '6 Months'::interval) AND enddate >= CURRENT_DATE",)).aggregate(Count('id'), Count('country', distinct=True))
# can't figure out how to make django do this
diff --git a/templates/index.html b/templates/index.html
index 06a62bce..76868e52 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -150,6 +150,20 @@
{% endfor %}
+
+

+
+
@@ -170,20 +184,6 @@
There are no training events currently scheduled.
{%endif%}
-
-

-
-