qa: Add todo list on home page
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a237936feb
commit
42d594ccac
5 changed files with 159 additions and 1 deletions
|
|
@ -90,6 +90,12 @@ angular.module("FICApp")
|
|||
.factory("Version", function($resource) {
|
||||
return $resource("/api/version")
|
||||
})
|
||||
.factory("Todo", function($resource) {
|
||||
return $resource("/api/qa_work.json")
|
||||
})
|
||||
.factory("TodoWorked", function($resource) {
|
||||
return $resource("/api/qa_mywork.json")
|
||||
})
|
||||
.factory("Team", function($resource) {
|
||||
return $resource("/api/teams/:teamId", { teamId: '@id' }, {
|
||||
'update': {method: 'PUT'},
|
||||
|
|
@ -216,6 +222,20 @@ angular.module("FICApp")
|
|||
$scope.v = Version.get();
|
||||
})
|
||||
|
||||
.controller("ToDoController", function($scope, Todo, TodoWorked, $location) {
|
||||
$scope.todos = Todo.query();
|
||||
$scope.tododone = {}
|
||||
$scope.work = TodoWorked.query(function(tw) {
|
||||
tw.forEach(function(t) {
|
||||
$scope.tododone[t.id_exercice] = t
|
||||
})
|
||||
});
|
||||
|
||||
$scope.show = function(id) {
|
||||
$location.url("/exercices/" + id);
|
||||
};
|
||||
})
|
||||
|
||||
.controller("ThemesListController", function($scope, Theme, $location, $rootScope, $http) {
|
||||
$scope.themes = Theme.query();
|
||||
$scope.fields = ["name", "authors", "headline"];
|
||||
|
|
@ -286,6 +306,13 @@ angular.module("FICApp")
|
|||
};
|
||||
})
|
||||
|
||||
.controller("MyTodoExerciceController", function($scope, Exercice, ExerciceQA, Theme) {
|
||||
$scope.mytheme = null
|
||||
$scope.myexercice = Exercice.get({ exerciceId: $scope.todo.id_exercice }, function(e) {
|
||||
$scope.mytheme = Theme.get({ themeId: e.id_theme })
|
||||
});
|
||||
})
|
||||
|
||||
.controller("ExerciceController", function($scope, $rootScope, Exercice, ThemedExercice, $routeParams, $location, $http) {
|
||||
if ($routeParams.themeId && $routeParams.exerciceId == "new") {
|
||||
$scope.exercice = new ThemedExercice();
|
||||
|
|
|
|||
Reference in a new issue