From ff9ea861317fa712f8ff31284640557c15dab82a Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 23 Jun 2015 19:40:30 +0300 Subject: [PATCH] - Files Added: myClasses, newcourse, projects, tasks --- .../js/controllers/myClassesController.js | 60 ++++++ .../js/controllers/newCourseController.js | 10 + .../js/controllers/projectsController.js | 16 ++ templates/js/controllers/tasksController.js | 17 ++ templates/views/home.html | 18 +- templates/views/myClasses.html | 186 ++++++++++++++++++ templates/views/newCourse.html | 6 + templates/views/projects.html | 6 + templates/views/tasks.html | 6 + 9 files changed, 316 insertions(+), 9 deletions(-) create mode 100644 templates/js/controllers/myClassesController.js create mode 100644 templates/js/controllers/newCourseController.js create mode 100644 templates/js/controllers/projectsController.js create mode 100644 templates/js/controllers/tasksController.js create mode 100644 templates/views/myClasses.html create mode 100644 templates/views/newCourse.html create mode 100644 templates/views/projects.html create mode 100644 templates/views/tasks.html diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js new file mode 100644 index 0000000..8ca5128 --- /dev/null +++ b/templates/js/controllers/myClassesController.js @@ -0,0 +1,60 @@ +angular.module('SeHub') +.controller('myClassesController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +{ + $scope.isStudent = false; + $scope.isCourse = false; + $scope.isNewCourse = false; + $scope.newClassName = false; + $scope.user.createNewCourse = ''; + $scope.user.finalDate = ''; + $scope.showMyClass = false; + + if($scope.user.isLecturer) + { + $scope.isStudent = false; + console.log("Lecturer Mode!"); + } + else + { + $scope.isStudent = true; + console.log("Student Mode!"); + } + + + $scope.chooseCourseClicked = function() + { + $scope.isCourse = true; + console.log("choose course Clicked!!"); + } + + $scope.createCourseClicked = function() + { + $scope.isNewCourse = true; + console.log("create course Clicked!!"); + } + + $scope.showMyCourses = function() + { + $scope.showMyClass = true; + } + + $scope.submitNewClassClicked = function() + { + if($scope.user.createNewCourse != '' && $scope.user.finalDate != '') + { + console.log("finalDate " + $scope.user.finalDate); + console.log($scope.user.createNewCourse); + $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 + { + $mdDialog.show($mdDialog.alert().title('Error - Creating Course').content('You have encountered and error in creating the course.') + .ariaLabel('Email verification alert dialog').ok('Try Again!').targetEvent()); + } + } + + + +}]); \ No newline at end of file diff --git a/templates/js/controllers/newCourseController.js b/templates/js/controllers/newCourseController.js new file mode 100644 index 0000000..f66f396 --- /dev/null +++ b/templates/js/controllers/newCourseController.js @@ -0,0 +1,10 @@ +angular.module('SeHub') +.controller('newCourseController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +{ + + $scope.goBack = function() + { + $window.location.href = 'templates/views/myClasses.html'; + } + +}]); \ No newline at end of file diff --git a/templates/js/controllers/projectsController.js b/templates/js/controllers/projectsController.js new file mode 100644 index 0000000..f074dc3 --- /dev/null +++ b/templates/js/controllers/projectsController.js @@ -0,0 +1,16 @@ +angular.module('SeHub') +.controller('projectsContoller', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +{ + console.log("in projects controller"); + + $scope.createProjectClicked = function() + { + console.log("project created! not rly!! "); + // $window.location.href = 'http://localhost:8080/home#/tasks/new'; // Reference to 'newTask' page + + } + + + + +}]); \ No newline at end of file diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js new file mode 100644 index 0000000..416dc63 --- /dev/null +++ b/templates/js/controllers/tasksController.js @@ -0,0 +1,17 @@ +angular.module('SeHub') +.controller('tasksController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +{ + console.log("in controller"); + + $scope.createTaskClicked = function(name) + { + var taskName = name; + console.log("task created! " + taskName); + $window.location.href = 'http://localhost:8080/home#/tasks/new'; // Reference to 'newTask' page + + } + + + + +}]); \ No newline at end of file diff --git a/templates/views/home.html b/templates/views/home.html index 980eaa6..39db020 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -114,52 +114,52 @@
- + Press On Me - + Press On Me - + Press On Me
- + Press On Me - + Press On Me - + Press On Me
- + Press On Me - + Press On Me - + Press On Me diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html new file mode 100644 index 0000000..de8a765 --- /dev/null +++ b/templates/views/myClasses.html @@ -0,0 +1,186 @@ + \ No newline at end of file diff --git a/templates/views/newCourse.html b/templates/views/newCourse.html new file mode 100644 index 0000000..03b9c60 --- /dev/null +++ b/templates/views/newCourse.html @@ -0,0 +1,6 @@ +
+ +

My New Course

+ Go Back +
+
\ No newline at end of file diff --git a/templates/views/projects.html b/templates/views/projects.html new file mode 100644 index 0000000..0c03cde --- /dev/null +++ b/templates/views/projects.html @@ -0,0 +1,6 @@ +
+ +

Projects

+ Create Project +
+
\ No newline at end of file diff --git a/templates/views/tasks.html b/templates/views/tasks.html new file mode 100644 index 0000000..7a9c87e --- /dev/null +++ b/templates/views/tasks.html @@ -0,0 +1,6 @@ +
+ +

Tasks

+ Create Task +
+
\ No newline at end of file