Improve admin page

master
Drew DeVault 9 years ago
parent fb114b1693
commit 12462e883a
  1. 4
      fosspay/blueprints/html.py
  2. 8
      templates/admin.html

@ -62,7 +62,9 @@ def admin():
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]),
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"])

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

Loading…
Cancel
Save