From f26472ba5bbb06f1bab9da68b47ee08429e4321b Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 12:52:44 +0300 Subject: [PATCH 01/37] #64 #35 New Task Tweaks --- templates/views/newTask.html | 71 +++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/templates/views/newTask.html b/templates/views/newTask.html index aa62983..7fc293d 100644 --- a/templates/views/newTask.html +++ b/templates/views/newTask.html @@ -1,6 +1,7 @@
+

Task Info:

@@ -28,45 +29,47 @@
-
-
- Submit -
+
+
+ Submit +
+ +
+ +
+

+ Add A component: +

+
+
+ Select Type: + + {{component.type}} + +
+
+ + + + +
+
+ + Mandatory?: {{ newComp.isMandatory}} + +
+
+
+ Add To Task +
+
+
-
- -
-

- Add A component: -

-
-
- Select Type: - - {{component.type}} - -
-
- - - - -
-
- - Mandatory?: {{ newComp.isMandatory}} - -
-
-
- Add To Task -
-
-
+
From d32b09b7126f8bceb631608a4bd3dfdb28898f48 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 13:07:17 +0300 Subject: [PATCH 02/37] Fixed Token Issue in Register Controller --- templates/js/controllers/registerController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/js/controllers/registerController.js b/templates/js/controllers/registerController.js index 279fddd..6656f1d 100644 --- a/templates/js/controllers/registerController.js +++ b/templates/js/controllers/registerController.js @@ -30,7 +30,7 @@ angular.module('SeHub') $scope.userHasNoName = true; } - apiService.getAllCampuses($scope.user.seToken).success(function(data) // Get all the campuses + apiService.getAllCampuses(token).success(function(data) // Get all the campuses { $scope.campuses = data; }).error(function() @@ -78,7 +78,7 @@ angular.module('SeHub') console.log("Mail: " + fullMail); - apiService.sendValidationMail($scope.user.seToken, fullMail).success(function(data) + apiService.sendValidationMail(token, fullMail).success(function(data) { console.log("DONE - 200"); $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') @@ -123,7 +123,7 @@ angular.module('SeHub') if(result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked { console.log("Im good"); - apiService.sendValidationMail($scope.user.seToken, email).success(function(data) + apiService.sendValidationMail(token, email).success(function(data) { console.log("DONE - 200"); $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') From 38ae45aa959751d68a2c7185f2a43ae757e256f8 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Wed, 24 Jun 2015 13:13:58 +0300 Subject: [PATCH 03/37] - add choose project from dashboard --- templates/js/controllers/settingsController.js | 1 - templates/js/services/apiService.js | 13 +++++++++++-- templates/views/home.html | 15 +++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/templates/js/controllers/settingsController.js b/templates/js/controllers/settingsController.js index 35c9531..c1a7724 100644 --- a/templates/js/controllers/settingsController.js +++ b/templates/js/controllers/settingsController.js @@ -22,7 +22,6 @@ angular.module('SeHub') $scope.loadingData = false; $location.path('/register') } - }); $scope.isEditMode = false; diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index d6d1a03..f8a877e 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -47,8 +47,7 @@ service.factory('apiService', ['$http', function($http) { var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token; req = { method : "GET", - url : url, - data: token + url : url }; return $http(req); @@ -71,6 +70,16 @@ 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; + req = { + method : "POST", + url : url, + data: payLoad + + }; + return $http(req); + }, getCourseMessages: function(token, courseName){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCourseMessages/" + token + '/' + courseName; req = { diff --git a/templates/views/home.html b/templates/views/home.html index 39db020..dcce1b2 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -99,10 +99,17 @@ Clear All
- - - - +
+
+ + + + +
+
+ +
+
From 23d287e59ac0aed474628f45dd7244bfdec33819 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 13:16:19 +0300 Subject: [PATCH 04/37] POST -> PUT in update user --- templates/js/services/apiService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index d6d1a03..92871d4 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -37,7 +37,7 @@ service.factory('apiService', ['$http', function($http) { var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token; req = { - method: "POST", + method: "PUT", url: url, data: payLoad }; From 5f53e3ff850b9404e874de98257217460f8231e4 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 13:28:27 +0300 Subject: [PATCH 05/37] Fixing Register POPUP --- .../js/controllers/registerController.js | 235 ++++++++---------- 1 file changed, 110 insertions(+), 125 deletions(-) diff --git a/templates/js/controllers/registerController.js b/templates/js/controllers/registerController.js index 6656f1d..4ded290 100644 --- a/templates/js/controllers/registerController.js +++ b/templates/js/controllers/registerController.js @@ -1,141 +1,126 @@ angular.module('SeHub') -.controller('registerController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) -{ - $scope.userHasNoName = false; - $scope.campusChecked = false; - $scope.createCampusClicked = false; - $scope.isEmpty = true; // if the academic email line is empty - $scope.jsonCreateCampus = - { - "title": "Create Campus", - "email": "email_ending", - "avatar": "self.avatar.url" - } - - $rootScope.seToken = $cookies['com.sehub.www']; - var token = $rootScope.seToken; - - apiService.getUserByToken(token).success(function(data) // Get user token - { - $scope.user = 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; + .controller('registerController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService, $rootScope) { + $scope.userHasNoName = false; + $scope.campusChecked = false; + $scope.createCampusClicked = false; + $scope.isEmpty = true; // if the academic email line is empty + $scope.jsonCreateCampus = { + "title": "Create Campus", + "email": "email_ending", + "avatar": "self.avatar.url" } - apiService.getAllCampuses(token).success(function(data) // Get all the campuses - { - $scope.campuses = data; - }).error(function() - { - // TODO - }); - }); + $rootScope.seToken = $cookies['com.sehub.www']; + var token = $rootScope.seToken; - $scope.dropdownClicked = function() - { - if($scope.campus){ - $scope.campusChecked = true; - $scope.campusObj = null; - for (var i = $scope.campuses.length - 1; i >= 0; i--) { - if($scope.campuses[i].title == $scope.campus){ - $scope.campusObj = $scope.campuses[i]; - console.log($scope.campusObj); // TODO REMOVE!! + apiService.getUserByToken(token).success(function(data) // Get user token + { + $scope.user = 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; } + + apiService.getAllCampuses(token).success(function(data) // Get all the campuses + { + $scope.campuses = data; + }).error(function() { + // TODO + }); + }); + + $scope.dropdownClicked = function() { + if ($scope.campus) { + $scope.campusChecked = true; + $scope.campusObj = null; + for (var i = $scope.campuses.length - 1; i >= 0; i--) { + if ($scope.campuses[i].title == $scope.campus) { + $scope.campusObj = $scope.campuses[i]; + console.log($scope.campusObj); // TODO REMOVE!! + } + }; + }; + + }; + + $scope.submitClicked = function(ev) { + var emailValid = false; + + if ($scope.user.AcMail != null) { + var fullMail = $scope.user.AcMail + $scope.campusObj.email_ending; // Holds the full academic email of the user + + apiService.updateUser(token, $scope.user).success(function(data) { + + }).error(function() { + // TODO Error + console.log("Error occured on updateUser"); + }); + + console.log("Mail: " + fullMail); + + apiService.sendValidationMail(token, fullMail).success(function(data) { + console.log("DONE - 200"); + $mdDialog + .show($mdDialog.alert().title('E-mail Verification') + .content('A verification e-mail has been sent to your email address.') + .ariaLabel('Email verification alert dialog') + .ok('Got it!') + .targetEvent(ev)) + .then(function() { + // TODO ADD- delete cookies and redirect only after pressed 'Got it' + $cookieStore.remove("com.sehub.www"); // Removing the cookies + $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page + + }); // Pop-up alert for e-mail verification + }).error(function() { + $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') + .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(ev)); + }); + } else // TODO Fix when success to show mdDialog until 'Got it' clicked + { + $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') + .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(ev)); }; }; - }; + $scope.createCampus = function(ev) { + $scope.createCampusClicked = true; - $scope.submitClicked = function(ev) - { - var emailValid = false; - var jsonUpdateUser = - { - "lecturerStat": "$scope.user.isLecturer", - "campName": "$scope.campusName" - } - - if($scope.user.AcMail != null) - { - var fullMail = $scope.user.AcMail + $scope.campusObj.email_ending; // Holds the full academic email of the user - - apiService.updateUser($scope.user.seToken, jsonUpdateUser).success(function(data) + if (!$scope.isLecturer) // "!isLecturer" Means => I Am Lecturer; if i am a lecturer (when pressing -> getting last data value before pressing) { - - }).error(function() - { - // TODO Error - console.log("Error occured on updateUser"); - }); - - console.log("Mail: " + fullMail); - - apiService.sendValidationMail(token, fullMail).success(function(data) - { - console.log("DONE - 200"); - $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') - .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification - // TODO ADD- delete cookies and redirect only after pressed 'Got it' - $cookieStore.remove("com.sehub.www"); // Removing the cookies - $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page - }).error(function() - { - $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') - .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(ev)); - }); - } - else // TODO Fix when success to show mdDialog until 'Got it' clicked - { - $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') - .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(ev)); - }; - }; - - $scope.createCampus = function(ev) - { - $scope.createCampusClicked = true; - - if(!$scope.isLecturer) // "!isLecturer" Means => I Am Lecturer; if i am a lecturer (when pressing -> getting last data value before pressing) - { - if($scope.user.campusMail != null) - { - validateEmail($scope.user.campusMail); // Verify the email according to "xxx@name.suffix" + if ($scope.user.campusMail != null) { + validateEmail($scope.user.campusMail); // Verify the email according to "xxx@name.suffix" + } } } - } - validateEmail = function(email) - { - var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; - if (!result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked - { - $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') - .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); - } - if(result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked - { - console.log("Im good"); - apiService.sendValidationMail(token, email).success(function(data) + validateEmail = function(email) { + var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; + if (!result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked { - console.log("DONE - 200"); - $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') - .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(email)); // Pop-up alert for e-mail verification - // TODO ADD delete cookies and redirect only after pressed 'Got it' - $cookieStore.remove("com.sehub.www"); // Removing the cookies - $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page - }).error(function() + $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') + .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); + } + if (result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked { - $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address or in the campus name.') - .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); - }); + console.log("Im good"); + apiService.sendValidationMail(token, email).success(function(data) { + console.log("DONE - 200"); + $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') + .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(email)); // Pop-up alert for e-mail verification + // TODO ADD delete cookies and redirect only after pressed 'Got it' + $cookieStore.remove("com.sehub.www"); // Removing the cookies + $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page + }).error(function() { + $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address or in the campus name.') + .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); + }); + } } - } -}]); + }]); \ No newline at end of file From 049c36c9169ea471e6582c34272d119bba5be920 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 13:42:32 +0300 Subject: [PATCH 06/37] Fixed HRef --- templates/js/controllers/tasksController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index 416dc63..705ddb2 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -7,7 +7,7 @@ angular.module('SeHub') { var taskName = name; console.log("task created! " + taskName); - $window.location.href = 'http://localhost:8080/home#/tasks/new'; // Reference to 'newTask' page + $location.path("/tasks/new"); // Reference to 'newTask' page } From ba5939c4378d37704d0ed54b2ca3871494e2f096 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Wed, 24 Jun 2015 14:01:08 +0300 Subject: [PATCH 07/37] - Create course api -fixed --- .../js/controllers/myClassesController.js | 36 ++++++++++++++++--- templates/js/services/apiService.js | 16 +++++++-- templates/views/myClasses.html | 26 ++++++-------- 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 879dcbb..d043e37 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -5,8 +5,11 @@ angular.module('SeHub') $scope.isCourse = false; $scope.isNewCourse = false; $scope.newClassName = false; - $scope.user.createNewCourse = ''; + // $scope.course.courseName = ''; + $scope.course = {}; + var token = $cookies['com.sehub.www']; $scope.user.finalDate = ''; + $scope.user.startDate = ''; $scope.showMyClass = false; if($scope.user.isLecturer) @@ -42,13 +45,38 @@ angular.module('SeHub') $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 + } else { diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index f8a877e..6c45506 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,12 +80,22 @@ 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); } diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index de8a765..5086fbd 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -27,28 +27,24 @@
- - + + - + + + + + - +
- - - - - - - + + +
- - - -
From a942f7e486e7257fbb75f9d683a4a68aa12863df Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 24 Jun 2015 17:27:20 +0300 Subject: [PATCH 08/37] New Task UI Tweak --- templates/views/newTask.html | 127 ++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/templates/views/newTask.html b/templates/views/newTask.html index 7fc293d..7d5e10c 100644 --- a/templates/views/newTask.html +++ b/templates/views/newTask.html @@ -1,75 +1,76 @@
-
+
-

- Task Info: -

-
-
- - - - -
-
- - - -
-
- - This Is: a {{(task.isPersonal) ? "Personal" : "Project"}} Task - -
-
- Due Date: - - - -
-
-
+

+ Task Info: +

+
- Submit + + + + +
+
+ + + + +
+
+ + This Is: a {{(task.isPersonal) ? "Personal" : "Project"}} Task + +
+
+ Due Date: + + + +
+
+
+
+ Submit +
-
- -
- -
-

- Add A component: -

-
-
- Select Type: - - {{component.type}} - -
-
- - - - -
-
- - Mandatory?: {{ newComp.isMandatory}} - -
-
-
- Add To Task -
-
-
+ +
+ +
+

+ Add A component: +

+
+
+ Select Type: + + {{component.type}} + +
+
+ + + + +
+
+ + Mandatory?: {{ newComp.isMandatory}} + +
+
+
+ Add To Task +
+
+
-
+
From 0cce80ed982644ee3089b4432421ddf81cda30d9 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Wed, 24 Jun 2015 21:35:21 +0300 Subject: [PATCH 09/37] - Campuses -> Courses -> Projects -* waiting for merge to get API from server --- templates/css/theme.css | 17 ++ templates/js/app.js | 4 + templates/js/controllers/homeController.js | 8 +- .../js/controllers/myClassesController.js | 28 ++-- .../js/controllers/projectsController.js | 7 + .../js/controllers/registerController.js | 32 ++-- templates/js/services/apiService.js | 28 ++++ templates/views/index.html | 1 + templates/views/myClasses.html | 156 ++++-------------- templates/views/projects.html | 16 +- 10 files changed, 144 insertions(+), 153 deletions(-) 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..2210b47 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -61,6 +61,10 @@ app.config(['$routeProvider', '$locationProvider', .when('/newCourse', { templateUrl: 'templates/views/newCourse.html', controller: 'newCourseController' + }) + .when('/campuses', { + templateUrl: 'templates/views/campuses.html', + controller: 'campusesController' }); } ]); 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 d043e37..e4d69d6 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -5,7 +5,6 @@ angular.module('SeHub') $scope.isCourse = false; $scope.isNewCourse = false; $scope.newClassName = false; - // $scope.course.courseName = ''; $scope.course = {}; var token = $cookies['com.sehub.www']; $scope.user.finalDate = ''; @@ -24,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; @@ -32,15 +42,7 @@ 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() @@ -74,8 +76,10 @@ angular.module('SeHub') 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/services/apiService.js b/templates/js/services/apiService.js index d3356b4..c80b38e 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -96,6 +96,34 @@ service.factory('apiService', ['$http', function($http) { 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 + }; return $http(req); } diff --git a/templates/views/index.html b/templates/views/index.html index f978bb1..d168b4d 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -116,6 +116,7 @@ + \ No newline at end of file diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index 5086fbd..c3f333c 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -2,50 +2,51 @@

My Classes

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

Projects

+ + + + + -

Projects

Create Project
\ No newline at end of file From e2bd575ca7b5579b2b77b9cdab41e4a5d5b4ca7a Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Wed, 24 Jun 2015 21:35:55 +0300 Subject: [PATCH 10/37] - Campuses -> Courses -> Projects (Addition) -* waiting for merge to get API from server --- templates/js/controllers/campusesController.js | 17 +++++++++++++++++ templates/views/campuses.html | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 templates/js/controllers/campusesController.js create mode 100644 templates/views/campuses.html 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/views/campuses.html b/templates/views/campuses.html new file mode 100644 index 0000000..96d5734 --- /dev/null +++ b/templates/views/campuses.html @@ -0,0 +1,16 @@ +
+ +

My Campuses

+
+ + + +
\ No newline at end of file From 559d235bc9cce60385024fc91c6b6b18979e0109 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Wed, 24 Jun 2015 22:43:02 +0300 Subject: [PATCH 11/37] - thisProject Added - Tasks tab system - Added --- templates/js/app.js | 4 ++ .../js/controllers/thisProjectController.js | 16 ++++++++ templates/js/services/apiService.js | 1 - templates/views/campuses.html | 8 ++-- templates/views/index.html | 1 + templates/views/projects.html | 5 +-- templates/views/tasks.html | 38 ++++++++++++++++++- templates/views/thisProject.html | 36 ++++++++++++++++++ 8 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 templates/js/controllers/thisProjectController.js create mode 100644 templates/views/thisProject.html diff --git a/templates/js/app.js b/templates/js/app.js index 2210b47..4ecf22f 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -65,6 +65,10 @@ app.config(['$routeProvider', '$locationProvider', .when('/campuses', { templateUrl: 'templates/views/campuses.html', controller: 'campusesController' + }) + .when('/thisProject', { + templateUrl: 'templates/views/thisProject.html', + controller: 'thisProjectController' }); } ]); 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 c80b38e..e619186 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -108,7 +108,6 @@ service.factory('apiService', ['$http', function($http) { }; 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 = { diff --git a/templates/views/campuses.html b/templates/views/campuses.html index 96d5734..8d0ddf8 100644 --- a/templates/views/campuses.html +++ b/templates/views/campuses.html @@ -2,11 +2,11 @@

My Campuses

- -
-
+ +
+
- + {{campus}} diff --git a/templates/views/index.html b/templates/views/index.html index d168b4d..03ff1ee 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -117,6 +117,7 @@ + \ No newline at end of file diff --git a/templates/views/projects.html b/templates/views/projects.html index d894468..f67486e 100644 --- a/templates/views/projects.html +++ b/templates/views/projects.html @@ -1,10 +1,9 @@
-

Projects

- - Create Project 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 From e3fe428900ae0a934f7a595693e58debe05fc55e Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Thu, 25 Jun 2015 00:04:04 +0300 Subject: [PATCH 12/37] API: getUserByToken returs user id now --- models/User.py | 3 ++- .../{settingsController.js => profileController.js} | 4 ++-- templates/views/{settings.html => profile.html} | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename templates/js/controllers/{settingsController.js => profileController.js} (94%) rename templates/views/{settings.html => profile.html} (100%) diff --git a/models/User.py b/models/User.py index d3bb545..bb60c2b 100644 --- a/models/User.py +++ b/models/User.py @@ -27,6 +27,7 @@ class User(db.Model): 'campusName': self.campusName, 'campuses_id_list': self.campuses_id_list, 'courses_id_list': self.courses_id_list, - 'projects_id_list': self.projects_id_list + 'projects_id_list': self.projects_id_list, + 'id' : self.key().id() } return json.dumps(data) diff --git a/templates/js/controllers/settingsController.js b/templates/js/controllers/profileController.js similarity index 94% rename from templates/js/controllers/settingsController.js rename to templates/js/controllers/profileController.js index c1a7724..6f8fd18 100644 --- a/templates/js/controllers/settingsController.js +++ b/templates/js/controllers/profileController.js @@ -1,5 +1,5 @@ angular.module('SeHub') - .controller('settingsController', ['$scope', '$rootScope', 'dataService', 'apiService', '$cookies', '$location', + .controller('profileController', ['$scope', '$rootScope', 'dataService', 'apiService', '$cookies', '$location', function($scope, $rootScope, dataService, apiService, $cookies, $location) { var token = $cookies['com.sehub.www']; @@ -7,7 +7,7 @@ angular.module('SeHub') $scope.loadingData = true; $scope.isInRegisterMode = false; - $scope.title = "Settings" + $scope.title = "Profile" apiService.getUserByToken(token).success(function(data) { if (data.message == 'No User Found') { diff --git a/templates/views/settings.html b/templates/views/profile.html similarity index 100% rename from templates/views/settings.html rename to templates/views/profile.html From e135ee020a178c79665baca34557c8dae63d3869 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Thu, 25 Jun 2015 00:10:08 +0300 Subject: [PATCH 13/37] Changed settings into profile. + in controller --- templates/js/app.js | 6 +- templates/js/controllers/mainController.js | 79 ++++++++++--------- templates/js/controllers/profileController.js | 11 ++- templates/views/index.html | 2 +- templates/views/profile.html | 2 +- 5 files changed, 54 insertions(+), 46 deletions(-) diff --git a/templates/js/app.js b/templates/js/app.js index 4ecf22f..99a5e63 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -38,9 +38,9 @@ app.config(['$routeProvider', '$locationProvider', templateUrl: 'templates/views/home.html', controller: 'homeController' }) - .when('/Settings', { - templateUrl: 'templates/views/settings.html', - controller: 'settingsController' + .when('/profile/:id', { + templateUrl: 'templates/views/profile.html', + controller: 'profileController' }) .when('/tasks', { templateUrl: 'templates/views/tasks.html', diff --git a/templates/js/controllers/mainController.js b/templates/js/controllers/mainController.js index f2e7e1e..5cfa78f 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -1,5 +1,7 @@ angular.module('SeHub') - .controller('mainController', ['$scope', '$rootScope', 'dataService','apiService', '$cookies', '$cookieStore', '$location', '$window', + .controller('mainController', + ['$scope', '$rootScope', 'dataService', 'apiService', '$cookies', + '$cookieStore', '$location', '$window', function($scope, $rootScope, dataService, apiService, $cookies, $cookieStore, $location, $window) { top.setIsEnterd = true; @@ -14,6 +16,44 @@ angular.module('SeHub') } $scope.loadingData = false; $scope.user = data; + + $scope.menuItems = [{ + "title": "Dash Board", + "icon": "fa fa-tachometer", + "style": "selected", + "route": "/home" + }, { + "title": "My Campuses", + "icon": "fa fa-university", + "style": "", + "route": "/campuses" + }, { + "title": "My Classes", + "icon": "fa fa-graduation-cap", + "style": "", + "route": "/myClasses" + }, { + "title": "My Projects", + "icon": "fa fa-cube", + "style": "", + "route": "/projects" + }, { + "title": "Tasks", + "icon": "fa fa-clipboard", + "style": "", + "route": "/tasks" + }, { + "title": "Profile", + "icon": "fa fa-cogs", + "style": "", + "route": "/profile/" + $scope.user.id.toString() + }, { + "title": "Log Out", + "icon": "fa fa-power-off", + "style": "", + "route": "/logout" + }]; + dataService.initService($scope); //Start Data Sync Service (For User) console.log(data); if ($scope.user.isFirstLogin) { @@ -27,44 +67,7 @@ angular.module('SeHub') }); - - $scope.menuItems = [{ - "title": "Dash Board", - "icon": "fa fa-tachometer", - "style": "selected", - "route": "/home" - }, { - "title": "My Campuses", - "icon": "fa fa-university", - "style": "", - "route": "/campuses" - }, { - "title": "My Classes", - "icon": "fa fa-graduation-cap", - "style": "", - "route": "/myClasses" - }, { - "title": "My Projects", - "icon": "fa fa-cube", - "style": "", - "route": "/projects" - }, { - "title": "Tasks", - "icon": "fa fa-clipboard", - "style": "", - "route": "/tasks" - }, { - "title": "Settings", - "icon": "fa fa-cogs", - "style": "", - "route": "/Settings" - }, { - "title": "Log Out", - "icon": "fa fa-power-off", - "style": "", - "route": "/logout" - }]; $scope.menuClicked = function(item) { var route = "" diff --git a/templates/js/controllers/profileController.js b/templates/js/controllers/profileController.js index 6f8fd18..40ce310 100644 --- a/templates/js/controllers/profileController.js +++ b/templates/js/controllers/profileController.js @@ -1,13 +1,14 @@ angular.module('SeHub') - .controller('profileController', ['$scope', '$rootScope', 'dataService', 'apiService', '$cookies', '$location', - function($scope, $rootScope, dataService, apiService, $cookies, $location) { + .controller('profileController', ['$scope', '$rootScope', 'dataService', 'apiService', + '$cookies', '$location', '$routeParams', + function($scope, $rootScope, dataService, apiService, $cookies, $location, $routeParams) { var token = $cookies['com.sehub.www']; $scope.loadingData = true; $scope.isInRegisterMode = false; - $scope.title = "Profile" + $scope.title = "Profile " + $routeParams.id; apiService.getUserByToken(token).success(function(data) { if (data.message == 'No User Found') { @@ -15,6 +16,7 @@ angular.module('SeHub') } $scope.loadingData = false; $scope.user = data; + console.log(data); if ($scope.user.isFirstLogin) { $scope.menuObj = {}; @@ -87,6 +89,9 @@ angular.module('SeHub') [28, 48, 40, 3] ]; + $scope.isUser = function(){ + return $scope.user.id.toString() === $routeParams.id; + } } ]); \ No newline at end of file diff --git a/templates/views/index.html b/templates/views/index.html index 03ff1ee..f719a34 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -109,7 +109,7 @@ - + diff --git a/templates/views/profile.html b/templates/views/profile.html index c90b019..2b2a26e 100644 --- a/templates/views/profile.html +++ b/templates/views/profile.html @@ -15,7 +15,7 @@
- + {{profileMode}}
From 2a55d7f89871e8f09c9c67a3bfd2086a39b995ca Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Thu, 25 Jun 2015 20:45:43 +0300 Subject: [PATCH 14/37] API Doc Fix --- SE_API/API.py | 8 ++++---- templates/API_Doc/api_doc_index.html | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SE_API/API.py b/SE_API/API.py index 136e6b0..25e2045 100644 --- a/SE_API/API.py +++ b/SE_API/API.py @@ -137,12 +137,12 @@ def send_activation(token): return Response(status=200) @app.route('/api/help') -def documentation(): +def documentation_index(): return app.send_static_file('API_Doc/api_doc_index.html') -# @app.route('/api/help/campuses') -# def documentation(): -# return auto.html() +@app.route('/api/help/misc') +def documentation_misc(): + return auto.html() @app.route('/home') def returnHome(): diff --git a/templates/API_Doc/api_doc_index.html b/templates/API_Doc/api_doc_index.html index ff55e84..a1077de 100644 --- a/templates/API_Doc/api_doc_index.html +++ b/templates/API_Doc/api_doc_index.html @@ -63,6 +63,7 @@
  • Tasks Related API
  • Validation Related API
  • +
  • Miscellaneous Methods
  • From 2f870ba0500fae56b37ce47e7624b3629eea7c4d Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Thu, 25 Jun 2015 22:40:26 +0300 Subject: [PATCH 15/37] #68 Added Link & RadioButtons components to Task generator --- .../js/controllers/newTasksController.js | 98 +++++++++++++++++-- templates/views/newTask.html | 30 +++++- 2 files changed, 116 insertions(+), 12 deletions(-) diff --git a/templates/js/controllers/newTasksController.js b/templates/js/controllers/newTasksController.js index 12967b1..be7922d 100644 --- a/templates/js/controllers/newTasksController.js +++ b/templates/js/controllers/newTasksController.js @@ -1,6 +1,8 @@ angular.module('SeHub').controller('newTasksController', ['$scope', function($scope) { + $scope.newComp = {}; + $scope.newComp.isMandatory = false; $scope.componentTypes = [{ @@ -9,25 +11,105 @@ angular.module('SeHub').controller('newTasksController', ['$scope', "type": "textarea" }, { "type": "checkbox" + }, { + "type": "link" + }, { + "type": "radiobuttons" }]; $scope.task = {}; $scope.task.task = {}; - $scope.task.components= []; - $scope.task.isPersonal = false; + $scope.task.components = []; + $scope.task.isPersonal = false; // $scope.task = []; $scope.addComponent = function() { - $scope.task.components.push($scope.newComp); + var comp = {}; + var type = $scope.newComp.type; + comp.type = type; + comp.isMandatory = $scope.newComp.isMandatory; + comp.label = ""; + var i = 0 + if (!(type === 'textbox' || type === 'textarea' || type === 'checkbox')) + while ($scope.newComp.label[i]) { + comp.label += $scope.newComp.label[i] + "|"; + i++; + } else + comp.label = $scope.newComp.label[i]; + + console.log(comp); + $scope.task.components.push(comp); + + // console.log($scope.newComp); $scope.newComp = {}; + $scope.newComp.isMandatory = false; + $scope.compDetails = []; + $scope.isRadioButton = false; } - $scope.dueTime = function(){ - if(!$scope.task.date || $scope.task.date === '') - $scope.dueTimeFromNow = ""; - var d = new Date($scope.task.date); - $scope.dueTimeFromNow = moment(d).fromNow(); + $scope.ComponentType = function(type) { + if (type === 'textbox' || type === 'textarea' || type === 'checkbox') + $scope.compDetails = [{ + detail: "Label" + }]; + else if (type === 'radiobuttons') { + $scope.compDetails = [{ + detail: "Label" + }]; + $scope.compDetails.push({ + detail: "Option" + $scope.compDetails.length + ": " + }); + } else if (type === 'link') + $scope.compDetails = [{ + detail: "Label" + }, { + detail: "URL Path" + }]; + + if (type === 'radiobuttons') + $scope.isRadioButton = true; + else + $scope.isRadioButton = false; } + + $scope.addMoreOptions = function() { + $scope.compDetails.push({ + detail: "Option" + $scope.compDetails.length + ": " + }); + } + + $scope.dueTime = function() { + if (!$scope.task.date || $scope.task.date === '') + $scope.dueTimeFromNow = ""; + var d = new Date($scope.task.date); + $scope.dueTimeFromNow = moment(d).fromNow(); + } + + $scope.initLinkComp = function(component){ + var arr = component.label.split("|"); + for (var i = 0; i < arr.length - 1; i++) { + if(i == 0) + component.title = arr[i]; + else + component.href = arr[i]; + }; + } + + $scope.initRadioButtonsComp = function(component){ + var arr = component.label.split("|"); + component.values = []; + for (var i = 0; i < arr.length - 1; i++) { + if(i == 0) + component.title = arr[i]; + else + component.values.push({text: arr[i], id: i}); + }; + } + + $scope.RB = function(comp){ + console.info(comp); + } + } ]); \ No newline at end of file diff --git a/templates/views/newTask.html b/templates/views/newTask.html index 7d5e10c..e9ae941 100644 --- a/templates/views/newTask.html +++ b/templates/views/newTask.html @@ -46,16 +46,21 @@
    Select Type: - + {{component.type}}
    - - - + + +
    +
    + + Add An Option + +
    Mandatory?: {{ newComp.isMandatory}} @@ -84,6 +89,9 @@

    {{ dueTimeFromNow }}

    {{task.task.description}}

    {{(task.isPersonal) ? "Personal" : "Project"}} Task

    + + +
    @@ -105,6 +113,20 @@ {{ component.label}}
    + +
    + + {{component.title}} + +
    + +
    + {{component.title}} + + {{option.text}} + +
    +
    From 9d49ba5f0aee5adebaafaee917039215016dfb54 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Fri, 26 Jun 2015 14:08:23 +0300 Subject: [PATCH 16/37] #72 - cleand up main menu & added ID to routes --- templates/js/app.js | 4 ++-- templates/js/controllers/mainController.js | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/templates/js/app.js b/templates/js/app.js index 99a5e63..bb9af14 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -46,7 +46,7 @@ app.config(['$routeProvider', '$locationProvider', templateUrl: 'templates/views/tasks.html', controller: 'tasksController' }) - .when('/myClasses', { + .when('/myClasses/:campusId', { templateUrl: 'templates/views/myClasses.html', controller: 'myClassesController' }) @@ -54,7 +54,7 @@ app.config(['$routeProvider', '$locationProvider', templateUrl: 'templates/views/newTask.html', controller: 'newTasksController' }) - .when('/projects', { + .when('/projects/:classId', { templateUrl: 'templates/views/projects.html', controller: 'projectsController' }) diff --git a/templates/js/controllers/mainController.js b/templates/js/controllers/mainController.js index 5cfa78f..b9ac448 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -22,21 +22,16 @@ angular.module('SeHub') "icon": "fa fa-tachometer", "style": "selected", "route": "/home" - }, { - "title": "My Campuses", - "icon": "fa fa-university", + }, { + "title": "Courses", + "icon": "fa fa-graduation-cap", "style": "", "route": "/campuses" }, { - "title": "My Classes", - "icon": "fa fa-graduation-cap", - "style": "", - "route": "/myClasses" - }, { - "title": "My Projects", + "title": "Projects", "icon": "fa fa-cube", "style": "", - "route": "/projects" + "route": "/myClasses" }, { "title": "Tasks", "icon": "fa fa-clipboard", From 42210f73d577d9c443e3c72bb4b51e118b5c8016 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Fri, 26 Jun 2015 14:52:33 +0300 Subject: [PATCH 17/37] API Docs - index UI --- templates/API_Doc/api_doc_index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/API_Doc/api_doc_index.html b/templates/API_Doc/api_doc_index.html index a1077de..e1b4ae1 100644 --- a/templates/API_Doc/api_doc_index.html +++ b/templates/API_Doc/api_doc_index.html @@ -54,8 +54,8 @@ SE-Hub Docs Index - -
    +
    +
    • Users Related API
    • Campuses Related API
    • @@ -66,7 +66,7 @@
    • Miscellaneous Methods
    - +