diff --git a/SE_API/Email_Utils.py b/SE_API/Email_Utils.py index 2939cc7..90f2ec4 100644 --- a/SE_API/Email_Utils.py +++ b/SE_API/Email_Utils.py @@ -125,3 +125,61 @@ def notify_se_hub_campus_request(campus, campus_name): """ message.send() + + +def send_task_reminder( email, name, task_name, course_name): + message = mail.EmailMessage(sender="SE-Hub Support ", + subject="Hey! Due Date for task " + task_name + " is TOMORROW!") + + message.to = email + + message.body = """ + Dear """+name+""": + + You Have A Task that Due tomorrow! don't forget to submit the task. + + Task name: """ + task_name + """ \n + In Course: """ + course_name + """ \n\n + + + http://se-hub.appspot.com + + + Please let us know if you have any questions. + + SE-Hub (c) 2015 niptop Team. + """ + + message.html = """ + +
+
+ + +
+
+
+

Dear """+name+""":

+ +
+ +
+
+ + You Have A Task that Due tomorrow! don't forget to submit the task.
+ + Task name: """ + task_name + """
+ In Course: """ + course_name + """
+
+ SE - Hub + +
+

+ Please let us know if you have any questions. +
+ SE-Hub (c) 2015 niptop Team. + + + """ + + message.send() diff --git a/SE_API/TaskRoutes.py b/SE_API/TaskRoutes.py index 3ac0c88..0ef57e5 100644 --- a/SE_API/TaskRoutes.py +++ b/SE_API/TaskRoutes.py @@ -403,7 +403,7 @@ def getAllFutureTasks(token):
""" - user = get_user_by_token + user = get_user_by_token(token) if user is None: return bad_request("Bad User Token") diff --git a/templates/android-icon-144x144.png b/templates/android-icon-144x144.png new file mode 100644 index 0000000..8c4aac7 Binary files /dev/null and b/templates/android-icon-144x144.png differ diff --git a/templates/android-icon-192x192.png b/templates/android-icon-192x192.png new file mode 100644 index 0000000..da41e19 Binary files /dev/null and b/templates/android-icon-192x192.png differ diff --git a/templates/android-icon-36x36.png b/templates/android-icon-36x36.png new file mode 100644 index 0000000..18dfb0f Binary files /dev/null and b/templates/android-icon-36x36.png differ diff --git a/templates/android-icon-48x48.png b/templates/android-icon-48x48.png new file mode 100644 index 0000000..a2ef791 Binary files /dev/null and b/templates/android-icon-48x48.png differ diff --git a/templates/android-icon-72x72.png b/templates/android-icon-72x72.png new file mode 100644 index 0000000..f552d73 Binary files /dev/null and b/templates/android-icon-72x72.png differ diff --git a/templates/android-icon-96x96.png b/templates/android-icon-96x96.png new file mode 100644 index 0000000..3e27476 Binary files /dev/null and b/templates/android-icon-96x96.png differ diff --git a/templates/apple-icon-114x114.png b/templates/apple-icon-114x114.png new file mode 100644 index 0000000..cf6a615 Binary files /dev/null and b/templates/apple-icon-114x114.png differ diff --git a/templates/apple-icon-120x120.png b/templates/apple-icon-120x120.png new file mode 100644 index 0000000..a6e44f7 Binary files /dev/null and b/templates/apple-icon-120x120.png differ diff --git a/templates/apple-icon-144x144.png b/templates/apple-icon-144x144.png new file mode 100644 index 0000000..8c4aac7 Binary files /dev/null and b/templates/apple-icon-144x144.png differ diff --git a/templates/apple-icon-152x152.png b/templates/apple-icon-152x152.png new file mode 100644 index 0000000..e669026 Binary files /dev/null and b/templates/apple-icon-152x152.png differ diff --git a/templates/apple-icon-180x180.png b/templates/apple-icon-180x180.png new file mode 100644 index 0000000..60a2a32 Binary files /dev/null and b/templates/apple-icon-180x180.png differ diff --git a/templates/apple-icon-57x57.png b/templates/apple-icon-57x57.png new file mode 100644 index 0000000..582780f Binary files /dev/null and b/templates/apple-icon-57x57.png differ diff --git a/templates/apple-icon-60x60.png b/templates/apple-icon-60x60.png new file mode 100644 index 0000000..561ea02 Binary files /dev/null and b/templates/apple-icon-60x60.png differ diff --git a/templates/apple-icon-72x72.png b/templates/apple-icon-72x72.png new file mode 100644 index 0000000..f552d73 Binary files /dev/null and b/templates/apple-icon-72x72.png differ diff --git a/templates/apple-icon-76x76.png b/templates/apple-icon-76x76.png new file mode 100644 index 0000000..ae249c9 Binary files /dev/null and b/templates/apple-icon-76x76.png differ diff --git a/templates/apple-icon-precomposed.png b/templates/apple-icon-precomposed.png new file mode 100644 index 0000000..02bbc41 Binary files /dev/null and b/templates/apple-icon-precomposed.png differ diff --git a/templates/apple-icon.png b/templates/apple-icon.png new file mode 100644 index 0000000..02bbc41 Binary files /dev/null and b/templates/apple-icon.png differ diff --git a/templates/browserconfig.xml b/templates/browserconfig.xml new file mode 100644 index 0000000..f6c2328 --- /dev/null +++ b/templates/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff \ No newline at end of file diff --git a/templates/css/theme.css b/templates/css/theme.css index ab99672..11ef815 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -127,6 +127,10 @@ body.noscroll margin-bottom: auto; } +.center_all{ + margin:auto; +} + .mail_suffix { margin-top: auto; diff --git a/templates/favicon-16x16.png b/templates/favicon-16x16.png new file mode 100644 index 0000000..7d08289 Binary files /dev/null and b/templates/favicon-16x16.png differ diff --git a/templates/favicon-32x32.png b/templates/favicon-32x32.png new file mode 100644 index 0000000..1f63b13 Binary files /dev/null and b/templates/favicon-32x32.png differ diff --git a/templates/favicon-96x96.png b/templates/favicon-96x96.png new file mode 100644 index 0000000..3e27476 Binary files /dev/null and b/templates/favicon-96x96.png differ diff --git a/templates/favicon.ico b/templates/favicon.ico new file mode 100644 index 0000000..ff1fc7f Binary files /dev/null and b/templates/favicon.ico differ diff --git a/templates/index.html b/templates/index.html index a94ff2e..3dce025 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,6 +1,23 @@ + + + + + + + + + + + + + + + + + diff --git a/templates/js/app.js b/templates/js/app.js index cb5558a..1bec6f8 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -48,11 +48,11 @@ app.config(['$routeProvider', '$locationProvider', templateUrl: 'templates/views/newTask.html', controller: 'newTasksController' }) - .when('/tasks/overview/:taskId/:submitterId', { + .when('/tasks/overview/:taskId/:submitterId/:gId', { templateUrl: 'templates/views/task.html', controller: 'taskController' }) - .when('/tasks/fill/:taskId', { + .when('/tasks/fill/:taskId/:gId', { templateUrl: 'templates/views/task.html', controller: 'taskController' }) diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 813f067..d269bdd 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -8,6 +8,7 @@ angular.module('SeHub') $scope.oldText = ""; $scope.messages = []; $scope.userMessages = []; + $scope.userTasks = []; $scope.messagesDisplay = []; $scope.courses = []; $scope.campuses = []; @@ -32,7 +33,7 @@ angular.module('SeHub') { apiService.getAllUserMessages(token).success(function(data) { - console.log(data); + // console.log(data); $scope.userMessages = data; }).error(function(err) { @@ -40,7 +41,7 @@ angular.module('SeHub') }); } - $scope.displayMessages(); // + // $scope.displayMessages(); // $scope.addMessageClicked = function() { @@ -64,10 +65,10 @@ angular.module('SeHub') }).error(function(err) { 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/'); } else @@ -78,25 +79,54 @@ angular.module('SeHub') $scope.msg.msgToAdd = null; } + $scope.gotoTask = function(task) + { + console.log(task); + if(task.isPersonal) + { + $location.path('/tasks/fill/' + task.id + '/' + $scope.user.id); + } + else // it's a project task + { + apiService.getProjectsByCourse(token, task.courseId).success(function(data) + { + console.log($scope.user); + for(var i = 0; i < $scope.user.projects_id_list.length; i++) + for(var j = 0; j < data.length; j++) + { + if($scope.user.projects_id_list[i] === data[j]) + { + $location.path('/tasks/fill/' + task.id + '/' + data[j].id); + } + } + }).error(function(err) + { + console.log(err.message); + }); + } + } + $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); }).error(function(err) { - + console.log(err.message); }); + } - // apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId - // { - // console.log("YE"); - // }).error(function(err) - // { - // console.log("Error: " + err.message); - // }); - + $scope.getProjects = function(courseId) + { + apiService.getProjectsByCourse(token, courseId).success(function(data) + { + return data; + }).error(function(err) + { + console.log(err.message); + }); } $scope.getCampuses = function() @@ -105,13 +135,13 @@ angular.module('SeHub') { $scope.campuses = data; $scope.getCourses(); // Get all the courses info - if($scope.messages) + if($scope.userMessages) { //$scope.displayMessages(); // // Display all messages in message feed and the latest one } }).error(function(err) { - console.log("Error: " + err.message); + console.log(err.message); }); } @@ -157,25 +187,6 @@ angular.module('SeHub') console.log($scope.courseObj); } - // $scope.chooseCourseClicked = function() - // { - // console.log("Click "); - // console.log($scope.choosenCourse); - // if($scope.choosenCourse) - // { - // console.log("here"); - // $scope.courseObj = null; - // for(var i = 0; i < $scope.courses.length; i++) - // { - // if($scope.courses[i].courseName === $scope.choosenCourse) - // { - // $scope.courseObj = $scope.courses[i]; - // console.log($scope.courseObj); - // } - // } - // } - // } - $scope.chooseProjectClicked = function() { console.log("choose project Clicked!!"); @@ -184,8 +195,13 @@ angular.module('SeHub') $scope.getCampuses(); // Get all the campuses info // animation + if($scope.userMessages) + { + $scope.displayMessages(); // // Display all messages in message feed and the latest one + } // $scope.displayMessages(); $scope.displayTasks(); // Display all tasks in task feed and the latest one + // $scope.getProjects(); // Get all projects info $scope.isEnterd = top.setIsEnterd; }]); \ No newline at end of file diff --git a/templates/js/controllers/mainController.js b/templates/js/controllers/mainController.js index b5e5632..04aae91 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -52,7 +52,6 @@ angular.module('SeHub') }]; dataService.initService($scope); //Start Data Sync Service (For User) - console.log(data); if ($scope.user.isFirstLogin) { $scope.menuObj = {}; $scope.isInRegisterMode = true; diff --git a/templates/js/controllers/newTasksController.js b/templates/js/controllers/newTasksController.js index e634291..8a029df 100644 --- a/templates/js/controllers/newTasksController.js +++ b/templates/js/controllers/newTasksController.js @@ -51,7 +51,7 @@ angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService' console.error(err); }) } else { - alert('Fill All Shit!'); + alert('Please Fill All Task info & At least one component'); } } @@ -64,6 +64,8 @@ angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService' return false; if (!$scope.task.date) return false; + if ($scope.task.components.length < 1) + return false; return true; } @@ -131,7 +133,7 @@ angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService' $scope.compDetails = [{ detail: "Label" }, { - detail: "URL Path" + detail: "URL Path (You Need To Include 'http://'" }]; if (type === 'radiobuttons') diff --git a/templates/js/controllers/taskController.js b/templates/js/controllers/taskController.js index 4133f05..e29a493 100644 --- a/templates/js/controllers/taskController.js +++ b/templates/js/controllers/taskController.js @@ -6,12 +6,24 @@ angular.module('SeHub') var taskId = $routeParams.taskId; var submitterId = $routeParams.submitterId; + var token = $cookies['com.sehub.www']; + var groupId = $routeParams.gId; + $scope.loading = true; + apiService.getTaskById(token, taskId, groupId).success(function(data) { + $scope.task = data; + $scope.dateInit($scope.task.dueDate); + $scope.loading = false; + }).error(function(err) { + $location.path('/tasks'); + }) if (submitterId) { //In This Case we Only Want to show The Content of the Submitter $scope.readOnly = true; + } else { //In This Case We Need An Empty Task To Be Able To Fill It $scope.readOnly = false; + apiService.getTaskById(token, taskId, groupId); } $scope.dateInit = function(date) { @@ -61,8 +73,23 @@ angular.module('SeHub') $scope.submitTask = function(event) { //Dialog will pop-up if not all mandatory fields are filled if (validateComponents()) { - alert('All Shit Are Filled'); - return; + apiService.submitTask(token, taskId, groupId, $scope.task.components).success(function(data) { + $mdDialog.show( + $mdDialog.alert() + .title('Submitted!') + .content('Your Task Was Successfully Submitted!') + .ariaLabel('ddd') + .ok('GoTo My Submitted Task') + .then(function(dd){ + if($scope.task.isPersonal) + $location.path('/tasks/overview/'+taskId+'/'+groupId+'/'+groupId); + else + $location.path('/tasks/overview/'+taskId+'/'+groupId+'/'+groupId); + }) + .targetEvent(event) + ); + }) + } $mdDialog.show( $mdDialog.alert() @@ -81,35 +108,35 @@ angular.module('SeHub') = Mock Data = =================================*/ - $scope.task = { - "title": "task1", - "courseId": 1234567890, - "description": "one line\nsecondline\nthirdline", - "dueDate": { - "year": 2010, - "month": 2, - "day": 4 - }, - "isPersonal": true, - "components": [{ - "type": "radiobuttons", - "label": "pick One|this|orthis|MaybeThis", - "isMandatory": true, - "order": 1 - }, { - "type": "checkbox", - "label": "tick Me", - "isMandatory": true, - "order": 2 - }, { - "type": "textarea", - "label": "fill shit", - "isMandatory": false, - "order": 3 - }] - }; + // $scope.task = { + // "title": "task1", + // "courseId": 1234567890, + // "description": "one line\nsecondline\nthirdline", + // "dueDate": { + // "year": 2010, + // "month": 2, + // "day": 4 + // }, + // "isPersonal": true, + // "components": [{ + // "type": "radiobuttons", + // "label": "pick One|this|orthis|MaybeThis", + // "isMandatory": true, + // "order": 1 + // }, { + // "type": "checkbox", + // "label": "tick Me", + // "isMandatory": true, + // "order": 2 + // }, { + // "type": "textarea", + // "label": "fill shit", + // "isMandatory": false, + // "order": 3 + // }] + // }; + - $scope.dateInit($scope.task.dueDate); $scope.dueTime = function() { if (!$scope.task.date || $scope.task.date === '') diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index cd4c459..1642c3b 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -1,14 +1,32 @@ 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.lecturerTasks = []; + $rootScope.seToken = $cookies['com.sehub.www']; + var token = $rootScope.seToken; $scope.createTaskClicked = function() { $location.path("/tasks/new"); // Reference to 'newTask' page } + $scope.displayTasks = function() + { + apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK + { + $scope.lecturerTasks = data; + console.log(data); + }).error(function(err) + { + console.log(err.message); + }); + } + $scope.gotoTask = function(taskId) + { + $location.path('/tasks/fill/' + taskId); + } + $scope.displayTasks(); // Calling tasks with task id }]); \ No newline at end of file diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index 505ed15..329d3ce 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -197,8 +197,8 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - getAllFutureTasks: function(token, courseId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureCampusTasks/" + token + "/" + courseId; + getAllFutureTasks: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token; req = { method: "GET", url: url @@ -245,6 +245,24 @@ service.factory('apiService', ['$http', function($http) { url: url }; return $http(req); + }, + getTaskById: function(token, taskId, ownerId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getTaskById/" + token + "/" + taskId + "/" + ownerId; + var req = { + method: 'GET', + url: url + }; + return $http(req); + + }, + submitTask: function(token, taskId, ownerId, payload){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/submitTask/" + token + '/' + taskId + '/' + ownerId; + req = { + method: 'POST', + data: payload, + url: url + }; + return $http(req); } }; }]); \ No newline at end of file diff --git a/templates/manifest.json b/templates/manifest.json new file mode 100644 index 0000000..013d4a6 --- /dev/null +++ b/templates/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "App", + "icons": [ + { + "src": "\/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/templates/ms-icon-144x144.png b/templates/ms-icon-144x144.png new file mode 100644 index 0000000..8c4aac7 Binary files /dev/null and b/templates/ms-icon-144x144.png differ diff --git a/templates/ms-icon-150x150.png b/templates/ms-icon-150x150.png new file mode 100644 index 0000000..dcf672a Binary files /dev/null and b/templates/ms-icon-150x150.png differ diff --git a/templates/ms-icon-310x310.png b/templates/ms-icon-310x310.png new file mode 100644 index 0000000..cb0da26 Binary files /dev/null and b/templates/ms-icon-310x310.png differ diff --git a/templates/ms-icon-70x70.png b/templates/ms-icon-70x70.png new file mode 100644 index 0000000..e3a3de7 Binary files /dev/null and b/templates/ms-icon-70x70.png differ diff --git a/templates/views/home.html b/templates/views/home.html index 316c0c4..2d924c4 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -25,123 +25,64 @@

Dash Board

- -
-
- Closest Task- - -
- In Course: {{tasks[0].courseName}} -
-
-
-
- Latest Message- - - {{userMessages[0].message}} - -
-
- - - -
-
+
- +
-
- -
-
-
- {{msg.user.username}} + +
+
-
- {{msg.group.courseName}} -

- {{msg.group.projectName}} + + +
+
+ {{msg.user.username}} +
+
+ {{msg.group.courseName}} + {{msg.group.projectName}} +
-
-
- {{msg.message}} -
+ + +
+ {{msg.message}} +
+
- - - - + - - + - + -

Tasks

-
- -
+ +
+ Title: + + {{task.title}} + +

+ Description: {{task.description}} +
+
- +
@@ -171,75 +112,104 @@
-
- -
-
- -

Messages

-
-
-
- -

Tasks

-
-
+
+
+ Closest Task- + +
+ + {{userTasks[0].title}} + +
+
-
-
- -
- -
-
-
- -
-
-
-
- {{user.name}} +
+ Latest Message- + + {{userMessages[0].message}} + +
+
+ + +
+ + + + + +
+
+
-
- class_name +
+
+ {{msg.user.username}} +
+
+ {{msg.group.courseName}} + {{msg.group.projectName}} +
+
+
+ {{msg.message}}
+ + + + + + + + +
+ Title: + + {{task.title}} + +

+ Description: {{task.description}}
-
-
-
- {{msg.text}} -
-
-
-
-
- + + + + +
-
- -

- For Task 3 Press: Task #3 -

- For Task 4 Press: Task #4 -

- For Task 5 Press: Task #5 -

- For Task 6 Press: Task #6 -

- For Task 7 Press: Task #7 -

- For Task 8 Press: Task #8 -

-
+ +
+
+ +
+
+
+
+ Post + Clear All +
+
+
+
+ + + + +
+
+ + {{c.courseName}} +
- - - - +
\ No newline at end of file diff --git a/templates/views/task.html b/templates/views/task.html index 760a2fb..b682860 100644 --- a/templates/views/task.html +++ b/templates/views/task.html @@ -1,4 +1,7 @@ -
+
+ +
+
diff --git a/templates/views/tasks.html b/templates/views/tasks.html index 2279260..a405511 100644 --- a/templates/views/tasks.html +++ b/templates/views/tasks.html @@ -24,8 +24,13 @@ -

Not Submitted

-

Not Submitted ..

+ + + {{task.title}} + + + +