admin: Show diff on settings form
This commit is contained in:
parent
eb07eadae0
commit
465a48c1c0
@ -512,8 +512,10 @@ angular.module("FICApp")
|
||||
|
||||
.controller("SettingsController", function($scope, $rootScope, Settings, SettingsChallenge, $location, $http, $interval) {
|
||||
$scope.displayDangerousActions = false;
|
||||
$scope.config = Settings.get();
|
||||
$scope.config = Settings.get();
|
||||
$scope.dist_config = {};
|
||||
$scope.config.$promise.then(function(response) {
|
||||
$scope.dist_config = Object.assign({}, response);
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
$rootScope.settings.start = new Date(response.start);
|
||||
$rootScope.settings.end = new Date(response.end);
|
||||
@ -551,6 +553,7 @@ angular.module("FICApp")
|
||||
var state = this.config.enableExerciceDepend;
|
||||
this.config.unlockedChallengeDepth = (this.config.enableExerciceDepend?this.config.unlockedChallengeDepth:-1)
|
||||
this.config.$update(function(response) {
|
||||
$scope.dist_config = Object.assign({}, response);
|
||||
$scope.addToast('success', msg);
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
$rootScope.settings.start = new Date(nStart);
|
||||
|
@ -3,6 +3,29 @@
|
||||
<form ng-submit="saveSettings()" class="card my-3">
|
||||
<div class="card-header">
|
||||
<button type="submit" class="float-right btn btn-success"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Propager ces paramètres</button>
|
||||
<div class="form-group float-right mr-2 mb-0">
|
||||
<div class="input-group mt-1">
|
||||
<div class="input-group-prepend">
|
||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-class="{'btn-outline-secondary': !activateTimeCountDown, 'btn-warning': activateTimeCountDown && config.activateTime == settings.activateTime, 'btn-outline-warning': config.activateTime && config.activateTime != settings.activateTime}"><span class="glyphicon glyphicon-record" aria-hidden="true"></span> Propager plus tard</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" ng-click="updActivateTime(2)">modulo 2 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(5)">modulo 5 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(10)">modulo 10 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(15)">modulo 15 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(20)">modulo 20 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(30)">modulo 30 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(60)">modulo 60 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(90)">modulo 90 minutes</a>
|
||||
<a class="dropdown-item" ng-click="config.activateTime = '0001-01-01T00:00:00Z'" ng-show="activateTimeCountDown">annuler la propagation</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm" id="activateTime" ng-model="config.activateTime" ng-change="updateActivateTime()">
|
||||
</div>
|
||||
<small ng-if="activateTimeCountDown">
|
||||
Propagation dans : {{ activateTimeCountDown | timer }}
|
||||
Il restera : {{ timeRemaining - activateTimeCountDown | timer }}
|
||||
</small>
|
||||
</div>
|
||||
<h2 class="mb-0">
|
||||
Paramètres
|
||||
</h2>
|
||||
@ -11,10 +34,10 @@
|
||||
<input type="hidden" class="form-control form-control-sm" id="lastRegeneration" ng-model="config.generation">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="startTime" class="col-sm-3 col-form-label col-form-label-sm">Début du challenge</label>
|
||||
<label for="startTime" class="col-sm-3 col-form-label col-form-label-sm" ng-class="{'text-primary font-weight-bold': config.start != dist_config.start}">Début du challenge</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control form-control-sm" id="startTime" ng-model="config.start">
|
||||
<input type="text" class="form-control form-control-sm" id="startTime" ng-model="config.start" ng-class="{'border-primary': config.start != dist_config.start}">
|
||||
<div class="input-group-append">
|
||||
<button ng-click="launchChallenge()" class="btn btn-sm btn-secondary" type="button"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> Lancer le challenge</button>
|
||||
</div>
|
||||
@ -23,9 +46,9 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="endTime" class="col-sm-3 col-form-label col-form-label-sm">Fin du challenge</label>
|
||||
<label for="endTime" class="col-sm-3 col-form-label col-form-label-sm" ng-class="{'text-primary font-weight-bold': config.end != dist_config.end}">Fin du challenge</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control form-control-sm" id="endTime" ng-model="config.end">
|
||||
<input type="text" class="form-control form-control-sm" id="endTime" ng-model="config.end" ng-class="{'border-primary': config.end != dist_config.end}">
|
||||
</div>
|
||||
<div class="col-sm-1 text-right">
|
||||
<label for="duration" class="col-form-label col-form-label-sm">Durée</label>
|
||||
@ -43,168 +66,143 @@
|
||||
<hr>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="globalScoreCoefficient" class="col-sm-2 col-form-label col-form-label-sm"><strong>Coefficients</strong></label>
|
||||
<label for="globalScoreCoefficient" class="col-sm-2 col-form-label col-form-label-sm" ng-class="{'text-primary': config.globalScoreCoefficient != dist_config.globalScoreCoefficient}"><strong>Coefficients</strong></label>
|
||||
<div class="col-sm-1">
|
||||
<input type="text" class="form-control form-control-sm" id="globalScoreCoefficient" ng-model="config.globalScoreCoefficient" float title="Coefficient multiplicateur global du score final (le coefficient est appliqué dans la fonction et vaut pour tout le challenge, présent/passé/futur, sans effet de bord)">
|
||||
<input type="text" class="form-control form-control-sm" id="globalScoreCoefficient" ng-model="config.globalScoreCoefficient" float title="Coefficient multiplicateur global du score final (le coefficient est appliqué dans la fonction et vaut pour tout le challenge, présent/passé/futur, sans effet de bord)" ng-class="{'border-primary': config.globalScoreCoefficient != dist_config.globalScoreCoefficient}">
|
||||
</div>
|
||||
|
||||
<label for="hintcoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right">incides</label>
|
||||
<label for="hintcoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right" ng-class="{'text-primary font-weight-bold': config.hintCurrentCoefficient != dist_config.hintCurrentCoefficient}">incides</label>
|
||||
<div class="col-sm-1">
|
||||
<input type="text" class="form-control form-control-sm" id="hintcoefficient" ng-model="config.hintCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait perdre un indice (le coefficient est enregistré au moment où l'équipe demande un indice, ce n'est pas global)">
|
||||
<input type="text" class="form-control form-control-sm" id="hintcoefficient" ng-model="config.hintCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait perdre un indice (le coefficient est enregistré au moment où l'équipe demande un indice, ce n'est pas global)" ng-class="{'border-primary': config.hintCurrentCoefficient != dist_config.hintCurrentCoefficient}">
|
||||
</div>
|
||||
|
||||
<label for="wchoicescoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right">WChoices</label>
|
||||
<label for="wchoicescoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right" ng-class="{'text-primary font-weight-bold': config.wchoiceCurrentCoefficient != dist_config.wchoiceCurrentCoefficient}">WChoices</label>
|
||||
<div class="col-sm-1">
|
||||
<input type="text" class="form-control form-control-sm" id="wchoicescoefficient" ng-model="config.wchoiceCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait perdre une demande de liste de choix (le coefficient est enregistré au moment où l'équipe demande la liste de choix, ce n'est pas global)">
|
||||
<input type="text" class="form-control form-control-sm" id="wchoicescoefficient" ng-model="config.wchoiceCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait perdre une demande de liste de choix (le coefficient est enregistré au moment où l'équipe demande la liste de choix, ce n'est pas global)" ng-class="{'border-primary': config.wchoiceCurrentCoefficient != dist_config.wchoiceCurrentCoefficient}">
|
||||
</div>
|
||||
|
||||
<label for="exercicecurcoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right">défis</label>
|
||||
<label for="exercicecurcoefficient" class="col-sm-2 col-form-label col-form-label-sm text-right" ng-class="{'text-primary font-weight-bold': config.exerciceCurrentCoefficient != dist_config.exerciceCurrentCoefficient}">défis</label>
|
||||
<div class="col-sm-1">
|
||||
<input type="text" class="form-control form-control-sm" id="exercicecurcoefficient" ng-model="config.exerciceCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait gagner un exercice validé (le coefficient est enregistré au moment où l'équipe valide l'exercice, ce n'est pas global)">
|
||||
<input type="text" class="form-control form-control-sm" id="exercicecurcoefficient" ng-model="config.exerciceCurrentCoefficient" float title="Coefficient multiplicateur temporaire du nombre de points que fait gagner un exercice validé (le coefficient est enregistré au moment où l'équipe valide l'exercice, ce n'est pas global)" ng-class="{'border-primary': config.exerciceCurrentCoefficient != dist_config.exerciceCurrentCoefficient}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="firstBlood" class="col-sm-3 col-form-label col-form-label-sm">Bonus premier sang</label>
|
||||
<label for="firstBlood" class="col-sm-3 col-form-label col-form-label-sm" ng-class="{'text-primary font-weight-bold': config.firstBlood != dist_config.firstBlood}">Bonus premier sang</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control form-control-sm" id="firstBlood" ng-model="config.firstBlood" float>
|
||||
<input type="text" class="form-control form-control-sm" id="firstBlood" ng-model="config.firstBlood" float ng-class="{'border-primary': config.firstBlood != dist_config.firstBlood}">
|
||||
</div>
|
||||
<label for="submissionCostBase" class="offset-sm-1 col-sm-4 col-form-label col-form-label-sm text-right">Coût de base d'une tentative</label>
|
||||
<label for="submissionCostBase" class="offset-sm-1 col-sm-4 col-form-label col-form-label-sm text-right" ng-class="{'text-primary font-weight-bold': config.submissionCostBase != dist_config.submissionCostBase}">Coût de base d'une tentative</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control form-control-sm" id="submissionCostBase" ng-model="config.submissionCostBase" float>
|
||||
<input type="text" class="form-control form-control-sm" id="submissionCostBase" ng-model="config.submissionCostBase" float ng-class="{'border-primary': config.submissionCostBase != dist_config.submissionCostBase}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col">
|
||||
<div class="input-group mt-1">
|
||||
<div class="input-group-prepend">
|
||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-class="{'btn-outline-secondary': !activateTimeCountDown, 'btn-warning': activateTimeCountDown && config.activateTime == settings.activateTime, 'btn-outline-warning': config.activateTime && config.activateTime != settings.activateTime}"><span class="glyphicon glyphicon-record" aria-hidden="true"></span> Propager plus tard</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" ng-click="updActivateTime(2)">modulo 2 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(5)">modulo 5 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(10)">modulo 10 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(15)">modulo 15 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(20)">modulo 20 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(30)">modulo 30 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(60)">modulo 60 minutes</a>
|
||||
<a class="dropdown-item" ng-click="updActivateTime(90)">modulo 90 minutes</a>
|
||||
<a class="dropdown-item" ng-click="config.activateTime = '0001-01-01T00:00:00Z'" ng-show="activateTimeCountDown">annuler la propagation</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm" id="activateTime" ng-model="config.activateTime" ng-change="updateActivateTime()">
|
||||
</div>
|
||||
<small ng-if="activateTimeCountDown">
|
||||
Propagation dans : {{ activateTimeCountDown | timer }}
|
||||
Il restera : {{ timeRemaining - activateTimeCountDown | timer }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pl-0 pt-3 border-top" style="columns: 2;">
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.allowRegistration">
|
||||
<span class="custom-control-label">Activer les inscriptions</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.allowRegistration != !dist_config.allowRegistration}">Activer les inscriptions</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.canJoinTeam" ng-disabled="!config.allowRegistration">
|
||||
<span class="custom-control-label">Les participants sans équipe peuvent en rejoindre une</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.canJoinTeam != !dist_config.canJoinTeam}">Les participants sans équipe peuvent en rejoindre une</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.denyTeamCreation" ng-disabled="!config.allowRegistration && !config.canJoinTeam">
|
||||
<span class="custom-control-label">Interdire la création de nouvelles équipes</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.denyTeamCreation != !dist_config.denyTeamCreation}">Interdire la création de nouvelles équipes</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.denyNameChange">
|
||||
<span class="custom-control-label">Interdire les changements de nom d'équipe</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.denyNameChange != !dist_config.denyNameChange}">Interdire les changements de nom d'équipe</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.ignoreTeamMembers">
|
||||
<span class="custom-control-label" title="Un message d'avertissement est affiché aux équipes dont la liste des membres n'est pas connue, afin qu'ils viennent se présenter à l'équipe serveur. Cocher cette case pour que le message ne s'affiche pas, lorsque la composition de l'équipe n'intéresse pas.">Ne pas avertir les équipes sans membre</span>
|
||||
<span class="custom-control-label" title="Un message d'avertissement est affiché aux équipes dont la liste des membres n'est pas connue, afin qu'ils viennent se présenter à l'équipe serveur. Cocher cette case pour que le message ne s'affiche pas, lorsque la composition de l'équipe n'intéresse pas." ng-class="{'text-primary font-weight-bold': !config.ignoreTeamMembers != !dist_config.ignoreTeamMembers}">Ne pas avertir les équipes sans membre</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.acceptNewIssue">
|
||||
<span class="custom-control-label">Activer le rapport d'anomalies par les équipes</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.acceptNewIssue != !dist_config.acceptNewIssue}">Activer le rapport d'anomalies par les équipes</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.QAenabled">
|
||||
<span class="custom-control-label">Activer les rapports QA</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.QAenabled != !dist_config.QAenabled}">Activer les rapports QA</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.enableResolutionRoute">
|
||||
<span class="custom-control-label">Activer la route montrant les solutions</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.enableResolutionRoute != !dist_config.enableResolutionRoute}">Activer la route montrant les solutions</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<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">Activer la validation partielle des challenges</span>
|
||||
<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>
|
||||
|
||||
<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">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>
|
||||
<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.displayAllFlags">
|
||||
<span class="custom-control-label">Désactiver les dépendances des flags</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.displayAllFlags != !dist_config.displayAllFlags}">Désactiver les dépendances des flags</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.submissionUniqueness">
|
||||
<span class="custom-control-label">Ne pas comptabiliser les tentatives identiques dans le score</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.submissionUniqueness != !dist_config.submissionUniqueness}">Ne pas comptabiliser les tentatives identiques dans le score</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.countOnlyNotGoodTries">
|
||||
<span class="custom-control-label">Comptabiliser seulement les tentatives sans bonne réponse dans le score</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.countOnlyNotGoodTries != !dist_config.countOnlyNotGoodTries}">Comptabiliser seulement les tentatives sans bonne réponse dans le score</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.displayMCQBadCount">
|
||||
<span class="custom-control-label">Afficher le décompte de mauvaises réponses des QCM</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.displayMCQBadCount != !dist_config.displayMCQBadCount}">Afficher le décompte de mauvaises réponses des QCM</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.eventKindness">
|
||||
<span class="custom-control-label">Réduire la relève d'évènements côté navigateur</span>
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.eventKindness != !dist_config.eventKindness}">Réduire la relève d'évènements côté navigateur</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user