Improve admin page

This commit is contained in:
Drew DeVault 2016-07-04 16:20:04 -04:00
parent fb114b1693
commit 12462e883a
2 changed files with 11 additions and 1 deletions

View File

@ -62,7 +62,9 @@ def admin():
one_times=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.one_time]), one_times=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.one_time]),
recurring=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.monthly]), recurring=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.monthly]),
unspecified_one_times=sum([d.amount for d in unspecified if d.type == DonationType.one_time]), unspecified_one_times=sum([d.amount for d in unspecified if d.type == DonationType.one_time]),
unspecified_recurring=sum([d.amount for d in unspecified if d.type == DonationType.monthly]) unspecified_recurring=sum([d.amount for d in unspecified if d.type == DonationType.monthly]),
total_one_time=sum([d.amount for d in Donation.query.filter(Donation.type == DonationType.one_time)]),
total_recurring=sum([d.amount for d in Donation.query.filter(Donation.type == DonationType.recurring)]),
) )
@html.route("/create-project", methods=["POST"]) @html.route("/create-project", methods=["POST"])

View File

@ -74,6 +74,12 @@
<td>${{ "{:.2f}".format(unspecified_one_times / 100) }}</td> <td>${{ "{:.2f}".format(unspecified_one_times / 100) }}</td>
<td>${{ "{:.2f}".format(unspecified_recurring / 100) }}</td> <td>${{ "{:.2f}".format(unspecified_recurring / 100) }}</td>
</tr> </tr>
<tr>
<td></td>
<td><strong>Total</strong></td>
<td>${{ "{:.2f}".format(total_one_time / 100) }}</td>
<td>${{ "{:.2f}".format(total_recurring / 100) }}</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -92,6 +98,7 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Date</th>
<th>Email</th> <th>Email</th>
<th>Project</th> <th>Project</th>
<th>Comment</th> <th>Comment</th>
@ -102,6 +109,7 @@
<tbody> <tbody>
{% for donation in donations %} {% for donation in donations %}
<tr> <tr>
<td>{{ donation.created.isoformat() }}</td>
<td><a href="mailto:{{ donation.user.email }}">{{ donation.user.email }}</a></td> <td><a href="mailto:{{ donation.user.email }}">{{ donation.user.email }}</a></td>
<td>{{ donation.project.name if donation.project else "" }}</td> <td>{{ donation.project.name if donation.project else "" }}</td>
<td title="{{ donation.comment }}">{{ donation.comment if donation.comment else "" }}</td> <td title="{{ donation.comment }}">{{ donation.comment if donation.comment else "" }}</td>