This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start a quick and dirty goals page (#142)
- Loading branch information
1 parent
75d23bc
commit bde3358
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |