diff --git a/fosspay/blueprints/html.py b/fosspay/blueprints/html.py index 3522546..c8abe81 100644 --- a/fosspay/blueprints/html.py +++ b/fosspay/blueprints/html.py @@ -61,8 +61,10 @@ def admin(): donations=donations, 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 and d.active]), + recurring_ever=lambda p: sum([d.amount * d.payments 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 and d.active]), + unspecified_recurring_ever=sum([d.amount * d.payments 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.monthly, Donation.active == True)]), total_recurring_ever=sum([d.amount * d.payments for d in Donation.query.filter(Donation.type == DonationType.monthly)]), diff --git a/templates/admin.html b/templates/admin.html index 17b2813..bc7f7c2 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -49,14 +49,15 @@ {% endif %}

Projects

-
+
- + + @@ -66,6 +67,7 @@ + {% endfor %} @@ -73,23 +75,19 @@ + - - - - - - - + +
Project Name One-timeRecurringRecurring (active)Recurring (total paid)
{{ project.name }} ${{ "{:.2f}".format(one_times(project) / 100) }} ${{ "{:.2f}".format(recurring(project) / 100) }}${{ "{:.2f}".format(recurring_ever(project) / 100) }}
(not specified) ${{ "{:.2f}".format(unspecified_one_times / 100) }} ${{ "{:.2f}".format(unspecified_recurring / 100) }}${{ "{:.2f}".format(unspecified_recurring_ever / 100) }}
Total ${{ "{:.2f}".format(total_one_time / 100) }}${{ "{:.2f}".format(total_recurring / 100) }} (active)
Total${{ "{:.2f}".format(total_recurring_ever / 100) }} (paid)${{ "{:.2f}".format(total_recurring / 100) }}${{ "{:.2f}".format(total_recurring_ever / 100) }}
-
+

Add Project

Donors will not be given a choice of project unless you have at least 2.