mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
88 lines
2.0 KiB
HTML
88 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 username
|
|
, balance
|
|
FROM participants
|
|
WHERE is_suspicious IS NULL
|
|
AND balanced_account_uri 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>
|
|
|
|
<a href="/{{ account['username'] }}/" target="drill-down">{{ account['username'] }}</a>
|
|
</div>
|
|
{% end %}
|
|
<iframe name="drill-down"></iframe>
|