From 82f616051ca34b9da1d0ac15d0ee643c35c9b6bb Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 21:33:57 +0300 Subject: [PATCH 1/7] - project (work in progress) --- templates/js/app.js | 6 ------ 1 file changed, 6 deletions(-) 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 From e38cecb7e4d5ae2f8e502f6e4d5f7d9d97760fa1 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 22:31:32 +0300 Subject: [PATCH 2/7] - 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 From 691333ddcdb6713be0cdea695f7ff0f9120d6116 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 22:45:36 +0300 Subject: [PATCH 3/7] - project - team members - Added - project - tab system : messages, commits, bugs, task --- templates/views/project.html | 54 ++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/templates/views/project.html b/templates/views/project.html index fd17677..c74ac23 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -8,23 +8,31 @@
- {{project.projectName}} + Project Name: {{project.projectName}}
- +
- +
-
+
+ Team Members: + +
+
@@ -33,12 +41,48 @@
-
+
+
+
+
+ + + + + +

Messages

+

Messages...

+
+
+ + +

Commits

+

Commits...

+
+
+ + +

Bugs

+

Bugs ..

+
+
+ + +

tasks

+

tasks..

+
+
+
+
+
+
+
+
From 59ff8a176f322a232453382da21ce278d624f8a9 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 30 Jun 2015 15:56:53 +0300 Subject: [PATCH 4/7] - Project layout - fixed - project tabs - commits, issues... (work in progress - see the alpha version) --- .../js/controllers/myClassesController.js | 9 +- templates/js/controllers/projectController.js | 25 ++- templates/views/myClasses.html | 56 ++++--- templates/views/project.html | 158 +++++++++++++----- 4 files changed, 170 insertions(+), 78 deletions(-) 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/projectController.js b/templates/js/controllers/projectController.js index 785ad46..de2efb7 100644 --- a/templates/js/controllers/projectController.js +++ b/templates/js/controllers/projectController.js @@ -7,19 +7,28 @@ angular.module('SeHub') $scope.isEditPressed = false; $scope.user = $scope.$parent.user; $scope.loadingData = true; + $scope.isMasterOrLecturer = false; // $scope.thisProject = {}; // $scope.thisProject.courseName = $routeParams.className; - $scope.editProject = function() + $scope.editProject = function(ev) { $scope.isEditPressed = true; console.log("EditPressed " + $scope.isEditPressed); } - $scope.removeProject = function() + + $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() { @@ -28,7 +37,15 @@ angular.module('SeHub') $scope.project = data; console.log($scope.project); $scope.init_line_lables(); - $scope.loadingData = false; + // 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) { 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 c74ac23..55947d2 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -1,54 +1,71 @@
-

Project

- -
-
- Project Logo - +
+
+
+

Project '{{project.projectName}}'

-
- Project Name: {{project.projectName}} -
-
-
- - - +
+
+
-
- - - -
-
-
-
-
- Team Members: - -
-
- -
- -
- - - -
-
- - -
-
+
+ + +
+ + + +
+
+ + + +
+
+ +
+
+
+ + + +
+
+ Team Members: + +
+
+ +
+ +
+ + + +
+
+ + + +
+
+
+
+
@@ -62,7 +79,58 @@

Commits

-

Commits...

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

Issues

+ + + + + + + + + + + +
NameTitleurl
+ + {{member.name}} + + +
+ {{issue.title}} +
+
+ +
+
From d2f284d95d7e659d1f47b34bdfbd8608a68144f3 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 30 Jun 2015 17:04:41 +0300 Subject: [PATCH 5/7] - project tabs - commits, issues... (work in progress - see the beta version) --- templates/views/project.html | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/templates/views/project.html b/templates/views/project.html index 55947d2..e8585b8 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -102,31 +102,30 @@
- +

Issues

- + - - + + +
Name TitleName url
- - {{member.name}} - -
-
+
{{issue.title}}
- + + {{issue.user.login}} + + + + Link +
From 386d77b72f5666633c7e6a281973b071a35bb14b Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 30 Jun 2015 17:52:32 +0300 Subject: [PATCH 6/7] - project tabs - commits - DONE - project tabs- issues, messages.. (work in progress - see the beta version) --- templates/views/project.html | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/templates/views/project.html b/templates/views/project.html index e8585b8..7cf483e 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -107,24 +107,29 @@ - - + + + - - + + From 85e5a22bf4b5c691c34809bd3e7f671a54cc7b52 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 30 Jun 2015 18:03:54 +0300 Subject: [PATCH 7/7] - project tabs - commits - improved - link open in new tab, profile opens in the same tab - project tabs- issues, messages.. (work in progress - see the beta version) --- templates/views/project.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/views/project.html b/templates/views/project.html index 7cf483e..48f1384 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -128,7 +128,7 @@ {{issue.milestone.title}}
TitleNameurlLabelsMilestoneUser
- - - - {{issue.user.login}} - - Link + + + {{label.name}} + + + + {{issue.milestone.title}} + + + {{issue.user.login}}
- + {{issue.user.login}}