diff --git a/templates/css/theme.css b/templates/css/theme.css index 092a58a..b697697 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -197,6 +197,18 @@ body.noscroll border-radius: 1px black solid; }*/ + .allCampusesShow + { + overflow:hidden; + background-size: auto; + + } + .campusCard + { + /*height:80%;*/ + /*width:80%;*/ + } + .gray-font { color: #7f7f7f; @@ -397,6 +409,11 @@ body.noscroll border-color: solid red; } +.cardAllCampuses +{ + word-break: break-word; +} + .addMessage { font-size: 2em; diff --git a/templates/js/app.js b/templates/js/app.js index 1ab2ed6..4ecf22f 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -61,6 +61,14 @@ app.config(['$routeProvider', '$locationProvider', .when('/newCourse', { templateUrl: 'templates/views/newCourse.html', controller: 'newCourseController' + }) + .when('/campuses', { + templateUrl: 'templates/views/campuses.html', + controller: 'campusesController' + }) + .when('/thisProject', { + templateUrl: 'templates/views/thisProject.html', + controller: 'thisProjectController' }); } ]); diff --git a/templates/js/controllers/campusesController.js b/templates/js/controllers/campusesController.js new file mode 100644 index 0000000..e1d796b --- /dev/null +++ b/templates/js/controllers/campusesController.js @@ -0,0 +1,17 @@ +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.campuses = ['Bezalel', 'Ben Gurion', 'Sami Shamoon', 'Afeka', 'Ivrit', 'Kaka', 'Opium']; + console.log($scope.campuses); + + // apiService.getCampusesByUser(token).success(function(data) // Get all the campuses + // { + // $scope.campuses = data; + // }).error(function() { + // // TODO + // }); + +}]); \ No newline at end of file diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 58c7c10..4dd0251 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -35,13 +35,13 @@ angular.module('SeHub') console.log("Student Mode!"); } - // apiService.getCourseByCampusName($scope.user.classes_id_list[0]).success(function(data) + // apiService.getCourseByCampusName(token).success(function(data) // { - // console.log("Campus Name is ON! " + $scope.user.classes_id_list[0]) + // console.log("Campus Name is ON! " + token) // $scope.course = data; - // }).error(function() + // }).error(function(err) // { - // console.log("Error on ===> getCourseByCampusName") + // console.log("Error ===> " + err + " ===> getCourseByCampusName") // }); diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 879dcbb..e4d69d6 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -5,8 +5,10 @@ angular.module('SeHub') $scope.isCourse = false; $scope.isNewCourse = false; $scope.newClassName = false; - $scope.user.createNewCourse = ''; + $scope.course = {}; + var token = $cookies['com.sehub.www']; $scope.user.finalDate = ''; + $scope.user.startDate = ''; $scope.showMyClass = false; if($scope.user.isLecturer) @@ -21,6 +23,17 @@ angular.module('SeHub') } + $scope.courses = ['SE', 'PC', 'Math', 'Calculus', 'Ivrit', 'English', 'Drugs']; + + + // apiService.getClassesByUser(token).success(function(data) // Get all the campuses + // { + // $scope.courses = data; + // }).error(function() { + // // TODO + // }); + + $scope.chooseCourseClicked = function() { $scope.isCourse = true; @@ -29,26 +42,45 @@ angular.module('SeHub') $scope.createCourseClicked = function() { - $scope.isNewCourse = true; - $scope.showMyClass = false; - console.log("create course Clicked!!"); - } - - $scope.showMyCourses = function() - { - $scope.showMyClass = true; - $scope.isNewCourse = false; + $scope.isNewCourse = !$scope.isNewCourse; } $scope.submitNewClassClicked = function() { - if($scope.user.createNewCourse != '' && $scope.user.finalDate != '') + if($scope.course.courseName != '' && $scope.course.endDate != '' && $scope.course.startDate != '') { - console.log("finalDate " + $scope.user.finalDate); - console.log($scope.user.createNewCourse); + var jsonNewCourse = + { + 'courseName': $scope.course.courseName, + 'campusName': $scope.course.campusName, + 'startDate': { + 'year' : $scope.course.startDate.getFullYear(), + 'day' : $scope.course.startDate.getDate(), + 'month': ($scope.course.startDate.getMonth() + 1) + }, + 'endDate': { + 'year' : $scope.course.endDate.getFullYear(), + 'day' : $scope.course.endDate.getDate(), + 'month': ($scope.course.endDate.getMonth() + 1) + } + }; + + console.log("Json here:"); + console.log(jsonNewCourse); + + apiService.createCourse(token, jsonNewCourse).success(function(data) + { + console.log("createCourse API done"); + }).error(function(err) + { + console.log(err); + }); $mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.') - .ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent()); - // $window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO + .ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent()) + .then(function() { + $window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO + }); // Pop-up alert + } else { diff --git a/templates/js/controllers/projectsController.js b/templates/js/controllers/projectsController.js index 7336919..617a7a5 100644 --- a/templates/js/controllers/projectsController.js +++ b/templates/js/controllers/projectsController.js @@ -10,7 +10,14 @@ angular.module('SeHub') } + $scope.projects = ['AMI', 'LULU', 'XIN Zhau', 'LUMI lu', 'Shimi', 'Azligi zligi', 'Drugs']; + // apiService.getProjectsByCourse(courseId).success(function(data) // Get all the campuses + // { + // $scope.projects = data; + // }).error(function() { + // // TODO + // }); }]); \ No newline at end of file diff --git a/templates/js/controllers/registerController.js b/templates/js/controllers/registerController.js index 4ded290..589c5fd 100644 --- a/templates/js/controllers/registerController.js +++ b/templates/js/controllers/registerController.js @@ -14,26 +14,26 @@ angular.module('SeHub') var token = $rootScope.seToken; apiService.getUserByToken(token).success(function(data) // Get user token - { - $scope.user = data; + { + $scope.user = data; - if (data.message == 'No User Found') - console.error("No User Found!"); - console.log(data); + if (data.message == 'No User Found') + console.error("No User Found!"); + console.log(data); - if ($scope.user.name === ";") { - $scope.user.name = ""; - $scope.user.name = $scope.user.username; - $scope.userHasNoName = true; - } + if ($scope.user.name === ";") { + $scope.user.name = ""; + $scope.user.name = $scope.user.username; + $scope.userHasNoName = true; + } - apiService.getAllCampuses(token).success(function(data) // Get all the campuses - { - $scope.campuses = data; - }).error(function() { - // TODO - }); + apiService.getAllCampuses(token).success(function(data) // Get all the campuses + { + $scope.campuses = data; + }).error(function() { + // TODO }); + }); $scope.dropdownClicked = function() { if ($scope.campus) { diff --git a/templates/js/controllers/thisProjectController.js b/templates/js/controllers/thisProjectController.js new file mode 100644 index 0000000..a1cb837 --- /dev/null +++ b/templates/js/controllers/thisProjectController.js @@ -0,0 +1,16 @@ +angular.module('SeHub') +.controller('thisProjectController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +{ + $scope.isEditPressed = false; + + $scope.editPressed = function() + { + $scope.isEditPressed = true; + console.log("EditPressed " + $scope.isEditPressed); + } + $scope.removeProject = function() + { + console.log("Project has been removed!"); + } + +}]); \ No newline at end of file diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index c1a95fa..e619186 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -71,7 +71,7 @@ service.factory('apiService', ['$http', function($http) { return $http(req); }, createMessage: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCourseMessages/" + token; + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token; req = { method : "POST", url : url, @@ -80,8 +80,45 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - getCourseMessages: function(token, courseName){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCourseMessages/" + token + '/' + courseName; + getMessagesByCourseName: function(token, courseName){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getMessagesByCourseName/" + token + '/' + courseName; + 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(){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCampusesByUser/" + token; + req = { + method : "GET", + url : url + + }; + return $http(req); + }, + getClassesByCourse: function(){ // Need to add camusName (ngRoute) ~ sagi //TODO + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/ClassesByCourse/" + token; + req = { + method : "GET", + url : url + + }; + return $http(req); + }, + getProjectsByCourse: function(){ // Need to add courseID (ngRoute) ~ sagi //TODO + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getProjectByCourse/" + token; req = { method : "GET", url : url diff --git a/templates/views/campuses.html b/templates/views/campuses.html new file mode 100644 index 0000000..8d0ddf8 --- /dev/null +++ b/templates/views/campuses.html @@ -0,0 +1,16 @@ +
+ +

My Campuses

+
+ + + +
\ No newline at end of file diff --git a/templates/views/index.html b/templates/views/index.html index f978bb1..03ff1ee 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -116,6 +116,8 @@ + + \ No newline at end of file diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index de8a765..c3f333c 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -2,54 +2,51 @@

My Classes

+ +
+
+ + + {{course}} + + +
+
+
+
Create Class
-
- Show My Classes -
- - - - - - - - - - -
-
- - - - - - - - -
-
- - - - - - - - -
- - - - -
+ +
+
+ + + + +
+
+ + + + + + + + + + + + +
+
+
Submit New Class @@ -61,91 +58,6 @@ {{c.course}}
-
diff --git a/templates/views/projects.html b/templates/views/projects.html index 0c03cde..f67486e 100644 --- a/templates/views/projects.html +++ b/templates/views/projects.html @@ -1,6 +1,17 @@
+

Projects

+ + + -

Projects

Create Project
\ No newline at end of file diff --git a/templates/views/tasks.html b/templates/views/tasks.html index 7a9c87e..e90e8c5 100644 --- a/templates/views/tasks.html +++ b/templates/views/tasks.html @@ -1,6 +1,42 @@

Tasks

- Create Task +
+ Create Task +
+ +
+ + + + + +

Tab One

+

Commits...

+
+
+ + +

Tab Two

+

Issues...

+
+
+ + +

Tab Three

+

Bugs Bugs Bugs..

+
+
+ + +

Tab Two

+

Bla Bla Bla..

+
+
+
+
+ +
+
\ No newline at end of file diff --git a/templates/views/thisProject.html b/templates/views/thisProject.html new file mode 100644 index 0000000..98694f4 --- /dev/null +++ b/templates/views/thisProject.html @@ -0,0 +1,36 @@ +
+ +

{{user.name}}'s project

+
+
+
+ Project Creator: {{user.name}} +
+
+
+
+
+ Edit +
+
+ +
+
+
+
+
+
+
+ + Here Will Be Graph - Commits Over Period Of Time + +
+
+ + Here Will Be Graph (by columns) - Commits, Issues, Open Tasks + +
+
+
+
+
\ No newline at end of file