From 1ce1ec9bdcf25df11728a19a44b84385f1126fce Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 2 Jun 2023 15:40:10 -0700 Subject: [PATCH] Make deactivate-all use confirm() --- intake/templates/feed.jinja2 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/intake/templates/feed.jinja2 b/intake/templates/feed.jinja2 index 299806a..b0b6386 100644 --- a/intake/templates/feed.jinja2 +++ b/intake/templates/feed.jinja2 @@ -57,7 +57,7 @@ pre { table.feed-control td { font-family: monospace; padding: 5px 10px; } -div#pager { +div.center { text-align: center; } @@ -91,16 +91,19 @@ var punt = function (source, itemid) { }); }; var mdeactivate = function (items) { - fetch('/mass-deactivate/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json; charset=UTF-8', - }, - body: JSON.stringify({items: items}), - }) - .then(function () { - location.reload(); - }); + console.log(items); + if (confirm(`Deactivate ${items.length} items?`)) { + fetch('/mass-deactivate/', { + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + body: JSON.stringify({items: items}), + }) + .then(function () { + location.reload(); + }); + } }; var doAction = function (source, itemid, action) { document.getElementById(`${source}-${itemid}-action-${action}`).disabled = true; @@ -168,7 +171,7 @@ var doAction = function (source, itemid, action) { {% endfor %} {% if pager_prev or pager_next %} -
+
Prev | Next @@ -177,18 +180,15 @@ var doAction = function (source, itemid, action) { {% if items %}
-
-Feed Management
- +
-
{% endif %} {# if items #} {% else %} -
+
Feed is empty
{% endif %}