From e38cecb7e4d5ae2f8e502f6e4d5f7d9d97760fa1 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 22:31:32 +0300 Subject: [PATCH] - project - Show graphs - Added ! --- .../js/controllers/myProjectsController.js | 14 -- templates/js/controllers/projectController.js | 40 ++++++ templates/js/services/apiService.js | 8 ++ templates/views/project.html | 45 +++++- templates/views/register.html | 132 +++++++++--------- 5 files changed, 152 insertions(+), 87 deletions(-) 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..785ad46 100644 --- a/templates/js/controllers/projectController.js +++ b/templates/js/controllers/projectController.js @@ -2,6 +2,46 @@ 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.thisProject = {}; + // $scope.thisProject.courseName = $routeParams.className; + $scope.editProject = function() + { + $scope.isEditPressed = true; + console.log("EditPressed " + $scope.isEditPressed); + } + $scope.removeProject = function() + { + console.log("Project has been removed!"); + } + + $scope.getProjectInfo = function() + { + apiService.getProjectsById(token, projectId).success(function(data) + { + $scope.project = data; + console.log($scope.project); + $scope.init_line_lables(); + $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/project.html b/templates/views/project.html index 8d4eba2..fd17677 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -1,13 +1,44 @@ -
+

Project

- Yipi Kayea Mother Fraker -
- + +
+
+ Project Logo + +
+
+ {{project.projectName}} +
+
+
+ + + +
+
+ + + +
+
+
+
+
+ +
+ +
+ + + +
+
+ + + +
- - - 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