From 009d4ed99d7e764c2f77caf68a587e3837b55d93 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 6 Nov 2012 13:01:25 -0500 Subject: [PATCH] Modify profile admin UI for is_suspicious (#354) --- www/%participant_id/index.html | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/www/%participant_id/index.html b/www/%participant_id/index.html index a581c99e1e..c897100df5 100644 --- a/www/%participant_id/index.html +++ b/www/%participant_id/index.html @@ -394,28 +394,29 @@ ); }); - {% if user.ADMIN and participant['balanced_account_uri'] %} - // Wire up payin suspender. - // ======================== + {% if user.ADMIN %} + // Wire up is_suspicious toggle. + // ============================= - $('#payin-suspender').click(function() + $('.is-suspicious-knob').click(function() { jQuery.ajax( - { url: 'toggle-payin-suspension.json' + { url: 'toggle-is-suspicious.json' , type: 'POST' , dataType: 'json' , success: function(data) { if (data.is_suspicious) - $('#balanced-account').addClass('is-suspicious'); + $("#accounts").addClass('is-suspicious'); else - $('#balanced-account').removeClass('is-suspicious'); - var val = data.is_suspicious ? 'Uns' : 'S'; - $('#payin-suspender').text(val + 'uspend Payins'); + $("#accounts").removeClass('is-suspicious'); + $('INPUT.is-suspicious-knob').attr( 'checked' + , data.is_suspicious + ); } , error: function() { - alert( "Failed to toggle payin suspension. " - + "Please try again." + alert( "Failed to change is_suspicious. Please " + + "try again." ); } } @@ -689,8 +690,16 @@

Linked Accounts

{% end %} + {% if user.ADMIN %} +

+ + +

+ {% end %} + -