From c27e1105e5a1777cc46b3eb58c310d87df792dc4 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 10 Jul 2013 11:26:30 -0400 Subject: [PATCH] Allow users to deactivate their bots from the website. (The back end had been in place already.) (imported from commit ec4b7b3ea39d71d86b0bdc161740e494ce1e13f7) --- zephyr/static/js/settings.js | 13 +++++++++++++ zephyr/static/templates/bot_avatar_row.handlebars | 3 +++ 2 files changed, 16 insertions(+) diff --git a/zephyr/static/js/settings.js b/zephyr/static/js/settings.js index a0c11815a5..c0022b975e 100644 --- a/zephyr/static/js/settings.js +++ b/zephyr/static/js/settings.js @@ -163,6 +163,19 @@ $(function () { }); } }); + + $("#bots_list").on("click", "button.delete_bot", function (e) { + var email = $(e.target).data('email'); + $.ajax({ + url: '/json/users/' + encodeURIComponent(email), + type: 'DELETE', + success: function () { + var row = $(e.target).closest("li"); + row.remove(); + } + + }); + }); }); }()); diff --git a/zephyr/static/templates/bot_avatar_row.handlebars b/zephyr/static/templates/bot_avatar_row.handlebars index 240a63e717..fa69de5e3b 100644 --- a/zephyr/static/templates/bot_avatar_row.handlebars +++ b/zephyr/static/templates/bot_avatar_row.handlebars @@ -12,5 +12,8 @@ API Key {{api_key}} + \ No newline at end of file