Merge branch 'master' into UI

Conflicts:
	templates/js/services/apiService.js
This commit is contained in:
Sagi Dayan 2015-06-29 14:45:37 +03:00
commit 2ce04b34d9
3 changed files with 34 additions and 19 deletions

View file

@ -1,21 +1,23 @@
__author__ = 'sagi'
import requests
from GithubAPI.GithubAPI import GitHubAPI_Keys
githubKeys = GitHubAPI_Keys()
def get_repo_general_info(repo_url):
url = 'https://api.github.com/repos/' + repo_url
url = 'https://api.github.com/repos/' + repo_url + '?client_id='+githubKeys.getId()+'&client_secret=' + githubKeys.getSecret()
req = requests.get(url)
return req.json()
def get_repo_stats(repo_url):
url = 'https://api.github.com/repos/' + repo_url + '/stats/contributors'
url = 'https://api.github.com/repos/' + repo_url + '/stats/contributors' + '?client_id='+githubKeys.getId()+'&client_secret=' + githubKeys.getSecret()
req = requests.get(url)
return req.json()
def get_repo_issues(repo_url):
url = 'https://api.github.com/repos/' + repo_url + '/issues'
url = 'https://api.github.com/repos/' + repo_url + '/issues' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret()
req = requests.get(url)
return req.json()

View file

@ -18,6 +18,11 @@ angular.module('SeHub')
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) {
@ -53,22 +58,22 @@ 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.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',

View file

@ -177,6 +177,14 @@ service.factory('apiService', ['$http', function($http) {
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);
}
};
}]);