diff --git a/templates/js/app.js b/templates/js/app.js index 338d7af..4940008 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -4,7 +4,6 @@ var welcome = angular.module('welcome', ['ngMaterial', 'seHub.services', 'ngRout var app = angular.module('SeHub', ['ngMaterial', 'ngRoute', 'seHub.services', 'ngCookies', 'chart.js', '720kb.datepicker']); - welcome.config(function($mdThemingProvider) { $mdThemingProvider.theme('default') .primaryPalette('teal'); @@ -12,18 +11,13 @@ welcome.config(function($mdThemingProvider) { welcome.controller('welcomeController', ['$scope', 'apiService', '$cookies', '$window', function($scope, apiService, $cookies, $window) { console.log("Welcome Controller"); - var uid = $cookies['com.sehub.www']; if(uid){ console.info("Session in Place"); $window.location.href = DEBUG ? 'http://localhost:8080/home' : 'http://se-hub.appspot.com/home'; } - - - }]); - app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 5ccfd82..9aaca3b 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -2,6 +2,7 @@ angular.module('SeHub') .controller('myClassesController', ['$scope', '$location', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $location, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { + $scope.loadingData = true; $scope.isStudent = false; $scope.isCourse = false; $scope.isNewCourse = false; @@ -11,7 +12,7 @@ angular.module('SeHub') $scope.user.finalDate = ''; $scope.user.startDate = ''; $scope.showMyClass = false; - $scope.coursesEmpty = false; + $scope.coursesEmpty = true; $scope.campusId; var campusId = $routeParams.campusId; @@ -124,12 +125,14 @@ angular.module('SeHub') { apiService.getAllCoursesByCampus(token, campusId).success(function(data) // Shows all classes from this campus { + $scope.loadingData = false; $scope.courses = data; console.log("success " + $scope.courses); init(); // Executing the function to initialize course display - if(!$scope.courses) + if($scope.courses && $scope.courses.length > 0) { - $scope.coursesEmpty = true; + // $scope.coursesEmpty = true; + $scope.coursesEmpty = false; } }).error(function(err) { diff --git a/templates/js/controllers/myProjectsController.js b/templates/js/controllers/myProjectsController.js index 9ca67a8..1b65c6b 100644 --- a/templates/js/controllers/myProjectsController.js +++ b/templates/js/controllers/myProjectsController.js @@ -1,7 +1,6 @@ angular.module('SeHub') .controller('myProjectsController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { - $scope.isEditPressed = false; $scope.loadingData = true; $scope.myProjectsEmpty = true; $scope.user = $scope.$parent.user; @@ -52,18 +51,5 @@ angular.module('SeHub') }; $scope.arrayHolder.push(tempArr); } - - $scope.editPressed = function() - { - $scope.isEditPressed = true; - console.log("EditPressed " + $scope.isEditPressed); - } - $scope.removeProject = function() - { - console.log("Project has been removed!"); - } - - $scope.displayMyProjects(); // Will display all my projects - }]); \ No newline at end of file diff --git a/templates/js/controllers/projectController.js b/templates/js/controllers/projectController.js index 6db2fa2..de2efb7 100644 --- a/templates/js/controllers/projectController.js +++ b/templates/js/controllers/projectController.js @@ -2,6 +2,63 @@ angular.module('SeHub') .controller('projectController', ['$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 projectId = $routeParams.projectId; + $scope.isEditPressed = false; + $scope.user = $scope.$parent.user; + $scope.loadingData = true; + $scope.isMasterOrLecturer = false; + // $scope.thisProject = {}; + // $scope.thisProject.courseName = $routeParams.className; + $scope.editProject = function(ev) + { + $scope.isEditPressed = true; + console.log("EditPressed " + $scope.isEditPressed); + } + + $scope.removeProject = function(ev) + { + console.log("Project has been removed!"); + $mdDialog.show($mdDialog.alert().title('Remove Project').content('Are you sure you want to remove the project ?') + .ariaLabel('Removing project alert dialog').ok('Yes').targetEvent(ev)); + // .then(function() { + // $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course + // }); // Pop-up alert + }; + + + + $scope.getProjectInfo = function() + { + apiService.getProjectsById(token, projectId).success(function(data) + { + $scope.project = data; + console.log($scope.project); + $scope.init_line_lables(); + // if($scope.user === $scope.project.info.master_id) + // { + // $scope.isMasterOrLecturer = true; + // } + // if($scope.project && $scope.project.length > 0) // TODO - TEST? + // { + $scope.loadingData = false; + // } + + console.log($scope.project); + }).error(function(err) + { + console.log("Error: " + err.message); + }); + } + + $scope.init_line_lables = function(){ + $scope.project.weekly_labels = []; + for(var i = 0 ; i < $scope.project.info.stats.weekly_commits[0].length; i++) + $scope.project.weekly_labels.push('w '+i.toString()); + + } + + $scope.getProjectInfo(); // Get all this project data }]); \ No newline at end of file diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index 6420e60..e3352d3 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -125,6 +125,14 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, + getProjectsById: function(token, projectId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsById/" + token + "/" + projectId; + req = { + method : "GET", + url : url + }; + return $http(req); + }, getProjectsByUser: function(token){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsByUser/" + token; req = { diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index 869e6e5..885731f 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -2,36 +2,40 @@

My Classes

- -
-
-
-
- -
- -

{{course.courseName}}

-
-
-
-
-
- -
- -

{{course.courseName}}

-
-
-
-
+
+ +
+
+ You Are Not Related To Any Course, You May Join Any Course You Wish. +
+
+ +
+
+
+ +
+ +

{{course.courseName}}

+
+
+
-
-
- You Are Not Related To Any Course, You May Join Any Course You Wish. +
+ +
+ +

{{course.courseName}}

+
+
+
+
- + +
+ diff --git a/templates/views/project.html b/templates/views/project.html index 8d4eba2..48f1384 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -1,13 +1,160 @@ -
+
-

Project

- Yipi Kayea Mother Fraker +
+
+
+

Project '{{project.projectName}}'

+
+
+
+ +
+
+
- +
+ + +
+ + + +
+
+ + + +
+
+ +
+
+ + +
+
+ Team Members: + +
+
+ +
+ +
+ + + +
+
+ + + +
+
+
+
+
+
+ + + + + +

Messages

+

Messages...

+
+
+ + +

Commits

+ + + + + + + + + + + +
NameNumberurl
+ + {{member.name}} + + +
+ {{commit.commits_url}} +
+
+
+
+ + +

Issues

+ + + + + + + + + + + + + +
TitleLabelsMilestoneUser
+ + {{issue.title}} + + + + + {{label.name}} + + + + {{issue.milestone.title}} + + + {{issue.user.login}} + +
+
+
+ + +

Bugs

+

Bugs ..

+
+
+ + +

tasks

+

tasks..

+
+
+
+
+
+
+
+
diff --git a/templates/views/register.html b/templates/views/register.html index 4fd5255..9aa1360 100644 --- a/templates/views/register.html +++ b/templates/views/register.html @@ -1,80 +1,80 @@
- -

Registration

-
- First Login Of {{user.name}} -
- {{item.who}} -
-
-
-
- - - - -
-

-
-

Are You A Lecturer?

- - -
-
-
-
+ +

Registration

+
+ First Login Of {{user.name}} +
+ {{item.who}} +
+
+
- Create Campus -
- - - - - - - - - - - - + + + + +
+

+
+

Are You A Lecturer?

+ + +
+
+
+
+
+ Create Campus +
+ + + + + + + + + + + + +
+
+
+ +
+
+
+
+ campusAvatar
- -
-
-
- campusAvatar +
+ Submit
-
-
-
- Submit -
-
-
-
+
+
+
+ + + + +
+
- - - - +
+ {{campusObj.email_ending}} +
-
-
- {{campusObj.email_ending}} -
-
-
- +
\ No newline at end of file