Merge branch 'master' of https://github.com/sagidayan/SE-Hub into API_Dev

This commit is contained in:
Aran Zaiger 2015-07-01 22:23:47 +03:00
commit 061d45ad56
21 changed files with 815 additions and 523 deletions

View file

@ -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():

View file

@ -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

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
cookie_name = "com.sehub.www";
var YouEntered;
function putCookie() {
if(document.cookie != document.cookie)
{index = document.cookie.indexOf(cookie_name);}
else
{ index = -1;}
if (index == -1)
{
YouEntered=document.cf.cfd.value;
document.cookie=""+cookie_name+"="+YouEntered+"; path=/";
window.location.assign("/");
}
}
</SCRIPT>
<FORM NAME="cf">
Enter The User Token: <INPUT TYPE="text" NAME="cfd" size="20">
<INPUT TYPE="button" Value="Set to Cookie"
onClick="putCookie()">
</FORM>
</body>
</html>

View file

@ -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,25 +193,19 @@ body.noscroll
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
}
/*.dropDown /* TODO *
{
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;
}*/
.allCampusesShow
{
overflow:hidden;
background-size: auto;
}
.campusCard
.gray-font-no-animation
{
/*height:80%;*/
/*width:80%;*/
color: #7f7f7f;
font-size: 300%;
text-shadow:#e0e0e0 1px 1px 0;
}
.gray-font
@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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
}]);

View file

@ -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)
{

View file

@ -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
}]);

View file

@ -7,26 +7,33 @@ 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.userExists = true;
apiService.getCampusesByUserId(token, id)
.success(function(data) {
$scope.campuses = data;
console.log(data);
apiService.getCoursesByUserID(token, id).success(function(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);
console.error("++++++++++++++++++++");
});
});
@ -55,39 +62,6 @@ 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'];

View file

@ -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
}]);

View file

@ -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
}

View file

@ -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",
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);
}
};
}]);

View file

@ -1,7 +1,5 @@
<div class = "myCampuses">
<md-content layout-padding layout-margin>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-university"></i> Pick A Campus</h1>
</md-content>
<md-card class="cardAllCampuses">
<div ng-if = "!scope.campusesEmpty">
<div flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>

View file

@ -55,7 +55,7 @@
</md-input-container>
</div>
<!-- <div>
<p>/</p>
<br>/</br>
</div> -->
<div>
<md-input-container flex>
@ -85,4 +85,7 @@
</md-card>
</div>
</div>
<div layout-margin>
</div>
</div>

View file

@ -88,6 +88,54 @@
</md-card>
</div>
</div>
<md-card height="70%">
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<md-content class="md-padding">
<div class = "messagesContent">
<md-card ng-repeat = "msg in messages">
<div layout="column">
<div layout="row" layout-margin layout-padding>
<div flex="10" class="md-avatar">
<img ng-src="{{user.avatar_url}}" style="width:100%">
</div>
<div flex>
<div layout = "column">
<div>
<b>{{user.name}}</b>
</div>
<div>
class_name
</div>
</div>
</div>
</div>
<div>
<div flex="69" class="msgSent" layout-margin layout-padding>
{{msg.text}}
</div>
</div>
</div>
</md-card>
</div>
</md-content>
</md-tab>
<md-tab label="one">
<md-content class="md-padding">
<h1 class="md-display-2">Tab One</h1>
One
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<h1 class="md-display-2">Tab Two</h1>
Two
</md-content>
</md-tab>
</md-tabs>
</md-content>
</md-card>
<div class ="addMessage" layout="row" layout-margin layout padding>
<div>
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary"><i class="fa fa-comments"></i></md-button>

View file

