From 59ff8a176f322a232453382da21ce278d624f8a9 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Tue, 30 Jun 2015 15:56:53 +0300 Subject: [PATCH] - 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}} +
+
+ +
+