From 1fa62cad31f4f092a3424147fab194beb37eccf5 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Sun, 2 Aug 2015 13:45:42 +0300 Subject: [PATCH] -updates in progress --- SE_API/TaskRoutes.py | 2 +- templates/js/controllers/homeController.js | 19 ++++++++++--------- templates/js/controllers/mainController.js | 1 - templates/js/services/apiService.js | 4 ++-- templates/views/home.html | 22 +++++++++++++--------- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/SE_API/TaskRoutes.py b/SE_API/TaskRoutes.py index c587901..0725bfd 100644 --- a/SE_API/TaskRoutes.py +++ b/SE_API/TaskRoutes.py @@ -318,7 +318,7 @@ def getAllFutureTasks(token):
""" - user = get_user_by_token + user = get_user_by_token(token) if user is None: return bad_request("Bad User Token") diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 813f067..c147948 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -8,6 +8,7 @@ angular.module('SeHub') $scope.oldText = ""; $scope.messages = []; $scope.userMessages = []; + $scope.userTasks = []; $scope.messagesDisplay = []; $scope.courses = []; $scope.campuses = []; @@ -32,7 +33,7 @@ angular.module('SeHub') { apiService.getAllUserMessages(token).success(function(data) { - console.log(data); + // console.log(data); $scope.userMessages = data; }).error(function(err) { @@ -40,7 +41,7 @@ angular.module('SeHub') }); } - $scope.displayMessages(); // + // $scope.displayMessages(); // $scope.addMessageClicked = function() { @@ -64,10 +65,10 @@ angular.module('SeHub') }).error(function(err) { console.log("Error Below"); - console.log(err); + console.log(err.message); }); - $scope.messages.push({"text": $scope.msg.msgToAdd}); + $scope.userMessages.push({"text": $scope.msg.msgToAdd}); $location.path('/home/'); } else @@ -80,13 +81,13 @@ angular.module('SeHub') $scope.displayTasks = function() { - apiService.getAllUserTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK + apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK { - $scope.tasks = data; + $scope.userTasks = data; console.log(data); }).error(function(err) { - + console.log(err.message); }); // apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId @@ -111,7 +112,7 @@ angular.module('SeHub') } }).error(function(err) { - console.log("Error: " + err.message); + console.log(err.message); }); } @@ -184,7 +185,7 @@ angular.module('SeHub') $scope.getCampuses(); // Get all the campuses info // animation - // $scope.displayMessages(); + $scope.displayMessages(); $scope.displayTasks(); // Display all tasks in task feed and the latest one $scope.isEnterd = top.setIsEnterd; diff --git a/templates/js/controllers/mainController.js b/templates/js/controllers/mainController.js index b5e5632..04aae91 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -52,7 +52,6 @@ angular.module('SeHub') }]; dataService.initService($scope); //Start Data Sync Service (For User) - console.log(data); if ($scope.user.isFirstLogin) { $scope.menuObj = {}; $scope.isInRegisterMode = true; diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index 1b0c030..d230027 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -197,8 +197,8 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - getAllFutureTasks: function(token, courseId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureCampusTasks/" + token + "/" + courseId; + getAllFutureTasks: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token; req = { method: "GET", url: url diff --git a/templates/views/home.html b/templates/views/home.html index 316c0c4..83b9b31 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -31,7 +31,7 @@ Closest Task-
- In Course: {{tasks[0].courseName}} + In Course: {{userTasks[0].courseName}}
@@ -101,7 +101,11 @@ {{msg.message}} - + + + + + - - - - - +

Tasks

-
+ +
+ {{task.courseName}} +
+
-
+