@ -1,11 +1,17 @@
<div class = "myClasses">
<md-content layout-padding layout-margin>
<!-- <md-content layout-padding layout-margin> -->
<h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1>
</md-content>
<!-- </md-content> -->
<div layout-paddig layout-margin class="loader" ng-if="loadingData">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<div ng-if = "coursesEmpty && !loadingData" layout-padding layout-margin>
You Are Not Related To Any Course, You May Join Any Course You Wish.
</div>
<div ng-if = "!coursesEmpty">
<md-card class="cardAllcourses">
<div flex = "99" layout = "row" ng-repeat = "t in holdArrays" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" >
<div ng-if = "!scope.coursesEmpty">
<div ng-if="t.length != 1">
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
<div style="width:97%;height:97%">
@ -26,12 +32,10 @@
</div>
</div>
<div class="spacer"></div>
<div ng-if = "scope.coursesEmpty">
You Are Not Related To Any Course, You May Join Any Course You Wish.
</div>
</div>
</div>
</md-card>
</div>
<!-- Lecturer Mode -->

View file

@ -4,7 +4,7 @@
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<md-content layout-padding>
<md-content layout-padding ng-if="userExists && !loadingData">
<md-card layout-padding>
<h1><i class="fa fa-cogs"></i> {{title}}</h1>
<div layout="row">
@ -73,7 +73,7 @@
<div class="settingListRoot">
<div ng-repeat="course in courses" class="settingListItem" layout="row">
<div>
<img alt="{{ person.name }}" ng-src="{{ course.campus_avatar }}" class="md-avatar" />
<img alt="{{ person.name }}" src="https://www.isc2.org/uploadedimages/education/classroom-based-training-icon.png" class="md-avatar" />
</div>
<div class="port_spacer">
{{ course.courseName }} - <strong>IN</strong> {{course.campusName}}
@ -115,8 +115,34 @@
<!-- End Campuses & Classes Div -->
</div>
</md-card>
</md-content>
<md-content layout-padding ng-if="!userExists && !loadingData" class="gray-font-no-animation">
<md-card>
<div layout="row">
<div class="spacer"></div>
<div>
<h1><i class="fa fa-exclamation-triangle"></i></h1>
</div>
<div class="spacer"></div>
</div>
<div layout="row">
<div class="spacer"></div>
<div>
<h1>User Not Found</h1>
</div>
<div class="spacer"></div>
</div>
<div layout="row">
<div class="spacer"></div>
<div>
<P>Might Not Be A Registered SE-Hub User</P>
</div>
<div class="spacer"></div>
</div>
</md-card>
</md-content>
</div>

View file

