-updates in progress

This commit is contained in:
Matan Bar Yosef 2015-08-02 13:45:42 +03:00
parent 1ec0a41463
commit 1fa62cad31
5 changed files with 26 additions and 22 deletions

View file

@ -318,7 +318,7 @@ def getAllFutureTasks(token):
<br> <br>
""" """
user = get_user_by_token user = get_user_by_token(token)
if user is None: if user is None:
return bad_request("Bad User Token") return bad_request("Bad User Token")

View file

@ -8,6 +8,7 @@ angular.module('SeHub')
$scope.oldText = ""; $scope.oldText = "";
$scope.messages = []; $scope.messages = [];
$scope.userMessages = []; $scope.userMessages = [];
$scope.userTasks = [];
$scope.messagesDisplay = []; $scope.messagesDisplay = [];
$scope.courses = []; $scope.courses = [];
$scope.campuses = []; $scope.campuses = [];
@ -32,7 +33,7 @@ angular.module('SeHub')
{ {
apiService.getAllUserMessages(token).success(function(data) apiService.getAllUserMessages(token).success(function(data)
{ {
console.log(data); // console.log(data);
$scope.userMessages = data; $scope.userMessages = data;
}).error(function(err) }).error(function(err)
{ {
@ -40,7 +41,7 @@ angular.module('SeHub')
}); });
} }
$scope.displayMessages(); // // $scope.displayMessages(); //
$scope.addMessageClicked = function() $scope.addMessageClicked = function()
{ {
@ -64,10 +65,10 @@ angular.module('SeHub')
}).error(function(err) }).error(function(err)
{ {
console.log("Error Below"); 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/'); $location.path('/home/');
} }
else else
@ -80,13 +81,13 @@ angular.module('SeHub')
$scope.displayTasks = function() $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); console.log(data);
}).error(function(err) }).error(function(err)
{ {
console.log(err.message);
}); });
// apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId // apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId
@ -111,7 +112,7 @@ angular.module('SeHub')
} }
}).error(function(err) }).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 $scope.getCampuses(); // Get all the campuses info
// animation // animation
// $scope.displayMessages(); $scope.displayMessages();
$scope.displayTasks(); // Display all tasks in task feed and the latest one $scope.displayTasks(); // Display all tasks in task feed and the latest one
$scope.isEnterd = top.setIsEnterd; $scope.isEnterd = top.setIsEnterd;

View file

@ -52,7 +52,6 @@ angular.module('SeHub')
}]; }];
dataService.initService($scope); //Start Data Sync Service (For User) dataService.initService($scope); //Start Data Sync Service (For User)
console.log(data);
if ($scope.user.isFirstLogin) { if ($scope.user.isFirstLogin) {
$scope.menuObj = {}; $scope.menuObj = {};
$scope.isInRegisterMode = true; $scope.isInRegisterMode = true;

View file

@ -197,8 +197,8 @@ service.factory('apiService', ['$http', function($http) {
}; };
return $http(req); return $http(req);
}, },
getAllFutureTasks: function(token, courseId){ getAllFutureTasks: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureCampusTasks/" + token + "/" + courseId; var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token;
req = { req = {
method: "GET", method: "GET",
url: url url: url

View file

@ -31,7 +31,7 @@
Closest Task- Closest Task-
<md-card layout-margin layout-padding> <md-card layout-margin layout-padding>
<div> <div>
In Course: {{tasks[0].courseName}} In Course: {{userTasks[0].courseName}}
</div> </div>
</md-card> </md-card>
</div> </div>
@ -101,7 +101,11 @@
{{msg.message}} {{msg.message}}
</div> </div>
</div> </div>
</md-card>
</md-content>
<!-- </div> -->
</md-content>
</md-tab>
<!-- <div flex layout="column"> <!-- <div flex layout="column">
<div flex = 30 class="md-avatar" layout-padding layout-margin> <div flex = 30 class="md-avatar" layout-padding layout-margin>
@ -123,17 +127,17 @@
</div> --> </div> -->
</md-card>
</md-content>
<!-- </div> -->
</md-content>
</md-tab>
<md-tab label="Tasks"> <md-tab label="Tasks">
<md-content class="md-padding"> <md-content class="md-padding">
<h1 class="md-display-2">Tasks</h1> <h1 class="md-display-2">Tasks</h1>
<div> <md-card ng-repeat = "task in userTasks">
<div>
{{task.courseName}}
</div>
</md-card>
</div>
</md-content> </md-content>
</md-tab> </md-tab>
<md-tab label="two"> <md-tab label="two">