admin: New page to list forge link per theme and exercice

This commit is contained in:
nemunaire 2025-03-31 15:42:07 +02:00
parent b713eba2a5
commit 7d775fe26d
5 changed files with 98 additions and 0 deletions

View file

@ -49,6 +49,10 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
controller: "ExerciceController",
templateUrl: "views/exercice-resolution.html"
})
.when("/forge-links", {
controller: "ForgeLinksController",
templateUrl: "views/exercices-forgelink.html"
})
.when("/tags", {
controller: "TagsListController",
templateUrl: "views/tags.html"
@ -2189,6 +2193,16 @@ angular.module("FICApp")
};
})
.controller("ForgeLinksController", function ($scope, $http) {
$http({
url: "api/exercices_forge_bindings.json",
}).then(function (response) {
$scope.forge_links = response.data;
}, function (response) {
$scope.addToast('danger', 'An error occurs when generating exercice forge links: ', response.data.errmsg);
});
})
.controller("ExerciceTagsController", function ($scope, ExerciceTags, $routeParams, $rootScope) {
$scope.tags = ExerciceTags.query({ exerciceId: $routeParams.exerciceId });