UX: add confirm dialog when rolling up IP ban entries

This commit is contained in:
Régis Hanol 2014-11-24 19:38:47 +01:00
parent d3d517108d
commit 2c38f969cc
2 changed files with 8 additions and 3 deletions

View File

@ -18,9 +18,13 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
rollUp: function() { rollUp: function() {
var self = this; var self = this;
this.set("loading", true) return bootbox.confirm(I18n.t("admin.logs.screened_ips.roll_up_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function (confirmed) {
return Discourse.ScreenedIpAddress.rollUp().then(function() { if (confirmed) {
self.send("show"); self.set("loading", true)
return Discourse.ScreenedIpAddress.rollUp().then(function() {
self.send("show");
});
}
}); });
} }
} }

View File

@ -1862,6 +1862,7 @@ en:
title: "Screened IPs" title: "Screened IPs"
description: 'IP addresses that are being watched. Use "Allow" to whitelist IP addresses.' description: 'IP addresses that are being watched. Use "Allow" to whitelist IP addresses.'
delete_confirm: "Are you sure you want to remove the rule for %{ip_address}?" delete_confirm: "Are you sure you want to remove the rule for %{ip_address}?"
roll_up_confirm: "Are you sure you want to roll up ban entries?"
actions: actions:
block: "Block" block: "Block"
do_nothing: "Allow" do_nothing: "Allow"