Tasks Page In The Making

This commit is contained in:
Sagi Dayan 2015-08-02 22:18:17 +03:00
parent 54360f3782
commit 87b19b2255
2 changed files with 36 additions and 38 deletions

View file

@ -6,24 +6,13 @@ angular.module('SeHub')
$rootScope.seToken = $cookies['com.sehub.www']; $rootScope.seToken = $cookies['com.sehub.www'];
var token = $rootScope.seToken; var token = $rootScope.seToken;
$scope.createTaskClicked = function() { $scope.user = $scope.$parent.user;
$location.path("/tasks/new"); // Reference to 'newTask' page apiService.getAllUserTasks(token).success(function(data) {
} $scope.tasks = data;
console.log(data);
$scope.displayTasks = function() { }).error(function(err) {
apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK console.log(err.message);
{ });
$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
} }

View file

@ -9,9 +9,9 @@
<div ng-if='!loading'> <div ng-if='!loading'>
<md-content layout-padding> <md-content layout-padding>
<md-tabs md-dynamic-height md-border-bottom> <md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Class Name"> <md-tab label="{{class.courseName}}" ng-repeat="class in tasks">
<md-content class="md-padding"> <md-content class="md-padding">
<h1 class="md-display-2">Class Name Tasks</h1> <h1 class="md-display-2">{{class.courseName}} Tasks</h1>
<div> <div>
<div layout='row' layout-align="center center"> <div layout='row' layout-align="center center">
@ -60,28 +60,37 @@
<div layout='row' style='width:100%'> <div layout='row' style='width:100%'>
<div layout='row' style='width:100%'> <div layout='row' style='width:100%'>
<div class="Personal" style='width:100%'> <div class="Personal" style='width:100%' >
<md-button style='width: 100%' layout='row'> <div layout='column' ng-repeat="personalTask in class.PersonalTasks">
<div> <div>
Personal Task name <md-button style='width: 100%' layout='row'>
</div> <div>
<div class='spacer'></div> {{personalTask.title}}
<div> 3 / 70 </div> </div>
</div> <div class='spacer'></div>
</md-button> <div ng-if='user.id === class.master_id'> {{personalTask.submitted.done}} / {{personalTask.submitted.total}} </div>
<div ng-if='user.id !== class.master_id'> {{personalTask.grade.grade || "Not Yet Reviewed"}} </div>
</div>
</md-button>
</div>
</div>
</div> </div>
<div style='padding: 0px 5px 0px 5px; margin-top: auto; margin-bottom: auto'> <div style='padding: 0px 5px 0px 5px; margin-top: auto; margin-bottom: auto'>
|
</div> </div>
<div class="Project" style='width:100%' > <div class="Project" style='width:100%'>
<md-button style='width: 100%' layout='row'> <div layout='column' ng-repeat="projectTask in class.projectTasks">
<div>
Project Task name <md-button style='width: 100%' layout='row'>
<div>
{{projectTask.title}}
</div>
<div class='spacer'></div>
<div ng-if='user.id === class.master_id'> {{projectTask.submitted.done}} / {{projectTask.submitted.total}} </div>
<div ng-if='user.id !== class.master_id'> {{projectTask.grade.grade || "Not Yet Reviewed"}} </div>
</div> </div>
<div class='spacer'></div> </md-button>
<div> 3 / 70 </div> </div>
</div>
</md-button>
</div> </div>
</div> </div>
</div> </div>