admin: add button and route to reset some parts
This commit is contained in:
parent
89eaeef88e
commit
4793d0de4e
4 changed files with 65 additions and 0 deletions
|
|
@ -280,6 +280,13 @@ angular.module("FICApp")
|
|||
var f = new Date(ts + 120000 + this.duration * 60000);
|
||||
this.config.end = f.toISOString();
|
||||
}
|
||||
$scope.reset = function(type) {
|
||||
if (confirm("Êtes-vous sûr ?")) {
|
||||
$http.post("/api/reset", {"type": type}).success(function(time) {
|
||||
$location.url("/");
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.controller("PublicController", function($scope, Scene, Theme, Teams, Exercice) {
|
||||
|
|
|
|||
|
|
@ -102,3 +102,9 @@
|
|||
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Propager ces paramètres</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="well">
|
||||
<a ng-click="reset('challenges')" class="btn btn-warning" role="button"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Effacer les challenges et les thèmes</a>
|
||||
<a ng-click="reset('teams');" class="btn btn-warning" role="button"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Effacer les équipes</a>
|
||||
<a ng-click="reset('game');" class="btn btn-warning" role="button"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Effacer la partie (tentatives, indices, ...)</a>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue