New Task Layout

This commit is contained in:
Sagi Dayan 2015-08-02 21:46:42 +03:00
parent f83aff5408
commit 1dafd10b72
2 changed files with 118 additions and 79 deletions

View file

@ -1,32 +1,30 @@
angular.module('SeHub') angular.module('SeHub')
.controller('tasksController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) .controller('tasksController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast',
{ '$mdDialog', 'apiService', '$rootScope',
$scope.lecturerTasks = []; function($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService, $rootScope) {
$rootScope.seToken = $cookies['com.sehub.www']; $scope.lecturerTasks = [];
var token = $rootScope.seToken; $rootScope.seToken = $cookies['com.sehub.www'];
var token = $rootScope.seToken;
$scope.createTaskClicked = function() $scope.createTaskClicked = function() {
{ $location.path("/tasks/new"); // Reference to 'newTask' page
$location.path("/tasks/new"); // Reference to 'newTask' page }
}
$scope.displayTasks = function() $scope.displayTasks = function() {
{ apiService.getAllFutureTasks(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.lecturerTasks = data;
$scope.lecturerTasks = data; console.log(data);
console.log(data); }).error(function(err) {
}).error(function(err) console.log(err.message);
{ });
console.log(err.message); }
}); $scope.gotoTask = function(taskId) {
} $location.path('/tasks/fill/' + taskId);
$scope.gotoTask = function(taskId) }
{
$location.path('/tasks/fill/' + taskId);
}
$scope.displayTasks(); // Calling tasks with task id $scope.displayTasks(); // Calling tasks with task id
}]); }
]);

View file

@ -1,56 +1,97 @@
<div class = "tasks"> <md-content layout-padding>
<md-content layout-padding layout-margin> <h1>
<h1 style="margin-left:15px"><i class="fa fa-file-text-o"></i> Tasks</h1> <i class="fa fa-clipboard"></i> Tasks
<div flex> </h1>
<md-card> <div ng-if='loading'>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom> </div>
<md-tab label="" <i class="fa fa-check"></i>
<md-content class = "tabDesign">
<table style="width:100%;" border = "1">
<tr>
<th style = "width:20%">Task Name</th>
<th style = "width:20%">Date</th>
<th style = "width:20%">Grade</th>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="Delayed">
<md-content class="md-padding">
<h1 class="md-display-2">Delayed</h1>
<p>Delayed...</p>
</md-content>
</md-tab>
<md-tab label="Not Submitted">
<md-content class="md-padding">
<md-card ng-repeat = "task in lecturerTasks">
<md-button ng-click="gotoTask(task.id)">
{{task.title}}
</md-button>
</md-card> <div ng-if='!loading'>
<md-content layout-padding>
</md-content> <md-tabs md-dynamic-height md-border-bottom>
</md-tab> <md-tab label="Class Name">
<div ng-if = "user.isLecturer"> <md-content class="md-padding">
<md-button ng-click="createTaskClicked()" ng class="md-raised md-primary">Create Task</md-button> <h1 class="md-display-2">Class Name Tasks</h1>
<div>
<div layout='row' layout-align="center center">
<div class="spacer"></div>
<div>
<h2>Personal</h2>
</div> </div>
</md-tabs> <div class="spacer"></div>
</md-content> <div>
</md-card> <h2>Project</h2>
</div> </div>
<div class="spacer"></div>
</div>
<!-- Should Be In Table List -->
<div class = "allTasksShow" flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding> <div layout='row' style="width: 100%">
<div flex = "32" layout = "column" ng-repeat = "task in t" value = "{{task}}"> <div layout='row' style="width: 100%">
<md-button ng-click = "goToTask(task.id)" style="width:32%; height:32%;" flex="32" layout-padding class = "md-raised"> <div class='Personal' layout='row' flex='50'>
<!-- <img src="{{campus.avatar_url}}" style = "width:14%; height:auto;"> --> <div>
{{task.title}} <h3>Task Name</h3>
</md-button> </div>
</div> <div class='spacer'></div>
</div> <div>
<!-- Should Be In Table List --> <h3>
</div> Submitters
</md-content> </h3>
</div> </div>
</div>
<div style='padding: 0px 5px 0px 5px; margin-top: auto; margin-bottom: auto'>
|
</div>
<div class='Project' layout='row' flex='50'>
<div>
<h3>Task Name</h3>
</div>
<div class='spacer'></div>
<div>
<h3>
Submitters
</h3>
</div>
</div>
</div>
</div>
<div layout='row' style='width:100%'>
<div layout='row' style='width:100%'>
<div class="Personal" style='width:100%'>
<md-button style='width: 100%' layout='row'>
<div>
Personal Task name
</div>
<div class='spacer'></div>
<div> 3 / 70 </div>
</div>
</md-button>
</div>
<div style='padding: 0px 5px 0px 5px; margin-top: auto; margin-bottom: auto'>
|
</div>
<div class="Project" style='width:100%' >
<md-button style='width: 100%' layout='row'>
<div>
Project Task name
</div>
<div class='spacer'></div>
<div> 3 / 70 </div>
</div>
</md-button>
</div>
</div>
</div>
</div>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</div>
</md-content>