Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Stub out a list of suspicious accounts.
Browse files Browse the repository at this point in the history
Part of #557. This covers the logic; it’s mostly a duplicate of
`dashboard/index` with the buttons removed (admins can mark/unmark
suspicious on the profile itself).

Obviously needs to be put into a site template for ~users to see, and
only needs the list, not the other frame.
  • Loading branch information
mattbk committed Nov 12, 2016
1 parent e637762 commit 79372b0
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions www/dashboard/suspicious.spt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from aspen import Response

[---]
suspicious = 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 true
AND NOT is_closed
ORDER BY claimed_time

""")

title = _("Fraud Review Dashboard")
[---] text/html
<script src="{{ website.asset('jquery.min.js') }}"></script>
<script src="{{ website.asset('gratipay.js') }}"></script>
<style>
table {
width: auto;
}
td, th {
text-align: left;
vertical-align: top;
}
iframe {
width: 70%;
height: 100%;
position: fixed;
top: 0;
right: 0;
background: white;
}
</style>

<h3>Suspicious Accounts (N = {{ len(suspicious) }})</h3>
<table>
{% for account in suspicious %}
<tr data-username="{{ account.username }}">
<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>

0 comments on commit 79372b0

Please sign in to comment.