From 87b19b2255d9726af4a2ff5acd2a0c1f57eea6bb Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sun, 2 Aug 2015 22:18:17 +0300 Subject: [PATCH] Tasks Page In The Making --- templates/js/controllers/tasksController.js | 25 +++-------- templates/views/tasks.html | 49 ++++++++++++--------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index c40af18..ab5e4be 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -6,24 +6,13 @@ angular.module('SeHub') $rootScope.seToken = $cookies['com.sehub.www']; var token = $rootScope.seToken; - $scope.createTaskClicked = function() { - $location.path("/tasks/new"); // Reference to 'newTask' page - } - - $scope.displayTasks = function() { - apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK - { - $scope.lecturerTasks = data; - console.log(data); - }).error(function(err) { - console.log(err.message); - }); - } - $scope.gotoTask = function(taskId) { - $location.path('/tasks/fill/' + taskId); - } - - $scope.displayTasks(); // Calling tasks with task id + $scope.user = $scope.$parent.user; + apiService.getAllUserTasks(token).success(function(data) { + $scope.tasks = data; + console.log(data); + }).error(function(err) { + console.log(err.message); + }); } diff --git a/templates/views/tasks.html b/templates/views/tasks.html index cac0a73..f162b9a 100644 --- a/templates/views/tasks.html +++ b/templates/views/tasks.html @@ -9,9 +9,9 @@
- + -

Class Name Tasks

+

{{class.courseName}} Tasks

@@ -60,28 +60,37 @@
-
- -
- Personal Task name -
-
-
3 / 70
-
- +
+
+
+ +
+ {{personalTask.title}} +
+
+
{{personalTask.submitted.done}} / {{personalTask.submitted.total}}
+
{{personalTask.grade.grade || "Not Yet Reviewed"}}
+
+ + +
+
- |
-
- -
- Project Task name +
+
+ + +
+ {{projectTask.title}} +
+
+
{{projectTask.submitted.done}} / {{projectTask.submitted.total}}
+
{{projectTask.grade.grade || "Not Yet Reviewed"}}
-
-
3 / 70
-
- + +