Changeset - 462cbc396354
[Not reviewed]
0 2 5
Bradley Kuhn (bkuhn) - 9 years ago 2015-01-03 14:53:12
bkuhn@ebb.org
Supporters list built dynamically.

Hitherto the supporters list has been committed directly to the static
sponsors/index.html file. This was never ideal and a quick hack to
build Conservancy's supporters list at the beginning of the supporters
program.

With this change, a Django app now exists that dynamically generates the
supporters list.

The database rows must be built from Conservancy's internal Ledger file,
which will be done in a separate script.
7 files changed with 49 insertions and 55 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/supporters/__init__.py
Show inline comments
 
new file 100644
www/conservancy/apps/supporters/admin.py
Show inline comments
 
new file 100644
 
from django.contrib import admin
 
from models import Supporter
 

	
 
class SupporterAdmin(admin.ModelAdmin):
 
    list_display = ('display_name', 'display_until_date')
 

	
 
admin.site.register(Supporter, SupporterAdmin)
www/conservancy/apps/supporters/models.py
Show inline comments
 
new file 100644
 
from django.db import models
 

	
 
class Supporter(models.Model):
 
    """Conservancy Supporter listing"""
 

	
 
    display_name = models.CharField(max_length=200, blank=False)
 
    display_until_date = models.DateTimeField("date until which this supporter name is displayed")
 
    ledger_entity_id = models.CharField(max_length=200, blank=False)
 

	
 
    def test(self):
 
        return "TESTING"
 
    def __unicode__(self):
 
        return self.display_name
 

	
 
    class Meta:
 
        ordering = ('-ledger_entity_id',)
www/conservancy/apps/supporters/views.py
Show inline comments
 
new file 100644
 
from models import Supporter # relative import
 
from django.views.generic.list_detail import object_list
 
from django.shortcuts import get_object_or_404, render_to_response
 

	
www/conservancy/sponsors.py
Show inline comments
 
new file 100644
 
from django.shortcuts import render_to_response
 
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())
 

	
 
    c = {
 
        'supporters' : supporters
 
    }
 
    return render_to_response("sponsors.html", c)
www/conservancy/templates/sponsors.html
Show inline comments
 
{% extends "base_conservancy.html" %}
 
{% block subtitle %}Sponsors - {% endblock %}
 
{% block category %}sponsors{% endblock %}
 
{% block head %}
 
<meta charset="UTF-8"/>
 
{% endblock %}
 

	
 
{% block content %}
 

	
 
<h1>Conservancy's Sponsors &amp; Supporters</h1>
 

	
 
<p>Conservancy relies on donations from the general public to support its
 
work, and asks everyone <a href="/donate">to donate generously</a>.
 

	
 
<h2>Sponsors</h2>
 

	
 
<p>The sponsors whose logos are listed below (in alphabetical order) have donated
 
substantially in the past twelve months to support the ongoing work of
 
Conservancy.  These sponsors support our work through financial
 
contributions.  Conservancy graciously thanks these sponsors for their
 
support, but doesn't necessarily endorse nor promote any specific activity of
 
any of its sponsors.</p>
 

	
 
<ul id="sponsor">
 
<li><a href="http://appendto.com/"><img src="/img/sponsors/appendTo.png" height="75" width="200" alt="appendTo" /></a></li>
 
<li><a href="http://www.blackducksoftware.com/"><img src="/img/sponsors/black-duck.jpg" height="51" width="230" alt="Black Duck" /></a></li>
 
<li><a href="http://www.citrix.com/"><img src="/img/sponsors/citrix.png" height="79" width="250" alt="Citrix" /></a></li>
 
<li><a href="http://gandi.net"><img src="/img/sponsors/gandi.png" height="65" width="171" alt="Gandi.Net" /></a></li>
 
<li><a href="http://google.com"><img src="/img/sponsors/google.png" height="76" width="238" alt="Google" /></a></li>
 
<li><a href="http://www.hp.com/"><img src="/img/sponsors/hp.png" height="75" width="75" alt="HP" /></a></li>
 
<li><a href="http://linuxfoundation.org"><img src="/img/sponsors/linuxfoundation.png" height="76" width="250" alt="Linux Foundation" /></a></li>
 
<li><a href="https://github.com/davidmarin"><img src="/img/sponsors/marin-halpin.png" height="80" width="250" alt="David Marin and Amanda Halpin" /></a></li>
 
<li><a href="https://www.mozilla.org/foundation/"><img src="/img/sponsors/mozilla.png" height="101" width="250" alt="Mozilla Foundation" /></a></li>
 
<li><a href="https://www.privateinternetaccess.com/"><img src="/img/sponsors/privateinternetaccess.jpg" height="52" width="220" alt="Private Internet Access" /></a></li>
 
<li><a href="https://www.redhat.com/"><img src="/img/sponsors/redhat.png" height="80" width="250" alt="Red Hat" /></a></li>
 
<li><a href="https://www.samsung.com/"><img src="/img/sponsors/samsung.jpg" height="83" width="250" alt="Samsung" /></a></li>
 
</ul>
 

	
 
<!-- This section will be added when we have in-kind contributions -->
 

	
 
<!-- <h3>In-Kind Donation of Services</h3> -->
 

	
 
<!-- <p>Conservancy would also like to thank the following companies who have -->
 
<!--   donated services and/or resources in-kind to support Conservancy's -->
 
<!--   work.</p> -->
 

	
 
<!-- <ul> -->
 
<!-- </ul> -->
 
<br/>
 
<hr/>
 
<br/>
 
<h2>Supporters</h2>
 

	
 
<p>Conservancy Supporters are individuals who give $120 or more annually as
 
  part of <a href="/supporter/">the Official Conservancy Supporter
 
  program</a>.  Those who request public acknowledgment are listed here in
 
  alphabetical order by surname:</p>
 

	
 
<a id="supporters"></a>
 
   
 
<ul id="supporters">
 
  <li>Aleph Objects, Inc.</li>
 
  <li>Russ Allbery</li>
 
  <li>Jeremy Allison</li>
 
  <li>Christopher Aniszczyk</li>
 
  <li>Anonymous (3 people)</li>
 
  <li>Martin Ansdell-Smith</li>
 
  <li>David Ayers</li>
 
  <li>Jono Bacon</li>
 
  <li>Daniel Callahan</li>
 
  <li>Alison Chaiken</li>
 
  <li>Matthew Daniel</li>
 
  <li>Mark Cohen</li>
 
  <li>Michael Dexter</li>
 
  <li>Aurimas Fiseras</li>
 
  <li>Karl Fogel</li>
 
  <li>Richard Fontana</li>
 
  <li>Timothy Freund</li>
 
  <li>Philippe Gauthier</li>
 
  <li>Scott González</li>
 
  <li>Jared Grubb</li>
 
  <li>Steven Hamilton</li>
 
  <li>Edgar Hill</li>
 
  <li>Karl Ove Hufthammer</li>
 
  <li>Henrik Ingo</li>
 
  <li>maiki interi</li>
 
  <li>Ian Kelling</li>
 
  <li>Tom Kent</li>
 
  <li>Matt Kraai</li>
 
  <li>Johannes Krampf</li>
 
  <li>Cathy Kuhn</li>
 
  <li>Janet Shade Kuhn</li>
 
  <li>Michael Linksvayer</li>
 
  <li>Tom Marble</li>
 
  <li>Darin Miller</li>
 
  <li>Michael Miller</li>
 
  <li>Martin Michlmayr</li>
 
  <li>Pariksheet Nanda</li>
 
  <li>Deborah A. Nicholson</li>
 
  <li>Samuel and Cristine Noble</li>
 
  <li>Donald Robertson</li>
 
  <li>Ivan Sandler</li>
 
  <li>Prabowo Saputro</li>
 
  <li>Christopher Schafer</li>
 
  <li>Richard Schmeidler</li>
 
  <li>Mats Sjöberg</li>
 
  <li>W. John Sullivan</li>
 
  <li>David &rsquo;novalis&rdquo; Turner</li>
 
  <li>Kat Walsh</li>
 
  <li>Christopher Allan Webber</li>
 
  <li>Richard Wheeler</li>
 
  <li>Mark Wielaard</li>
 
  <li>Serge Wroclawski</li>
 
  <li>Seymour Zucker</li>
 
  <li>立思科技藝術有限公司</li>
 
{% for ss in supporters %}
 
<li>{{ ss.display_name|safe }}</li>
 
{% endfor %}
 
</ul>
 

	
 
{% endblock %}
www/conservancy/urls.py
Show inline comments
 
# Copyright 2005-2008, James Garrison
 
# Copyright 2010, 2012 Bradley M. Kuhn
 

	
 
# This software's license gives you freedom; you can copy, convey,
 
# propagate, redistribute, modify and/or redistribute modified versions of
 
# this program under the terms of the GNU Affero General Public License
 
# (AGPL) as published by the Free Software Foundation (FSF), either
 
# version 3 of the License, or (at your option) any later version of the
 
# AGPL published by the FSF.
 
#
 
# This program is distributed in the hope that it will be useful, but
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
 
# General Public License for more details.
 
#
 
# You should have received a copy of the GNU Affero General Public License
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf.urls.defaults import *
 
from django.contrib import admin
 
from conservancy.feeds import BlogFeed, PressReleaseFeed, OmnibusFeed
 

	
 
handler404 = 'modpythoncustom.view404'
 

	
 
admin.autodiscover()
 

	
 
urlpatterns = patterns('',
 
    (r'^$', 'conservancy.frontpage.view'),
 
    (r'^sponsors$', 'conservancy.frontpage.view'),
 
    (r'^sponsors/$', 'conservancy.sponsors.view'),
 
    (r'^sponsors/index.html$', 'conservancy.sponsors.view'),
 
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
    (r'^admin/', admin.site.urls),
 
    (r'^feeds/blog/?$', BlogFeed()),
 
    (r'^feeds/news/?$', PressReleaseFeed()),
 
    (r'^feeds/omnibus/?$', OmnibusFeed()),
 
    (r'^feeds/?$', 'conservancy.feeds.view'),
 
    (r'^news(/|$)', include('conservancy.apps.news.urls')),
 
    (r'^blog(/|$)', include('conservancy.apps.blog.urls')),
 
)
0 comments (0 inline, 0 general)