Corrected front page code and template so that blog posts appear.

This commit is contained in:
Bradley M. Kuhn 2010-10-04 11:27:04 -04:00
parent c144b0c54e
commit 9ec1bbe85a
2 changed files with 5 additions and 1 deletions

View file

@ -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)

View file

@ -46,7 +46,8 @@
{% if press_releases.0.body %}<p><span class="continued"><a href="{{ press_releases.0.get_absolute_url }}">Read More...</a></span></p>{% endif %}
</div>
{% endif %}
<p><span class="continued"><a href="/news/">Conservancy News Archive&hellip;</a></p>
<p><span class="continued"><a href="/news/">Conservancy News
Archive&hellip;</a></p>
{% if blog.0.is_recent %}
<h2><a href="/feeds/blog/" class="feedlink"><img src="/img/feed-icon-14x14.png" alt="[RSS]"/></a> <a href="/blog/">Conservancy Blog</a></h2>
<div class="shaded">