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/js/controllers/newTasksController.js b/templates/js/controllers/newTasksController.js index c348a31..8a029df 100644 --- a/templates/js/controllers/newTasksController.js +++ b/templates/js/controllers/newTasksController.js @@ -133,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 979bfe2..e29a493 100644 --- a/templates/js/controllers/taskController.js +++ b/templates/js/controllers/taskController.js @@ -8,12 +8,14 @@ angular.module('SeHub') 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){ + apiService.getTaskById(token, taskId, groupId).success(function(data) { $scope.task = data; $scope.dateInit($scope.task.dueDate); - }).error(function(err){ - console.error('Error: ', err); + $scope.loading = false; + }).error(function(err) { + $location.path('/tasks'); }) if (submitterId) { //In This Case we Only Want to show The Content of the Submitter @@ -71,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() @@ -119,7 +136,7 @@ angular.module('SeHub') // }] // }; - + $scope.dueTime = function() { if (!$scope.task.date || $scope.task.date === '') diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index 8e042fb..706e85a 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -254,6 +254,15 @@ service.factory('apiService', ['$http', function($http) { }; 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/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 @@ -
+
+ +
+