Files
Chad Whitacre 28cb48c72a Big changeover from id to username; #287
I sort of did this one with the blast shield down. I haven't even run
the tests yet. The sorts of things I changed:

 - SQL {elsewhere,exchanges}.participant_id => .participant
 - SQL participants.id => .username
 - ORM {user,participant,self}.id => .username
2013-04-05 15:48:59 -04:00

90 lines
2.0 KiB
HTML

from aspen import Response
from gittip import db
title = "Fraud Review Dashboard"
^L
if not user.ADMIN:
raise Response(404)
unreviewed = db.fetchall("""
SELECT id
, balance
FROM participants
WHERE is_suspicious IS NULL
AND ( last_bill_result IS NOT NULL
OR last_ach_result IS NOT NULL
)
ORDER BY claimed_time
""")
if unreviewed is None:
unreviewed = []
unreviewed = list(unreviewed)
^L
<script src="/assets/jquery-1.8.3.min.js"></script>
<script src="/assets/-/gittip.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>
<script>
$(document).ready(function()
{
Gittip.initCSRF();
function error(a,b,c)
{
console.log(a,b,c);
alert("Failed!");
}
$('BUTTON').click(function()
{
var row = $(this).parent();
var to = $(this).text() !== 'Good';
var username = row.attr('username');
var url = "/" + username + "/toggle-is-suspicious.json";
function success()
{
row.remove();
$('iframe').attr('src', '');
}
jQuery.ajax({ url: url
, type: "POST"
, dataType: "json"
, data: {to: to}
, success: success
, error: error
})
});
});
</script>
<h3>Unreviewed Accounts (N = {{ len(unreviewed) }})</h3>
{% for account in unreviewed %}
<div username="{{ account['username'] }}">
<button class="good small selected">Good</button>
<button class="bad small">Bad</button>
&nbsp;
<a href="/{{ account['username'] }}/" target="drill-down">{{ account['username'] }}</a>
</div>
{% end %}
<iframe name="drill-down"></iframe>