Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Start a quick and dirty goals page (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jul 25, 2012
1 parent 75d23bc commit bde3358
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions www/about/goals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import locale
from gittip import db

^L

ngoals = db.fetchone("SELECT count(id) FROM participants WHERE goal > 0")
ngoals = ngoals['count'] if ngoals is not None else 0
goals = db.fetchall("SELECT id, goal FROM participants WHERE goal > 0 ORDER BY goal DESC")
goals = goals if goals is not None else []

^L

{% extends templates/base.html %}
{% block body %}
<p class="below-header"><a href="./">About</a></p>

<h2>{{ ngoals}} people have set a funding goal.</h2>
<table>
{% for rec in goals %}
<tr>
<th><a href="/{{ rec['id'] }}/">{{ rec['id'] }}</a></th>
<td>{{ locale.format("%.2f", rec['goal'], grouping=True) }}</a></td>
</tr>
{% end %}
</table>
{% end %}

0 comments on commit bde3358

Please sign in to comment.