frontend: new page theme

This commit is contained in:
nemunaire 2018-11-25 03:08:07 +01:00
parent ea56219fa1
commit 26295dd978
3 changed files with 157 additions and 150 deletions

View file

@ -31,7 +31,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
})
.when("/:theme/:exercice", {
controller: "ExerciceController",
templateUrl: "views/theme.html"
templateUrl: "views/defi.html"
})
.when("/", {
controller: "HomeController",
@ -198,21 +198,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$rootScope.current_exercice = exercicesUrl[$routeParams.exercice];
})
} else {
if ($scope.themes && $scope.my && $scope.themes[$scope.current_theme]) {
var exos = Object.keys($scope.themes[$scope.current_theme].exercices);
var i = 0;
for (; i < exos.length; i++) {
if (!$scope.my.exercices || !$scope.my.exercices[exos[i]] || !$scope.my.exercices[exos[i]].solved)
break;
}
if (i < exos.length) {
$rootScope.current_exercice = exos[i];
} else {
$rootScope.current_exercice = exos[0];
}
} else {
$rootScope.current_exercice = 0;
}
$rootScope.current_exercice = 0;
}
$scope.hsubmit = function(hint) {