diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 6e318533..7d70c888 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -440,6 +440,7 @@ angular.module("FICApp") }) .controller("SettingsController", function($scope, $rootScope, Settings, ROSettings, $location, $http, $interval) { + $scope.displayDangerousActions = false; $scope.config = Settings.get(); $scope.config.$promise.then(function(response) { response.enableExerciceDepend = response.unlockedChallengeDepth >= 0; @@ -521,16 +522,25 @@ angular.module("FICApp") var d = new Date(ts + 120000); this.config.activateTime = d.toISOString(); } - $scope.reset = function(type) { - if (confirm("Êtes-vous sûr ?")) { - $http.post("/api/reset", {"type": type}).then(function(time) { - $rootScope.newBox('success', type + 'reseted'); - $location.url("/"); - }, function(response) { - $rootScope.newBox('danger', 'An error occurs when reseting ' + type + ':', response.data.errmsg); - }); + $scope.reset = function(type) { + var txts = { + "challenges": "En validant, vous retirerez toutes les données statiques des challenges.", + "teams": "En validant, vous supprimerez l'ensemble des équipes enregistreées.", + "game": "En validant, vous supprimerez toutes les tentatives, les validations, ... faites par les équipes.", } - }; + $rootScope.newYesNoBox('warning', txts[type], 'Êtes-vous sûr de vouloir continuer ?', + function() { + if (confirm("Êtes-vous vraiment sûr ?\n" + txts[type])) { + $http.post("/api/reset", {"type": type}).then(function(time) { + $rootScope.newBox('success', type + 'reseted'); + $location.url("/"); + }, function(response) { + $rootScope.newBox('danger', 'An error occurs when reseting ' + type + ':', response.data.errmsg); + }); + + } + }); + }; $scope.deepSyncInProgress = false; $scope.deepSync = function(type) { $rootScope.newYesNoBox('warning', 'Faire une synchronisation intégrale ?', '', diff --git a/admin/static/views/settings.html b/admin/static/views/settings.html index f6e67f6b..c7ea853c 100644 --- a/admin/static/views/settings.html +++ b/admin/static/views/settings.html @@ -175,7 +175,21 @@ -
+
+
+ Synchronisation et suppressions de masse +
+
+
+ +
+
+
+ +