From 81ce648b5d4913291abf109f4ed2d7762ec14bbc Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 8 Dec 2018 21:17:37 +0100 Subject: [PATCH] admin: add related theme in exercice list page --- admin/static/js/app.js | 9 ++++++++- admin/static/views/exercice-list.html | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 9730d887..df1f47f8 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -946,7 +946,14 @@ angular.module("FICApp") } }) - .controller("AllExercicesListController", function($scope, Exercice, $routeParams, $location, $rootScope, $http, $filter) { + .controller("AllExercicesListController", function($scope, Exercice, Theme, $routeParams, $location, $rootScope, $http, $filter) { + $http({ + url: "/api/themes.json", + method: "GET" + }).then(function(response) { + $scope.themes = response.data + }); + $scope.exercices = Exercice.query(); $scope.exercice = {}; // Array used to save fields to updates in selected exercices $scope.fields = ["title", "overview"]; diff --git a/admin/static/views/exercice-list.html b/admin/static/views/exercice-list.html index 9c2054eb..53f26d70 100644 --- a/admin/static/views/exercice-list.html +++ b/admin/static/views/exercice-list.html @@ -30,6 +30,9 @@ {{ field }} + + Thème + @@ -40,6 +43,9 @@ {{ exercice[field] }} + + {{ themes[exercice.id_theme].name }} +