Files @ 1032f1d75f33
Branch filter:

Location: website/www/conservancy/frontpage.py

bkuhn
sfconservancy.org now has an SSL certificate; make site HTTPS-Everywhere compatible.

Change all links when possible to not mention a site, so HTTPS will be used
automatically for same-site links.

For embedded images, and other links out to the rest of the world, use HTTPS
when the site is known to support it.
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):
    """Conservancy front page view

    Performs all object queries necessary to render the front page.
    """

    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)