diff --git a/templates/css/theme.css b/templates/css/theme.css index c03dfb7..7653ec7 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -456,7 +456,7 @@ p.tasksFeed { padding-left: 4px; margin: 5px; - width:340; + width:99%; height: auto; background-color: aliceblue; @@ -465,7 +465,7 @@ p.messagesFeed { padding-left: 4px; margin: 5px; - width:690; + width:99%; height: auto; background-color: #f5f5f5; } \ No newline at end of file diff --git a/templates/js/controllers/campusesController.js b/templates/js/controllers/campusesController.js index 30f804b..d3d5219 100644 --- a/templates/js/controllers/campusesController.js +++ b/templates/js/controllers/campusesController.js @@ -1,6 +1,7 @@ angular.module('SeHub') .controller('campusesController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService, $rootScope) { + $scope.loadingData = true; $scope.campusesEmpty = false; var token = $cookies['com.sehub.www']; @@ -34,6 +35,7 @@ angular.module('SeHub') { apiService.getCampusesByUser(token).success(function(data) // Get all the campuses { + $scope.loadingData = true; $scope.campuses = data; console.log("INSIDE " + $scope.campuses); init(); // Executing the function to initialize campuses display diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 2d6bd34..9bcab36 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -34,16 +34,6 @@ angular.module('SeHub') console.log("Student Mode!"); } - // apiService.getCourseByCampusName(token).success(function(data) - // { - // console.log("Campus Name is ON! " + token) - // $scope.course = data; - // }).error(function(err) - // { - // console.log("Error ===> " + err + " ===> getCourseByCampusName") - // }); - - $scope.addMessageClicked = function() { $scope.addMsg = true; // Reveal the "POST" Button @@ -78,6 +68,37 @@ angular.module('SeHub') $scope.msg.msgToAdd = null; } + $scope.displayTasks = function() + { + // apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId + // { + + // }).error(function(err) + // { + + // }); + + + } + + $scope.getCourses = function() + { + // apiService.getAllCoursesByCampus(token, campusId).success(function(data) // Shows all classes from this campus + // { + // $scope.loadingData = false; + // $scope.courses = data; + // console.log("success " + $scope.courses); + // init(); // Executing the function to initialize course display + // if($scope.courses && $scope.courses.length > 0) + // { + // $scope.coursesEmpty = false; + // } + // }).error(function(err) + // { + // console.log("error: " + err); + // }); + } + $scope.clearAllClicked = function() // Clear Screen from text { $scope.messages = []; @@ -95,4 +116,6 @@ angular.module('SeHub') // animation $scope.isEnterd = top.setIsEnterd; + $scope.getCourses(); // Get all the courses info + $scope.displayTasks(); // Display all tasks in task feed }]); \ No newline at end of file diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 9aaca3b..2591b3c 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -131,7 +131,6 @@ angular.module('SeHub') init(); // Executing the function to initialize course display if($scope.courses && $scope.courses.length > 0) { - // $scope.coursesEmpty = true; $scope.coursesEmpty = false; } }).error(function(err) diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index 33196f4..cd4c459 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -3,10 +3,8 @@ angular.module('SeHub') { console.log("in controller"); - $scope.createTaskClicked = function(name) + $scope.createTaskClicked = function() { - var taskName = name; - console.log("task created! " + taskName); $location.path("/tasks/new"); // Reference to 'newTask' page } diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index d7697ef..81d9e7a 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -13,6 +13,14 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, + getUserById: function(token, id){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id; + req = { + method : "GET", + url : url + }; + return $http(req); + }, getAllCampuses: function(token){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getAll/" + token; req = { @@ -21,25 +29,11 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - sendValidationMail: function(token, email){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/validation/sendmail/" + token; - payload = { - email: email - }; + getCampusesByUser: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token; req = { - method: "POST", - url: url, - data: payload - }; - return $http(req); - }, - updateUser: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token; - - req = { - method: "PUT", - url: url, - data: payLoad + method : "GET", + url : url }; return $http(req); }, @@ -48,7 +42,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, @@ -57,7 +50,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, @@ -66,17 +58,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - - }; - return $http(req); - }, - createMessage: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token; - req = { - method : "POST", - url : url, - data: payLoad - }; return $http(req); }, @@ -85,25 +66,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - - }; - return $http(req); - }, - createCourse: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token; - req = { - method : "POST", - url : url, - data: payLoad - }; - return $http(req); - }, - getCampusesByUser: function(token){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token; - req = { - method : "GET", - url : url - }; return $http(req); }, @@ -112,7 +74,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, @@ -121,7 +82,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, @@ -135,16 +95,6 @@ service.factory('apiService', ['$http', function($http) { }, getProjectsByUser: function(token){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsByUser/" + token; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - - getUserById: function(token, id){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id; req = { method : "GET", url : url @@ -156,14 +106,21 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, - joinCourse: function(token, courseId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/joinCourse/" + token + "/" + courseId; + getCoursesByUserID: function(token, userId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId; req = { - method : "PUT", + method : "GET", + url : url + }; + return $http(req); + }, + getAllFutureTasks: function(token, courseId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token + "/" + courseId; + req = { + method : "GET", url : url }; return $http(req); @@ -186,13 +143,52 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - getCoursesByUserID: function(token, userId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId; + createMessage: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token; req = { - method : "GET", + method : "POST", + url : url, + data: payLoad + }; + return $http(req); + }, + sendValidationMail: function(token, email){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/validation/sendmail/" + token; + payload = { + email: email + }; + req = { + method: "POST", + url: url, + data: payload + }; + return $http(req); + }, + createCourse: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token; + req = { + method : "POST", + url : url, + data: payLoad + }; + return $http(req); + }, + joinCourse: function(token, courseId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/joinCourse/" + token + "/" + courseId; + req = { + method : "PUT", url : url }; return $http(req); + }, + updateUser: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token; + req = { + method: "PUT", + url: url, + data: payLoad + }; + return $http(req); } }; }]); \ No newline at end of file diff --git a/templates/views/campuses.html b/templates/views/campuses.html index b04f311..c3e680b 100644 --- a/templates/views/campuses.html +++ b/templates/views/campuses.html @@ -1,7 +1,5 @@
Submitted...
+Task Name | +Date | +Grade | +
---|
Not Submitted ..
Bla Bla Bla..
-