diff --git a/SE_API/API.py b/SE_API/API.py index 4918e46..faac0a0 100644 --- a/SE_API/API.py +++ b/SE_API/API.py @@ -206,6 +206,10 @@ def login(): return github.authorize() +@app.route('/debug/login') +def set_local_token_view(): + return app.send_static_file('DEBUG_Views/set_cookie.html') + @app.route('/api/qa/init') def init_QA(): diff --git a/SE_API/GitHub_API_Connector.py b/SE_API/GitHub_API_Connector.py index 21f3e26..ddba971 100644 --- a/SE_API/GitHub_API_Connector.py +++ b/SE_API/GitHub_API_Connector.py @@ -3,6 +3,7 @@ import requests from GithubAPI.GithubAPI import GitHubAPI_Keys from models.Task import Task from google.appengine.ext import db +import datetime githubKeys = GitHubAPI_Keys() @@ -26,10 +27,30 @@ def get_repo_issues(repo_url): def get_repo_weekly_commits(repo_url): url = 'https://api.github.com/repos/' + repo_url + '/stats/participation' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret() req = requests.get(url) + week_obj = {} + week_obj['data'] = [] try: - return req.json()['all'] + week_obj['data'].append(req.json()['all'][-4:]) except: - return [] + week_obj['data'].append([0,0,0,0]) + + week_obj['labels'] = [] + # i = 24 * 7 * -1 + # while i != 0: + # week_obj['labels'].append((datetime.datetime.today() - datetime.timedelta(hours=i)).strftime("%A")) + # i += 24 + + week_obj['labels'].append("A Month Ago") + week_obj['labels'].append("2 Weeks Ago") + week_obj['labels'].append("1 Weeks Ago") + week_obj['labels'].append("Most Resent Week") + + return week_obj + +def get_repo_commits(repo_url): + url = 'https://api.github.com/repos/' + repo_url + '/commits' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret() + req = requests.get(url) + return req.json() def make_macro(stats, info, project_id): macro = {'labels': [], 'data': [[0]]} @@ -65,12 +86,13 @@ def get_github_data(repo_url, project_id): github_stats = get_repo_stats(repo_url) #first Call project_info['info'] = get_repo_general_info(repo_url) issues = get_repo_issues(repo_url) - weekly_commits = [get_repo_weekly_commits(repo_url)] + weekly_commits = get_repo_weekly_commits(repo_url) github_stats = get_repo_stats(repo_url) #Second Call project_info['stats']['macro'] = make_macro(github_stats, project_info['info'], project_id) project_info['stats']['micro'] = make_micro(github_stats, issues) project_info['stats']['weekly_commits'] = weekly_commits project_info['issues'] = issues + project_info['commits'] = get_repo_commits(repo_url) return project_info diff --git a/templates/DEBUG_Views/set_cookie.html b/templates/DEBUG_Views/set_cookie.html new file mode 100644 index 0000000..e1bd973 --- /dev/null +++ b/templates/DEBUG_Views/set_cookie.html @@ -0,0 +1,37 @@ + + + + + + + + + +
+ +Enter The User Token: + + +
+ + \ No newline at end of file diff --git a/templates/css/theme.css b/templates/css/theme.css index ea3f3fe..7653ec7 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -151,33 +151,6 @@ body.noscroll /*width: 100%;*/ } -/*.hvr-curl-top-left { - display: inline-block; - vertical-align: middle; - -webkit-transform: translateZ(0); - transform: translateZ(0); - box-shadow: 0 0 1px rgba(0, 0, 0, 0); - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - -moz-osx-font-smoothing: grayscale; - position: relative; -}*/ - -/* Grow Rotate */ -/*.campusCard { - display: inline-block; - vertical-align: middle; - -webkit-transform: translateZ(0); - transform: translateZ(0); - box-shadow: 0 0 1px rgba(0, 0, 0, 0); - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - -moz-osx-font-smoothing: grayscale; - -webkit-transition-duration: 0.3s; - transition-duration: 0.3s; - -webkit-transition-property: transform; - transition-property: transform; -}*/ .campusCard:hover, .campusCard:focus, .campusCard:active { -webkit-transform: rotate(4deg); transform: rotate(4deg); @@ -220,178 +193,172 @@ body.noscroll -moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8); } -/*.dropDown /* TODO * +.allCampusesShow { - border-bottom: 2px black solid; - border-top: 2px black solid; - border-left: 2px black solid; - border-right: 2px black solid; - border-radius: 1px black solid; - }*/ + overflow:hidden; + background-size: auto; + +} - .allCampusesShow - { - overflow:hidden; - background-size: auto; - - } - .campusCard - { - /*height:80%;*/ - /*width:80%;*/ - } +.gray-font-no-animation +{ + color: #7f7f7f; + font-size: 300%; + text-shadow:#e0e0e0 1px 1px 0; + +} - .gray-font - { - color: #7f7f7f; - font-size: 300%; - text-shadow:#e0e0e0 1px 1px 0; - opacity: 0; - -webkit-animation-duration: 8s; - animation-duration: 8s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - overflow: hidden; - height: 100%; +.gray-font +{ + color: #7f7f7f; + font-size: 300%; + text-shadow:#e0e0e0 1px 1px 0; + opacity: 0; + -webkit-animation-duration: 8s; + animation-duration: 8s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + overflow: hidden; + height: 100%; +} + +@-webkit-keyframes fadeOutUp { + 0% { + opacity: 1; + -webkit-transform: translateY(0); } - - @-webkit-keyframes fadeOutUp { - 0% { - opacity: 1; - -webkit-transform: translateY(0); - } - 100% { - opacity: 0; - -webkit-transform: translateY(-200px); - /*-webkit-transform: scale(0,0); */ - height: 0px; - } + 100% { + opacity: 0; + -webkit-transform: translateY(-200px); + /*-webkit-transform: scale(0,0); */ + height: 0px; } - @keyframes fadeOutUp { - 0% { - opacity: 1; - transform: translateY(0); - } - 100% { - opacity: 0; - transform: translateY(-200px); - /*transform: scale(0,0); */ - height: 0px; - } +} +@keyframes fadeOutUp { + 0% { + opacity: 1; + transform: translateY(0); } - .fadeOutUp { - -webkit-animation-name: fadeOutUp; - animation-name: fadeOutUp; - } + 100% { + opacity: 0; + transform: translateY(-200px); + /*transform: scale(0,0); */ + height: 0px; + } +} +.fadeOutUp { + -webkit-animation-name: fadeOutUp; + animation-name: fadeOutUp; +} - .user-pane-menu{ - width: 100%; - height: 15%; - background-color: #3F51B5; - -webkit-box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); - -moz-box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); - box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); - top: 20px; - position: relative; - } +.user-pane-menu{ + width: 100%; + height: 15%; + background-color: #3F51B5; + -webkit-box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); + -moz-box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); + box-shadow: 0px 13px 34px -14px rgba(0,0,0,0.75); + top: 20px; + position: relative; +} - .user-pane-menu img{ - border: 7px rgb(255, 255, 255) solid; - -webkit-border-radius: 100px; - -moz-border-radius: 100px; - border-radius: 50px; - width: 30%; - position: relative; - z-index: 50; - } +.user-pane-menu img{ + border: 7px rgb(255, 255, 255) solid; + -webkit-border-radius: 100px; + -moz-border-radius: 100px; + border-radius: 50px; + width: 30%; + position: relative; + z-index: 50; +} - .se-menu{ - /*margin-top: 20%; */ - } +.se-menu{ + /*margin-top: 20%; */ +} - .se-menu ul{ - list-style: none; - padding: 0; - padding-left: 0; - } +.se-menu ul{ + list-style: none; + padding: 0; + padding-left: 0; +} - .se-menu li{ - width: 100%; - padding: 15px 0px 15px 15px; - font-size: 150%; - } +.se-menu li{ + width: 100%; + padding: 15px 0px 15px 15px; + font-size: 150%; +} - .se-menu li:hover{ - background-color: #E2E2E2; - font-weight: bold; - cursor: pointer; - } +.se-menu li:hover{ + background-color: #E2E2E2; + font-weight: bold; + cursor: pointer; +} - .se-menu li:active{ - background-color: #B2B2B2; - text-shadow:#e0e0e0 1px 1px 0; - font-weight: bold; - } +.se-menu li:active{ + background-color: #B2B2B2; + text-shadow:#e0e0e0 1px 1px 0; + font-weight: bold; +} - .se-menu .selected{ - background-color: #E2E2E2; - text-shadow:#e0e0e0 1px 1px 0; - font-weight: bold; - } +.se-menu .selected{ + background-color: #E2E2E2; + text-shadow:#e0e0e0 1px 1px 0; + font-weight: bold; +} - .user-box{ - width: 100% - } +.user-box{ + width: 100% +} - .user-box img{ - width: 100%; - border: 4px #7f7f7f solid; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - } - .user-data{ - margin-top: auto; - } +.user-box img{ + width: 100%; + border: 4px #7f7f7f solid; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.user-data{ + margin-top: auto; +} - .se-menu ul a{ - text-decoration: none !important; - color: #7f7f7f; - } +.se-menu ul a{ + text-decoration: none !important; + color: #7f7f7f; +} - /*Settings Style*/ +/*Settings Style*/ - .settingList .settingListItem:hover{ - background-color: #E2E2E2; - font-weight: bold; - } +.settingList .settingListItem:hover{ + background-color: #E2E2E2; + font-weight: bold; +} - .settingList .settingListItemRoot{ - list-style: none; - padding: 0; - padding-left: 0; - } +.settingList .settingListItemRoot{ + list-style: none; + padding: 0; + padding-left: 0; +} - .settingList .settingListItem{ - width: 100%; - padding: 15px 0px auto 15px; - } +.settingList .settingListItem{ + width: 100%; + padding: 15px 0px auto 15px; +} - /*End Settings*/ +/*End Settings*/ - /*md Effects*/ +/*md Effects*/ - .md-avatar{ - width: 40px; - height: 40px; - margin-top: 8px; - margin-bottom: 8px; - margin-right: 16px; - border-radius: 50%; - box-sizing: content-box; - } +.md-avatar{ + width: 40px; + height: 40px; + margin-top: 8px; + margin-bottom: 8px; + margin-right: 16px; + border-radius: 50%; + box-sizing: content-box; +} /* Colors*/ @@ -459,6 +426,11 @@ body.noscroll word-break: break-word; } +.tabDesign +{ + overflow: scroll; +} + .tasksContent { padding-left: 4px; @@ -484,7 +456,7 @@ p.tasksFeed { padding-left: 4px; margin: 5px; - width:340; + width:99%; height: auto; background-color: aliceblue; @@ -493,7 +465,7 @@ p.messagesFeed { padding-left: 4px; margin: 5px; - width:690; + width:99%; height: auto; background-color: #f5f5f5; } \ No newline at end of file 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/campusesController.js b/templates/js/controllers/campusesController.js index 30f804b..d3d5219 100644 --- a/templates/js/controllers/campusesController.js +++ b/templates/js/controllers/campusesController.js @@ -1,6 +1,7 @@ angular.module('SeHub') .controller('campusesController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService, $rootScope) { + $scope.loadingData = true; $scope.campusesEmpty = false; var token = $cookies['com.sehub.www']; @@ -34,6 +35,7 @@ angular.module('SeHub') { apiService.getCampusesByUser(token).success(function(data) // Get all the campuses { + $scope.loadingData = true; $scope.campuses = data; console.log("INSIDE " + $scope.campuses); init(); // Executing the function to initialize campuses display diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index a1c153f..9bcab36 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -34,28 +34,16 @@ angular.module('SeHub') console.log("Student Mode!"); } - // apiService.getCourseByCampusName(token).success(function(data) - // { - // console.log("Campus Name is ON! " + token) - // $scope.course = data; - // }).error(function(err) - // { - // console.log("Error ===> " + err + " ===> getCourseByCampusName") - // }); - - $scope.addMessageClicked = function() { $scope.addMsg = true; // Reveal the "POST" Button } $scope.postMessageClicked = function() // Posting the message itself { - - if($scope.msg.msgToAdd != null) { jsonNewMsg = { - 'courseName': 'A', // TODO Should be ===> $scope.course.courseName + 'courseName': 'Math', // TODO Should be ===> $scope.course.courseName 'message': $scope.msg.msgToAdd }; @@ -80,6 +68,37 @@ angular.module('SeHub') $scope.msg.msgToAdd = null; } + $scope.displayTasks = function() + { + // apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId + // { + + // }).error(function(err) + // { + + // }); + + + } + + $scope.getCourses = function() + { + // 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 && $scope.courses.length > 0) + // { + // $scope.coursesEmpty = false; + // } + // }).error(function(err) + // { + // console.log("error: " + err); + // }); + } + $scope.clearAllClicked = function() // Clear Screen from text { $scope.messages = []; @@ -97,4 +116,6 @@ angular.module('SeHub') // animation $scope.isEnterd = top.setIsEnterd; + $scope.getCourses(); // Get all the courses info + $scope.displayTasks(); // Display all tasks in task feed }]); \ No newline at end of file diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 5ccfd82..2591b3c 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,13 @@ 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 = 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/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/js/controllers/projectController.js b/templates/js/controllers/projectController.js index 6db2fa2..d3c3ebd 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; + } + + $scope.removeProject = function(ev) + { + $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.getProfileRoute = function(userName) + { + for(var i = 0; i < $scope.project.members.length; i++) + { + if(userName === $scope.project.members[i].name) + { + console.log(userName); + console.log($scope.project.members[i].name); + return '#/profile/' + $scope.project.members[i].id; + } + else + return '#'; + } + } + + $scope.getProjectInfo = function() + { + apiService.getProjectsById(token, projectId).success(function(data) + { + $scope.project = data; + // if($scope.user === $scope.project.info.master_id) + // { + // $scope.isMasterOrLecturer = true; + // } + // if($scope.project && $scope.project.length > 0) // TODO - TEST? + // { + $scope.loadingData = false; + // } + }).error(function(err) + { + console.log("Error: " + err.message); + }); + } + + $scope.getProjectInfo(); // Get all this project data }]); \ No newline at end of file diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index 33196f4..cd4c459 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -3,10 +3,8 @@ angular.module('SeHub') { console.log("in controller"); - $scope.createTaskClicked = function(name) + $scope.createTaskClicked = function() { - var taskName = name; - console.log("task created! " + taskName); $location.path("/tasks/new"); // Reference to 'newTask' page } diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index 6420e60..81d9e7a 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -13,6 +13,14 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, + getUserById: function(token, id){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id; + req = { + method : "GET", + url : url + }; + return $http(req); + }, getAllCampuses: function(token){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getAll/" + token; req = { @@ -21,6 +29,129 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, + getCampusesByUser: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getAllCoursesByCampus: function(token, campusId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAllCoursesByCampus/" + token + '/' + campusId; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getAllCourses: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getAllMessages: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAllMessages/" + token; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getMessagesByCourseName: function(token, courseName){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getMessagesByCourseName/" + token + '/' + courseName; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getCoursesByUser: function(token, campusId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + campusId; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getProjectsByCourse: function(token, classId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsByCourse/" + token + "/" + classId; + req = { + method : "GET", + url : url + }; + 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 = { + method : "GET", + url : url + }; + return $http(req); + }, + getCampusesByUserId: function(token, id){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUserID/" + token + "/" + id; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getCoursesByUserID: function(token, userId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + getAllFutureTasks: function(token, courseId){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token + "/" + courseId; + req = { + method : "GET", + url : url + }; + return $http(req); + }, + createMessage: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/messages/create/" + token; + req = { + method : "POST", + url : url, + data: payLoad + }; + return $http(req); + }, + create: function(token, payLoad){ // createProject + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/create/" + token; + req = { + method : "POST", + url : url, + data: payLoad + }; + return $http(req); + }, + createMessage: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token; + req = { + method : "POST", + url : url, + data: payLoad + }; + return $http(req); + }, sendValidationMail: function(token, email){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/validation/sendmail/" + token; payload = { @@ -33,62 +164,6 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - updateUser: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token; - - req = { - method: "PUT", - url: url, - data: payLoad - }; - return $http(req); - }, - getAllCoursesByCampus: function(token, campusId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAllCoursesByCampus/" + token + '/' + campusId; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - getAllCourses: function(token){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - getAllMessages: function(token){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAllMessages/" + token; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - createMessage: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token; - req = { - method : "POST", - url : url, - data: payLoad - - }; - return $http(req); - }, - getMessagesByCourseName: function(token, courseName){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getMessagesByCourseName/" + token + '/' + courseName; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, createCourse: function(token, payLoad){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token; req = { @@ -98,60 +173,6 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - getCampusesByUser: function(token){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - getCoursesByUser: function(token, campusId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + campusId; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, - getProjectsByCourse: function(token, classId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsByCourse/" + token + "/" + classId; - 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 = { - method : "GET", - url : url - - }; - return $http(req); - }, - - getUserById: function(token, id){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id; - req = { - method : "GET", - url : url - }; - return $http(req); - }, - getCampusesByUserId: function(token, id){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUserID/" + token + "/" + id; - req = { - method : "GET", - url : url - - }; - return $http(req); - }, joinCourse: function(token, courseId){ var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/joinCourse/" + token + "/" + courseId; req = { @@ -160,31 +181,14 @@ service.factory('apiService', ['$http', function($http) { }; return $http(req); }, - createMessage: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token; + updateUser: function(token, payLoad){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token; req = { - method : "POST", - url : url, + method: "PUT", + url: url, data: payLoad }; return $http(req); - }, - create: function(token, payLoad){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/create/" + token; - req = { - method : "POST", - url : url, - data: payLoad - }; - return $http(req); - }, - getCoursesByUserID: function(token, userId){ - var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId; - req = { - method : "GET", - url : url - }; - return $http(req); } }; }]); \ No newline at end of file diff --git a/templates/views/campuses.html b/templates/views/campuses.html index b04f311..c3e680b 100644 --- a/templates/views/campuses.html +++ b/templates/views/campuses.html @@ -1,7 +1,5 @@
- -

Pick A Campus

-
+

Pick A Campus

diff --git a/templates/views/class.html b/templates/views/class.html index d11ceed..0a8d051 100644 --- a/templates/views/class.html +++ b/templates/views/class.html @@ -55,7 +55,7 @@
@@ -85,4 +85,7 @@
+
+ +
\ No newline at end of file diff --git a/templates/views/home.html b/templates/views/home.html index bec06f6..0737ca4 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -88,6 +88,54 @@ + + + + + +
+ +
+
+
+ +
+
+
+
+ {{user.name}} +
+
+ class_name +
+
+
+
+
+
+ {{msg.text}} +
+
+
+
+
+
+
+ + +

Tab One

+ One +
+
+ + +

Tab Two

+ Two +
+
+
+
+
diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index 869e6e5..d00caf2 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -1,37 +1,41 @@
- +

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/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 diff --git a/templates/views/project.html b/templates/views/project.html index 8d4eba2..5d10acb 100644 --- a/templates/views/project.html +++ b/templates/views/project.html @@ -1,13 +1,151 @@ -
+
-

Project

- Yipi Kayea Mother Fraker -
- +
+
+

Project '{{project.projectName}}'

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

Messages

+

Messages...

+
+
+ + + + + + + + + + + + + +
MessageDateCommitter
+ + + {{msg.message}} + + + + + {{date.date}} + + + + {{member.name}} + +
+
+
+ + + + + + + + + + + + + + + +
TitleLabelsMilestoneUser
+ + {{issue.title}} + + + + + {{label.name}} + + + + {{issue.milestone.title}} + + + + {{issue.assignee.login}} + + + +
+
+
+ + +

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 diff --git a/templates/views/tasks.html b/templates/views/tasks.html index d38e8b4..e68dc9a 100644 --- a/templates/views/tasks.html +++ b/templates/views/tasks.html @@ -1,17 +1,22 @@

Tasks

-
- Create Task -
- + -

Submitted

-

Submitted...

+ + + + + + + + +
Task NameDateGrade
+
@@ -26,23 +31,20 @@

Not Submitted ..

- - -

WhatEver

-

Bla Bla Bla..

-
-
+
+ Create Task +
-
-
- +
+
+ - {{project.title}} + {{task.title}}