Merge branch 'master' of https://github.com/sagidayan/SE-Hub into UI
This commit is contained in:
commit
f63a7c7b70
1 changed files with 55 additions and 10 deletions
|
@ -23,7 +23,11 @@ angular.module('SeHub')
|
||||||
parent: $scope,
|
parent: $scope,
|
||||||
targetEvent: ev,
|
targetEvent: ev,
|
||||||
locals: {
|
locals: {
|
||||||
data: {task: task, token: token, isPersonal: isPersonal}
|
data: {
|
||||||
|
task: task,
|
||||||
|
token: token,
|
||||||
|
isPersonal: isPersonal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function(answer) {
|
.then(function(answer) {
|
||||||
|
@ -42,13 +46,54 @@ angular.module('SeHub')
|
||||||
ownerId = $scope.user.projects_id_list[j];
|
ownerId = $scope.user.projects_id_list[j];
|
||||||
}
|
}
|
||||||
apiService.isTaskSubmitted(token, task.id, ownerId).success(function(data) {
|
apiService.isTaskSubmitted(token, task.id, ownerId).success(function(data) {
|
||||||
if (data.submitted)
|
if (data.submitted) {
|
||||||
|
if (ownerId)
|
||||||
$location.path('/tasks/overview/' + task.id + '/' + ownerId + '/' + ownerId);
|
$location.path('/tasks/overview/' + task.id + '/' + ownerId + '/' + ownerId);
|
||||||
else
|
else {
|
||||||
|
$mdDialog.show(
|
||||||
|
$mdDialog.alert()
|
||||||
|
.title('You Have No Project in this class')
|
||||||
|
.content('To Be Able To Fill A Project Task you need to be assigned to a project')
|
||||||
|
.ariaLabel('ddd')
|
||||||
|
.ok('Ok, ill join/create a project')
|
||||||
|
.targetEvent(event)
|
||||||
|
|
||||||
|
).then(function() {
|
||||||
|
$location.path('/campuses');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ownerId)
|
||||||
$location.path('/tasks/fill/' + task.id + '/' + ownerId);
|
$location.path('/tasks/fill/' + task.id + '/' + ownerId);
|
||||||
})
|
else {
|
||||||
|
$mdDialog.show(
|
||||||
|
$mdDialog.alert()
|
||||||
|
.title('You Have No Project in this class')
|
||||||
|
.content('To Be Able To Fill A Project Task you need to be assigned to a project')
|
||||||
|
.ariaLabel('ddd')
|
||||||
|
.ok('Ok, ill join/create a project')
|
||||||
|
.targetEvent(event)
|
||||||
|
|
||||||
|
).then(function() {
|
||||||
|
$location.path('/campuses');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).error(function(err) {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
}).error(function(err) {
|
}).error(function(err) {
|
||||||
console.error('Error: ', err);
|
console.error('Error: ', err);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
apiService.isTaskSubmitted(token, task.id, $scope.user.id).success(function(data) {
|
||||||
|
if (data.submitted) {
|
||||||
|
$location.path('/tasks/overview/' + task.id + '/' + $scope.user.id + '/' + $scope.user.id);
|
||||||
|
} else {
|
||||||
|
$location.path('/tasks/fill/' + task.id + '/' + $scope.user.id);
|
||||||
|
}
|
||||||
|
}).error(function(err) {
|
||||||
|
console.error(err);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue