2015-06-09 17:16:29 +00:00
|
|
|
var DEBUG = true;
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
var welcome = angular.module('welcome', ['ngMaterial', 'seHub.services', 'ngRoute' , 'ngCookies']);
|
|
|
|
|
2015-06-22 19:37:47 +00:00
|
|
|
var app = angular.module('SeHub', ['ngMaterial', 'ngRoute', 'seHub.services', 'ngCookies', 'chart.js', '720kb.datepicker']);
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
welcome.config(function($mdThemingProvider) {
|
|
|
|
$mdThemingProvider.theme('default')
|
|
|
|
.primaryPalette('teal');
|
|
|
|
});
|
|
|
|
|
|
|
|
welcome.controller('welcomeController', ['$scope', 'apiService', '$cookies', '$window', function($scope, apiService, $cookies, $window) {
|
|
|
|
console.log("Welcome Controller");
|
|
|
|
|
|
|
|
var uid = $cookies['com.sehub.www'];
|
2015-06-15 15:41:44 +00:00
|
|
|
if(uid){
|
|
|
|
console.info("Session in Place");
|
2015-05-09 19:00:14 +00:00
|
|
|
$window.location.href = DEBUG ? 'http://localhost:8080/home' : 'http://se-hub.appspot.com/home';
|
2015-06-15 15:41:44 +00:00
|
|
|
}
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
app.config(['$routeProvider', '$locationProvider',
|
|
|
|
function($routeProvider, $locationProvider) {
|
|
|
|
$routeProvider
|
|
|
|
.when('/', {
|
2015-06-15 15:41:44 +00:00
|
|
|
templateUrl: 'templates/views/home.html'
|
2015-05-09 19:00:14 +00:00
|
|
|
})
|
|
|
|
.when('/register', {
|
|
|
|
templateUrl: 'templates/views/register.html',
|
|
|
|
controller: 'registerController'
|
2015-06-16 11:15:59 +00:00
|
|
|
})
|
|
|
|
.when('/home', {
|
|
|
|
templateUrl: 'templates/views/home.html',
|
|
|
|
controller: 'homeController'
|
2015-06-16 20:32:10 +00:00
|
|
|
})
|
2015-06-24 21:10:08 +00:00
|
|
|
.when('/profile/:id', {
|
|
|
|
templateUrl: 'templates/views/profile.html',
|
|
|
|
controller: 'profileController'
|
2015-06-18 20:21:09 +00:00
|
|
|
})
|
|
|
|
.when('/tasks', {
|
|
|
|
templateUrl: 'templates/views/tasks.html',
|
|
|
|
controller: 'tasksController'
|
2015-06-22 10:06:56 +00:00
|
|
|
})
|
2015-06-26 11:08:23 +00:00
|
|
|
.when('/myClasses/:campusId', {
|
2015-06-22 10:06:56 +00:00
|
|
|
templateUrl: 'templates/views/myClasses.html',
|
|
|
|
controller: 'myClassesController'
|
2015-06-22 10:16:38 +00:00
|
|
|
})
|
2015-06-22 10:04:21 +00:00
|
|
|
.when('/tasks/new', {
|
|
|
|
templateUrl: 'templates/views/newTask.html',
|
|
|
|
controller: 'newTasksController'
|
2015-06-22 11:45:50 +00:00
|
|
|
})
|
2015-06-26 11:08:23 +00:00
|
|
|
.when('/projects/:classId', {
|
2015-06-22 11:45:50 +00:00
|
|
|
templateUrl: 'templates/views/projects.html',
|
|
|
|
controller: 'projectsController'
|
2015-06-23 16:04:41 +00:00
|
|
|
})
|
|
|
|
.when('/newCourse', {
|
|
|
|
templateUrl: 'templates/views/newCourse.html',
|
|
|
|
controller: 'newCourseController'
|
2015-06-24 18:35:21 +00:00
|
|
|
})
|
|
|
|
.when('/campuses', {
|
|
|
|
templateUrl: 'templates/views/campuses.html',
|
|
|
|
controller: 'campusesController'
|
2015-06-24 19:43:02 +00:00
|
|
|
})
|
2015-06-27 11:20:21 +00:00
|
|
|
.when('/myProjects', {
|
|
|
|
templateUrl: 'templates/views/myProjects.html',
|
2015-06-29 11:41:17 +00:00
|
|
|
controller: 'myProjectsController'
|
2015-05-09 19:00:14 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|