This repository has been archived by the owner. It is now read-only.
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (43 sloc) 1.53 KB
from aspen import Response
[---]
if not user.ADMIN:
raise Response(401 if user.ANON else 403)
unreviewed = website.db.all("""
SELECT username
, balance
, (SELECT SUM(amount) FROM current_payment_instructions WHERE participant_id = p.id) AS giving
, (SELECT COUNT(*) FROM current_payment_instructions WHERE participant_id = p.id AND amount > 0) AS ngiving_to
FROM participants p
WHERE is_suspicious IS NULL
AND ( -- They have a payin/payout route set up.
SELECT COUNT(*)
FROM current_exchange_routes r
WHERE r.participant = p.id
) > 0
AND giving > 0
AND NOT is_closed
ORDER BY claimed_time
""")
title = _("Fraud Review Dashboard")
[---] text/html
<script src="{{ website.asset('vendors.js') }}"></script>
<script src="{{ website.asset('gratipay.js') }}"></script>
<script src="index.js"></script>
<link rel="stylesheet" type="text/css" href="index.css">
<h3>Unreviewed Accounts (N = {{ len(unreviewed) }})</h3>
<table>
{% for account in unreviewed %}
<tr data-username="{{ account.username }}">
<td>
<button class="good small selected">Good</button>
<button class="bad small">Bad</button>
</td>
<td>
<a href="/~{{ account.username }}/" target="drill-down">{{ account.username }}</a>
</td>
<td>${{ account.giving }}</td>
<td>{{ account.ngiving_to }}</td>
</tr>
{% endfor %}
</table>
<iframe name="drill-down"></iframe>