admin: add related theme in exercice list page
This commit is contained in:
parent
78b6211b94
commit
81ce648b5d
2 changed files with 14 additions and 1 deletions
|
@ -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"];
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
<th ng-repeat="field in fields">
|
||||
{{ field }}
|
||||
</th>
|
||||
<th>
|
||||
Thème
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -40,6 +43,9 @@
|
|||
<td ng-repeat="field in fields" ng-click="show(exercice.id)">
|
||||
{{ exercice[field] }}
|
||||
</td>
|
||||
<td>
|
||||
<a ng-href="themes/{{ exercice.id_theme }}">{{ themes[exercice.id_theme].name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Reference in a new issue