@ -1,13 +1,151 @@
<div class = "myClasses">
<div class = "project">
<md-content layout-padding layout-margin>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project</h1>
Yipi Kayea Mother Fraker
<div layout = "row">
<div>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project '{{project.projectName}}'</h1>
</div>
<div> <!-- ng-if = "{{project.logo_url}}"> -->
<div flex = "10">
<img ng-src="{{project.logo_url}}" class = "md-avatar">
</div>
</div>
<div>
<div layout = "row" flex = "45">
<!-- <div ng-if = "isMasterOrLecturer"> -->
<md-card layout = "row">
<div layout-padding>
<md-button ng-click="editProject($event)" ng class="md-raised md-primary">
<i class="fa fa-pencil-square-o"></i>
</md-button>
</div>
<div layout-padding>
<md-button ng-click="removeProject($event)" ng class="md-raised md-primary">
<i class="fa fa-times"></i>
</md-button>
</div>
</md-card>
<!-- </div> -->
</div>
</div>
</div>
<md-card>
<div flex = "80" layout = "row" style="height:40%;" layout-margin>
<div flex = "10" layout-padding layout-margin border = "1">
Team Members:
<ul layout-padding>
<li ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;"> {{member.name}}</a>
</li>
</ul>
</div>
<div flex = "40">
<!-- Graph -->
<div ng-if="loadingData" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="line" class="chart chart-line" data="project.info.stats.weekly_commits.data" labels="project.info.stats.weekly_commits.labels" legend="true" ></canvas>
</md-card>
</div>
<div flex = "35">
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="project.projectName" class="chart chart-bar" data="project.info.stats.micro.data" labels="project.info.stats.micro.labels" series="project.info.stats.micro.series"></canvas>
</md-card>
</div>
</div>
</md-card>
<div>
<div flex = "96" style="height:70%;">
<div flex>
<md-card>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<md-content class="md-padding">
<h1 class="md-display-2">Messages</h1>
<p>Messages...</p>
</md-content>
</md-tab>
<md-tab label="Commits">
<md-content class="md-padding">
<table style="width:100%;" border = "1" class = "tabDesign">
<tr>
<th>Message</th>
<th style = "width:20%;">Date</th>
<th style = "width:10%;">Committer</th>
</tr>
<tr ng-repeat = "commit in project.info.commits" layout-margin align = "center">
<td>
<span ng-repeat = "msg in commit">
<a target = "_blank"ng-href="{{commit.html_url}}"
style="text-decoration:none; color:black;">
{{msg.message}}
</a>
</span>
</td>
<td>
<span ng-repeat = "date in commit.author">
{{date.date}}
</span>
</td>
<td ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;">
{{member.name}}
</a>
</td>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="Issues">
<md-content class="md-padding" style="overflow:scroll;">
<table style="width:100%;" border = "1">
<tr>
<th>Title</th>
<th style = "width:15%;">Labels</th>
<th style = "width:10%;">Milestone</th>
<th style = "width:10%;">User</th>
</tr>
<tr ng-repeat = "issue in project.info.issues" layout-margin align="center">
<td align="top">
<a target="_blank" ng-href="{{issue.html_url}}" style="text-decoration:none; color:black;">
{{issue.title}}
</a>
</td>
<td>
<span ng-repeat = "label in issue.labels">
<md-card style="background-color:{{label.color}}">
{{label.name}}
</md-card>
</span>
</td>
<td>
{{issue.milestone.title}}
</td>
<td>
<span ng-repeat = "member in project.members">
<a ng-href = "{{getProfileRoute(issue.assignee.login)}}" style="text-decoration:none; color:black;">
{{issue.assignee.login}}
</a>
</span>
</td>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="tasks">
<md-content class="md-padding">
<h1 class="md-display-2">tasks</h1>
<p>tasks..</p>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</md-card>
</div>
</div>
</div>

View file

@ -1,17 +1,22 @@
<div class = "tasks">
<md-content layout-padding layout-margin>
<h1 style="margin-left:15px"><i class="fa fa-file-text-o"></i> Tasks</h1>
<div ng-if="user.isLecturer">
<md-button ng-click="createTaskClicked(taskName)" ng class="md-raised md-primary">Create Task</md-button>
<div flex>
<md-card>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Submitted">
<md-tab label="" <i class="fa fa-check"></i>
<md-content class="md-padding">
<h1 class="md-display-2">Submitted</h1>
<p>Submitted...</p>
<table style="width:100%;" border = "1" class = "tabDesign">
<tr>
<th style = "width:20%">Task Name</th>
<th style = "width:20%">Date</th>
<th style = "width:20%">Grade</th>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="Delayed">
@ -26,23 +31,20 @@
<p> Not Submitted ..</p>
</md-content>
</md-tab>
<md-tab label="WhatEver">
<md-content class="md-padding">
<h1 class="md-display-2">WhatEver</h1>
<p>Bla Bla Bla..</p>
</md-content>
</md-tab>
<div ng-if = "user.isLecturer">
<md-button ng-click="createTaskClicked()" ng class="md-raised md-primary">Create Task</md-button>
</div>
</md-tabs>
</md-content>
</md-card>
</div>
<!-- Should Be In Table List -->
<div class = "allProjectsShow" flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "project in t" value = "{{project}}">
<md-button ng-click = "goToProject(project.id)" style="width:32%; height:32%;" flex="32" layout-padding class = "md-raised">
<div class = "allTasksShow" flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "task in t" value = "{{task}}">
<md-button ng-click = "goToTask(task.id)" style="width:32%; height:32%;" flex="32" layout-padding class = "md-raised">
<!-- <img src="{{campus.avatar_url}}" style = "width:14%; height:auto;"> -->
{{project.title}}
{{task.title}}
</md-button>
</div>
</div>