From cc4425b360cd8feee60f5793bc3d0ea94c065612 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 30 Jun 2015 18:48:13 +0300 Subject: [PATCH] Profile: Fixed The profile UI and Logic now there is a message if there is no User. Only thing left are user stats --- templates/css/theme.css | 8 +++ templates/js/controllers/profileController.js | 70 ++++++------------- templates/views/profile.html | 36 ++++++++-- 3 files changed, 61 insertions(+), 53 deletions(-) diff --git a/templates/css/theme.css b/templates/css/theme.css index ea3f3fe..d0cb499 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -241,6 +241,14 @@ body.noscroll /*width:80%;*/ } +.gray-font-no-animation + { + color: #7f7f7f; + font-size: 300%; + text-shadow:#e0e0e0 1px 1px 0; + + } + .gray-font { color: #7f7f7f; diff --git a/templates/js/controllers/profileController.js b/templates/js/controllers/profileController.js index c18d9cb..d07c0b8 100644 --- a/templates/js/controllers/profileController.js +++ b/templates/js/controllers/profileController.js @@ -7,27 +7,34 @@ angular.module('SeHub') var id = $routeParams.id; $scope.loadingData = true; $scope.isInRegisterMode = false; + $scope.userExists = false; $scope.title = "Profile"; apiService.getUserById(token, id).success(function(data) { - if (data.message == 'No User Found') { + if (!data) { console.error("No User Found!"); + $scope.loadingData = false; + return; } $scope.user = data; - apiService.getCampusesByUserId(token, id).success(function(data) { - $scope.campuses = data; - console.log(data); - apiService.getCoursesByUserID(token, id).success(function(data){ - $scope.courses = data; - }).error(function(err){ - console.error('In apiService.getCoursesByUserID', err); - }) + $scope.userExists = true; + apiService.getCampusesByUserId(token, id) + .success(function(data) { + $scope.campuses = data; + console.log(data); + apiService.getCoursesByUserID(token, id) + .success(function(data) { + $scope.courses = data; + }).error(function(err) { + console.error('In apiService.getCoursesByUserID', err); + }); - $scope.loadingData = false; - }).error(function(err) { - console.error(err); - }); + $scope.loadingData = false; + }).error(function(err) { + console.error(err); + console.error("++++++++++++++++++++"); + }); }); @@ -55,48 +62,15 @@ angular.module('SeHub') } } - /** - * DEBUG DATA - */ - // $scope.courses = [{ - // "courseName": "Advance Math", - // "campusName": "JCE", - // "startDate": { - // "year": 2015, - // "month": 4, - // "day": 3 - // }, - // "endDate": { - // "year": 2016, - // "month": 5, - // "day": 14 - // }, - // "taskFlag": false, - // "campus_avatar": "https://yt3.ggpht.com/--ZkWxybWGOM/AAAAAAAAAAI/AAAAAAAAAAA/_nAICC_kzzI/s88-c-k-no/photo.jpg" - // }]; - - // $scope.campuses = [{ - // 'title': 'JCE', - // 'email_ending': '@post.jce.ac.il', - // 'master_user_id': 123453433341, - // 'avatar_url': 'https://yt3.ggpht.com/--ZkWxybWGOM/AAAAAAAAAAI/AAAAAAAAAAA/_nAICC_kzzI/s88-c-k-no/photo.jpg' - // }, { - // 'title': 'Stanford', - // 'email_ending': '@post.jce.ac.il', - // 'master_user_id': 123453433341, - // 'avatar_url': 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcR9M4uQgaJP1zyiCGw-dK31hU8buWqeuOi9vTXBd4Y8hQcFTZqA' - // }]; - - $scope.labels = ['Commits', 'Issues Assigned', 'Messages', 'Open Tasks']; //$scope.series = ['Project A', 'Project B']; $scope.data = [ - [54, 3, 15, 3]//, + [54, 3, 15, 3] //, //[28, 48, 40, 3] ]; - $scope.isUser = $scope.$parent.user.id.toString() /*The Actual User*/ === $routeParams.id /*The Profile User*/; + $scope.isUser = $scope.$parent.user.id.toString() /*The Actual User*/ === $routeParams.id /*The Profile User*/ ; } ]); \ No newline at end of file diff --git a/templates/views/profile.html b/templates/views/profile.html index d9083ac..a4b6769 100644 --- a/templates/views/profile.html +++ b/templates/views/profile.html @@ -4,7 +4,7 @@ - +

{{title}}

@@ -73,7 +73,7 @@
- {{ person.name }} + {{ person.name }}
{{ course.courseName }} - IN {{course.campusName}} @@ -115,8 +115,34 @@
- - - + + + +
+
+
+

+
+
+
+
+
+
+

User Not Found

+ +
+
+
+
+
+
+

Might Not Be A Registered SE-Hub User

+ +
+
+
+ +
+
\ No newline at end of file