Files @ a80c95fd136e
Branch filter:

Location: website/www/conservancy/sponsors.py

Bradley M. Kuhn
Fix minimal start of ourcoverage.html and correct various problems

ourcoverage.html was a reasonable minimal start but not really ready
for production. Make changes necessary to put this into production,
as follows:

* Rename ourcoverage.html to vizio-coverage.html. This is just
Vizio coverage for now.

* Order articles by most in-depth/interesting. Verified this
ordering by consensus with Conservancy staff.

* mailto: link for press coverage on the main inthenews page, but
don't use that on Vizio page; it's unlikely we'll miss any of the
Vizio coverage.

* use — instead of -

* put quotes around article titles.

* Add missing PR Web article

* Switch from <p>'s to <li>'s in vizio-coverage.html

* Fix menu issues. 09a4b02 outlined the issues regarding how to
add items to menu; it does require a CSS change as explained
therein; merely using the right `base_` is not enough

* Improve menu integration. Per PR people's recommendation, the
Vizio stuff that also goes in other areas needs to be placed in
multiple menus.
from django.shortcuts import render
from conservancy.apps.supporters.models import Supporter as Supporter
from datetime import datetime, timedelta

def view(request):
    """Conservancy Sponsors Page view

    Performs object queries necessary to render the sponsors page.
    """

    supporters = Supporter.objects.all().filter(display_until_date__gte=datetime.now())
    supporters_count = len(supporters)
    anonymous_count  = len(supporters.filter(display_name = 'Anonymous'))
    supporters = supporters.exclude(display_name = 'Anonymous').order_by('ledger_entity_id')

    c = {
        'supporters' : supporters,
        'supporters_count' : supporters_count,
        'anonymous_count' : anonymous_count
    }
    return render(request, "sponsors.html", c)