admin: New page to list tags
This commit is contained in:
parent
a6adc1ac8c
commit
80917ae436
5 changed files with 84 additions and 0 deletions
|
|
@ -41,6 +41,10 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
|
|||
controller: "ExerciceController",
|
||||
templateUrl: "views/exercice-resolution.html"
|
||||
})
|
||||
.when("/tags", {
|
||||
controller: "TagsListController",
|
||||
templateUrl: "views/tags.html"
|
||||
})
|
||||
.when("/teams", {
|
||||
controller: "TeamsListController",
|
||||
templateUrl: "views/team-list.html"
|
||||
|
|
@ -1478,6 +1482,16 @@ angular.module("FICApp")
|
|||
}
|
||||
})
|
||||
|
||||
.controller("TagsListController", function($scope, $http) {
|
||||
$scope.tags = [];
|
||||
$http({
|
||||
url: "api/tags",
|
||||
method: "GET"
|
||||
}).then(function(response) {
|
||||
$scope.tags = response.data
|
||||
});
|
||||
})
|
||||
|
||||
.controller("AllExercicesListController", function($scope, Exercice, Theme, $routeParams, $location, $rootScope, $http, $filter) {
|
||||
$http({
|
||||
url: "api/themes.json",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
<div class="d-flex justify-content-between">
|
||||
<h2>Exercices</h2>
|
||||
<div class="align-self-center">
|
||||
<a
|
||||
href="tags"
|
||||
class="btn btn-sm btn-dark"
|
||||
>
|
||||
<span class="glyphicon glyphicon-th" aria-hidden="true"></span> Tags
|
||||
</a>
|
||||
<a
|
||||
href="files"
|
||||
class="btn btn-sm btn-info"
|
||||
|
|
|
|||
34
admin/static/views/tags.html
Normal file
34
admin/static/views/tags.html
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<div class="d-flex justify-content-between">
|
||||
<h2>Tags</h2>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover table-bordered table-striped table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>
|
||||
Tag
|
||||
</th>
|
||||
<th>
|
||||
Nb
|
||||
</th>
|
||||
<th>
|
||||
Exercices
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="(tag, exercices) in tags">
|
||||
<td>
|
||||
{{ tag }}
|
||||
</td>
|
||||
<td>
|
||||
{{ exercices.length }}
|
||||
</td>
|
||||
<td ng-repeat="e in exercices">
|
||||
<a ng-href="exercices/{{ e.id }}">
|
||||
{{ e.title }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in a new issue