From 9ec1bbe85a7627d4c838243e83d16141fc804c8b Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Mon, 4 Oct 2010 11:27:04 -0400 Subject: [PATCH] Corrected front page code and template so that blog posts appear. --- www/conservancy/frontpage.py | 3 +++ www/conservancy/templates/frontpage.html | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/www/conservancy/frontpage.py b/www/conservancy/frontpage.py index 269faf61..a35ddeb0 100644 --- a/www/conservancy/frontpage.py +++ b/www/conservancy/frontpage.py @@ -1,5 +1,6 @@ from django.shortcuts import render_to_response from conservancy.apps.news.models import PressRelease +from conservancy.apps.blog.models import Entry as BlogEntry from datetime import datetime, timedelta def view(request): @@ -9,8 +10,10 @@ def view(request): """ press_releases = PressRelease.objects.all().filter(pub_date__lte=datetime.now(), sites=2)[:5] + blog = BlogEntry.objects.all().filter(pub_date__lte=datetime.now())[:3] c = { 'press_releases': press_releases, + 'blog' : blog } return render_to_response("frontpage.html", c) diff --git a/www/conservancy/templates/frontpage.html b/www/conservancy/templates/frontpage.html index 2b1498b1..f6234231 100644 --- a/www/conservancy/templates/frontpage.html +++ b/www/conservancy/templates/frontpage.html @@ -46,7 +46,8 @@ {% if press_releases.0.body %}

Read More...

{% endif %} {% endif %} -

Conservancy News Archive…

+

Conservancy News + Archive…

{% if blog.0.is_recent %}

[RSS] Conservancy Blog