commit
15172f9687
6 changed files with 19 additions and 27 deletions
|
@ -54,7 +54,7 @@ app.config(['$routeProvider', '$locationProvider',
|
||||||
templateUrl: 'templates/views/newTask.html',
|
templateUrl: 'templates/views/newTask.html',
|
||||||
controller: 'newTasksController'
|
controller: 'newTasksController'
|
||||||
})
|
})
|
||||||
.when('/class/:projectId', {
|
.when('/class/:classId/:className', {
|
||||||
templateUrl: 'templates/views/class.html',
|
templateUrl: 'templates/views/class.html',
|
||||||
controller: 'classController'
|
controller: 'classController'
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,19 +2,18 @@ angular.module('SeHub')
|
||||||
.controller('classController', ['$scope', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
.controller('classController', ['$scope', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||||
{
|
{
|
||||||
var token = $cookies['com.sehub.www'];
|
var token = $cookies['com.sehub.www'];
|
||||||
var classId = $routeParams.projectId;
|
var classId = $routeParams.classId;
|
||||||
// var projectId = "";
|
$scope.project = {};
|
||||||
|
$scope.project.courseName = $routeParams.className;
|
||||||
$scope.projectsEmpty = true;
|
$scope.projectsEmpty = true;
|
||||||
$scope.isCreateProjectClicked = false;
|
$scope.isCreateProjectClicked = false;
|
||||||
$scope.submitNewCourseClicked = false;
|
$scope.submitNewCourseClicked = false;
|
||||||
$scope.project = {};
|
|
||||||
$scope.loadingData = true;
|
$scope.loadingData = true;
|
||||||
$scope.isInCourse = false;
|
$scope.isInCourse = false;
|
||||||
$scope.project.courseName = classId;
|
|
||||||
|
|
||||||
$scope.displayProjects = function()
|
$scope.displayProjects = function()
|
||||||
{
|
{
|
||||||
console.log("in displayProjecs!!! ");
|
|
||||||
apiService.getProjectsByCourse(token, classId).success(function(data) // Get all the campuses
|
apiService.getProjectsByCourse(token, classId).success(function(data) // Get all the campuses
|
||||||
{
|
{
|
||||||
$scope.loadingData = false;
|
$scope.loadingData = false;
|
||||||
|
|
|
@ -15,10 +15,10 @@ angular.module('SeHub')
|
||||||
$scope.campusId;
|
$scope.campusId;
|
||||||
var campusId = $routeParams.campusId;
|
var campusId = $routeParams.campusId;
|
||||||
|
|
||||||
$scope.goToClass = function(classId)
|
$scope.goToClass = function(classId, className)
|
||||||
{
|
{
|
||||||
console.log("Done! " + $scope.courses);
|
console.log("Done! " + className);
|
||||||
$location.path('/class/' + classId.toString()); // Will display all the projects in this course
|
$location.path('/class/' + classId.toString() + '/' + className); // Will display all the projects in this course
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.chooseCampusClicked = function()
|
$scope.chooseCampusClicked = function()
|
||||||
|
@ -82,7 +82,8 @@ angular.module('SeHub')
|
||||||
$mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.')
|
$mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.')
|
||||||
.ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent())
|
.ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent())
|
||||||
.then(function() {
|
.then(function() {
|
||||||
$location.path('/newCourse'); // TODO TODO TODO
|
// $location.path('/newCourse'); // TODO TODO TODO
|
||||||
|
$location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
|
||||||
}); // Pop-up alert
|
}); // Pop-up alert
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,19 +25,11 @@ angular.module('SeHub')
|
||||||
{
|
{
|
||||||
console.log("Error: " + err.message);
|
console.log("Error: " + err.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.goToProject = function(projectId)
|
$scope.goToProject = function(projectId)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < $scope.myProjects; i++)
|
$location.path('/project/' + projectId);
|
||||||
{
|
|
||||||
if($scope.myProjects.id === projectId)
|
|
||||||
{
|
|
||||||
console.log("project ID: " + projectId)
|
|
||||||
$location.path('/project/' + projectId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var init = function()
|
var init = function()
|
||||||
|
|
|
@ -7,21 +7,21 @@
|
||||||
<div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" >
|
<div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" >
|
||||||
<div ng-if = "!scope.coursesEmpty">
|
<div ng-if = "!scope.coursesEmpty">
|
||||||
<div ng-if="t.length != 1">
|
<div ng-if="t.length != 1">
|
||||||
<md-button ng-click = "goToClass(course.id)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
|
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
|
||||||
<md-card style="width:97%;height:97%">
|
<div style="width:97%;height:97%">
|
||||||
<md-card-content>
|
<md-card-content>
|
||||||
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
|
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
</md-card>
|
</div>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="t.length == 1">
|
<div ng-if="t.length == 1">
|
||||||
<md-button ng-click = "goToClass(course.id)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
|
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
|
||||||
<md-card style="width:97%;height:97%">
|
<div style="width:97%;height:97%">
|
||||||
<md-card-content>
|
<md-card-content>
|
||||||
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
|
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
</md-card>
|
</div>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<div ng-if="t.length != 1">
|
<div ng-if="t.length != 1">
|
||||||
<md-button ng-click="goToProject(project.id)" style="width:100%; height:32%;" layout-padding class = "md-raised">
|
<md-button ng-click="goToProject(project.id)" style="width:100%; height:32%;" layout-padding class = "md-raised">
|
||||||
<md-card-content>
|
<md-card-content>
|
||||||
<h2 class="md-title">{{project.projectName}}</h2>
|
{{project.projectName}}
|
||||||
<div layout-align="center center" style=" width:70%;">
|
<div layout-align="center center" style=" width:70%;">
|
||||||
<canvas layout-padding layout-margin id="project.projectName" class="chart chart-bar" data="project.info.stats.macro.data" labels="project.info.stats.macro.labels"></canvas>
|
<canvas layout-padding layout-margin id="project.projectName" class="chart chart-bar" data="project.info.stats.macro.data" labels="project.info.stats.macro.labels"></canvas>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<md-button ng-click = "goToProject(project.id)" style="width:32%; height:32%;" layout-padding class = "md-raised">
|
<md-button ng-click = "goToProject(project.id)" style="width:32%; height:32%;" layout-padding class = "md-raised">
|
||||||
<md-card style="width:97%;height:97%">
|
<md-card style="width:97%;height:97%">
|
||||||
<md-card-content>
|
<md-card-content>
|
||||||
<h2 class="md-title">{{project.projectName}}</h2>
|
{{project.projectName}}
|
||||||
<canvas layout-padding layout-margin id="project.projectName" class="chart chart-bar" data="project.info.stats.macro.data"
|
<canvas layout-padding layout-margin id="project.projectName" class="chart chart-bar" data="project.info.stats.macro.data"
|
||||||
labels="project.info.stats.macro.labels"></canvas>
|
labels="project.info.stats.macro.labels"></canvas>
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
|
|
Loading…
Reference in a new issue