settings: Can disable all submission button for maintenance
This commit is contained in:
parent
329bd246c7
commit
e9dd35f8ac
9 changed files with 41 additions and 10 deletions
|
|
@ -529,6 +529,7 @@ angular.module("FICApp")
|
|||
$scope.config[k] = ns.values[k];
|
||||
});
|
||||
$scope.config.enableExerciceDepend = $scope.config.unlockedChallengeDepth >= 0;
|
||||
$scope.config.disabledsubmitbutton = $scope.config.disablesubmitbutton && $scope.config.disablesubmitbutton.length > 0;
|
||||
}
|
||||
$scope.deleteNextSettings = function(ns) {
|
||||
ns.$delete().then(function() {
|
||||
|
|
@ -542,6 +543,7 @@ angular.module("FICApp")
|
|||
$scope.config.$promise.then(function(response) {
|
||||
$scope.dist_config = Object.assign({}, response);
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
response.disabledsubmitbutton = response.disablesubmitbutton && response.disablesubmitbutton.length > 0;
|
||||
$rootScope.settings.start = new Date(response.start);
|
||||
$rootScope.settings.end = new Date(response.end);
|
||||
$rootScope.settings.generation = new Date(response.generation);
|
||||
|
|
@ -562,6 +564,13 @@ angular.module("FICApp")
|
|||
$scope.config.unlockedChallengeDepth = -1;
|
||||
};
|
||||
|
||||
$scope.submitButtonStateChange = function() {
|
||||
if ($scope.config.disabledsubmitbutton)
|
||||
$scope.config.disablesubmitbutton = "Mise à jour en cours...";
|
||||
else
|
||||
$scope.config.disablesubmitbutton = "";
|
||||
};
|
||||
|
||||
$scope.saveChallengeInfo = function() {
|
||||
this.challenge.duration = $scope.duration;
|
||||
this.challenge.$update(function(response) {
|
||||
|
|
@ -577,6 +586,7 @@ angular.module("FICApp")
|
|||
var nGen = this.config.generation;
|
||||
var state = this.config.enableExerciceDepend;
|
||||
this.config.unlockedChallengeDepth = (this.config.enableExerciceDepend?this.config.unlockedChallengeDepth:-1)
|
||||
this.config.disablesubmitbutton = (this.config.disabledsubmitbutton?this.config.disablesubmitbutton:'')
|
||||
var updateQuery = {};
|
||||
if (this.activateTime && this.activateTime != '0001-01-01T00:00:00Z') {
|
||||
updateQuery['t'] = this.activateTime;
|
||||
|
|
@ -590,6 +600,7 @@ angular.module("FICApp")
|
|||
$scope.addToast('success', msg);
|
||||
$scope.nextsettings = NextSettings.query();
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
response.disabledsubmitbutton = response.disablesubmitbutton && response.disablesubmitbutton.length > 0;
|
||||
$rootScope.settings.start = new Date(nStart);
|
||||
$rootScope.settings.end = new Date(nEnd);
|
||||
$rootScope.settings.generation = new Date(nGen);
|
||||
|
|
|
|||
|
|
@ -158,16 +158,16 @@
|
|||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.partialValidation">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.partialValidation != !dist_config.partialValidation}">Activer la validation partielle des challenges</span>
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend" ng-change="exerciceDependChange()">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': config.unlockedChallengeDepth != dist_config.unlockedChallengeDepth}">Activer les dépendances des exercices</span>
|
||||
<input type="number" class="form-control form-control-sm" ng-model="config.unlockedChallengeDepth" ng-disabled="!config.enableExerciceDepend" title="-1 : Désactivé ; 0: activé ; 1,2,3 : débloque 1,2,3,... exercices supplémentaires après un challenge validé" min="0" integer ng-class="{'border-primary': config.unlockedChallengeDepth != dist_config.unlockedChallengeDepth}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend" ng-change="exerciceDependChange()">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': config.unlockedChallengeDepth != dist_config.unlockedChallengeDepth}">Activer les dépendances des exercices</span>
|
||||
<input type="number" class="form-control form-control-sm" ng-model="config.unlockedChallengeDepth" ng-disabled="!config.enableExerciceDepend" title="-1 : Désactivé ; 0: activé ; 1,2,3 : débloque 1,2,3,... exercices supplémentaires après un challenge validé" min="0" integer ng-class="{'border-primary': config.unlockedChallengeDepth != dist_config.unlockedChallengeDepth}">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.partialValidation">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.partialValidation != !dist_config.partialValidation}">Activer la validation partielle des challenges</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
|
@ -206,6 +206,14 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox"ng-model="config.disabledsubmitbutton" ng-change="submitButtonStateChange()">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.disablesubmitbutton != !dist_config.disablesubmitbutton}">Désactiver les boutons de soumission (pour indiquer une indisponibilité)</span>
|
||||
<input class="form-control form-control-sm" ng-model="config.disablesubmitbutton" ng-disabled="!config.disabledsubmitbutton" title="Message qui sera indiqué aux participants" ng-class="{'border-primary': !config.disablesubmitbutton != !dist_config.disablesubmitbutton}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
|
|||
Reference in a new issue