Changeset - e45322d3c93e
[Not reviewed]
0 4 0
Bradley Kuhn (bkuhn) - 9 years ago 2015-01-03 15:02:02
bkuhn@ebb.org
Place Supporters counter on front & sponsors pages

The number of current supporters now appears on the frontpage and the
sponsors page.
4 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
www/conservancy/frontpage.py
Show inline comments
 
from django.shortcuts import render_to_response
 
from conservancy.apps.supporters.models import Supporter as Supporter
 
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.
 
    """
 

	
 
    supporters_count = len(Supporter.objects.all().filter(display_until_date__gte=datetime.now()))
 
    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,
 
        'supporters_count': supporters_count,
 
        'blog' : blog
 
    }
 
    return render_to_response("frontpage.html", c)
www/conservancy/sponsors.py
Show inline comments
 
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())
 
    supporters_count = len(supporters)
 
    anonymous_count  = len(supporters.filter(display_name = 'Anonymous'))
 
    supporters = supporters.exclude(display_name = 'Anonymous')
 

	
 
    c = {
 
        'supporters' : supporters,
 
        'supporters_count' : supporters_count,
 
        'anonymous_count' : anonymous_count
 
    }
 
    return render_to_response("sponsors.html", c)
www/conservancy/templates/frontpage.html
Show inline comments
 
{% extends "base_conservancy.html" %}
 
{% load date_within %}
 

	
 
{% block head %}
 
<link rel="alternate" type="application/rss+xml" title="Software Freedom Conservancy Complete Feed" href="/feeds/omnibus/" />
 
<link rel="alternate" type="application/rss+xml" title="Software Freedom Conservancy News" href="/feeds/news/" />
 
<link rel="alternate" type="application/rss+xml" title="Software Freedom Conservancy Blogs" href="/feeds/blog/" />
 
{% endblock %}
 

	
 
{% block content %}
 

	
 
<div class="singleColumn">
 

	
 
<h1>Software Freedom Conservancy</h1>
 

	
 
<p>Software Freedom Conservancy is a not-for-profit organization that
 
  helps promote, improve, develop, and defend Free, Libre, and Open Source
 
  Software (FLOSS) projects.  Conservancy provides a non-profit home and
 
  infrastructure for FLOSS projects.  This allows FLOSS developers to
 
  focus on what they do best &mdash; writing and improving FLOSS for the
 
  general public &mdash; while Conservancy takes care of the projects' needs that
 
  do not relate directly to software development and documentation.</p>
 
</div>
 

	
 
<div class="columns">
 

	
 
<div class="column column-small column-left">
 
<h2>Learn More about Conservancy</h2>
 
<p>
 
<span class="continued"><a href="/overview/">An Overview of Conservancy&hellip;</a></span>
 
<span class="continued"><a href="/members/current/">Conservancy's current member projects&hellip;</a></span>
 
<span class="continued"><a href="/members/services/">Services Conservancy provides to its member projects&hellip;</a></span>
 
<span class="continued"><a href="/npoacct/">Conservancy's Non-Profit Accounting Project &hellip;</a></span>
 
<span class="continued"><a href="https://copyleft.org/">Conservancy's copyleft.org project &hellip;</a></span>
 
</p>
 
<h2>Support Conservancy</h2>
 
<p>As a 501(c)(3) non-profit organization, Conservancy relies on
 
  charitable donations for its operations.
 
  Please <a href="/supporter/"><strong>become a Conservancy support
 
  Please join {{supporters_count|safe}} others and <a href="/supporter/"><strong>become a Conservancy support
 
  today</strong></a> and/or <a href="/donate/">donate generously</a> to help our work!
 
</p>
 
<h2>Follow Conservancy News &amp; Blogs</h2>
 

	
 
<p>There is a <a href="/feeds/omnibus/">full site feed available</a> (as
 
  well as separate feeds for the <a href="/feeds/news/">news items</a> and
 
  <a href="/feeds/blog/">blog posts</a>).  You can follow Conservancy
 
 on <a href="https://identi.ca/conservancy">identi.ca</a>
 
 and <a href="https://twitter.com/conservancy">twitter</a>.</p>
 

	
 
<p>
 
    <span id="subbox">
 
        <form method="post" action="https://lists.sfconservancy.org/mailman/subscribe/announce">
 
          You can also subscribe to Conservancy's low-traffic email announce list <br/><input name="email" placeholder="person@example.org"/><input type="submit" name="email-button" value="Subscribe"/>
 
        </form>
 
      </span></p>
 

	
 
</div>
 

	
 
<div class="column column-large">
 
{% if press_releases.0 %}
 
{% if press_releases.0.pub_date|date_within_past_days:60 %}
 
<div class="shaded">
 
<h2><a href="/feeds/news/" class="feedlink"><img src="/img/feed-icon-14x14.png" alt="[RSS]"/></a> <a href="/news/">Recent News</a></h2>
 
<p class="date">{{ press_releases.0.pub_date|date:"F j, Y" }}</p>
 
<h3><a href="{{ press_releases.0.get_absolute_url }}">{{ press_releases.0.headline|safe }}</a></h3>
 
{{ press_releases.0.summary|safe }}
 
{% if press_releases.0.body %}<p><span class="continued"><a href="{{ press_releases.0.get_absolute_url }}">Read More...</a></span></p>{% endif %}
 
{% if press_releases.1 %}
 
{% if press_releases.1.pub_date|date_within_past_days:30 %}
 
<hr/>
 
<p class="date">{{ press_releases.1.pub_date|date:"F j, Y" }}</p>
 
<h3><a href="{{ press_releases.1.get_absolute_url }}">{{ press_releases.1.headline|safe }}</a></h3>
 
{{ press_releases.1.summary|safe }}
 
{% if press_releases.1.body %}<p><span class="continued"><a href="{{ press_releases.1.get_absolute_url }}">Read More...</a></span></p>{% endif %}
 
{% endif %}
 
{% endif %}
 
{% if press_releases.2 %}
 
{% if press_releases.2.pub_date|date_within_past_days:25 %}
 
<hr/>
 
<p class="date">{{ press_releases.2.pub_date|date:"F j, Y" }}</p>
 
<h3><a href="{{ press_releases.2.get_absolute_url }}">{{ press_releases.2.headline|safe }}</a></h3>
 
{{ press_releases.2.summary|safe }}
 
{% if press_releases.2.body %}<p><span class="continued"><a href="{{ press_releases.2.get_absolute_url }}">Read More...</a></span></p>{% endif %}
 
{% endif %}
 
{% endif %}
 
</div>
 
{% endif %}
www/conservancy/templates/sponsors.html
Show inline comments
...
 
@@ -6,62 +6,63 @@
 
{% 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
 
<p>Conservancy currently has {{supporters_count|safe}} Supporters.
 
  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>Anonymous ({{anonymous_count|safe}} people)</li>
 
{% for ss in supporters %}
 
<li>{{ ss.display_name|safe }}</li>
 
{% endfor %}
 
</ul>
 

	
 
{% endblock %}
0 comments (0 inline, 0 general)