|
386 | 386 | self.mentorsList = {} |
387 | 387 | self.adminsList = {} |
388 | 388 |
|
| 389 | + $scope.getMentorsWebservicesURL = function(year){ |
| 390 | + return 'https://webservices.coala.io/mentors?year='+year+'&program=GSoC' |
| 391 | + } |
| 392 | + |
| 393 | + var today = new Date() |
| 394 | + if (today.getMonth() >= 6){ |
| 395 | + self.nextProgramYear = today.getFullYear() + 1 |
| 396 | + } |
| 397 | + else { |
| 398 | + self.nextProgramYear = today.getFullYear() |
| 399 | + } |
| 400 | + |
| 401 | + var mentorsWebservicesURL = $scope.getMentorsWebservicesURL(self.nextProgramYear); |
| 402 | + |
| 403 | + $http.get(mentorsWebservicesURL) |
| 404 | + .then(function(response){ |
| 405 | + var mentors = response.data |
| 406 | + angular.forEach(mentors, function (data) { |
| 407 | + self.mentorsList[data.user.login] = { |
| 408 | + "github_handle": data.user.login, |
| 409 | + "github_avatar_url": "https://avatars.githubusercontent.com/" + data.user.login |
| 410 | + } |
| 411 | + }); |
| 412 | + }) |
389 | 413 | $http.get('data/projects.liquid') |
390 | 414 | .then(function (res) { |
391 | 415 | $scope.projects = res.data.filter(project => project.status != "completed") |
392 | | - angular.forEach($scope.projects, function(value, key){ |
393 | | - angular.forEach(value.mentors, function(value, key){ |
394 | | - self.mentorsList[value] = { |
395 | | - "github_handle" : value, |
396 | | - "github_avatar_url": "https://avatars.githubusercontent.com/" +value |
| 416 | + angular.forEach($scope.projects, function (value, key) { |
| 417 | + angular.forEach(value.mentors, function (value, key) { |
| 418 | + self.mentorsList[value] = { |
| 419 | + "github_handle": value, |
| 420 | + "github_avatar_url": "https://avatars.githubusercontent.com/" + value |
397 | 421 | } |
398 | 422 | }); |
399 | 423 | }); |
400 | 424 | }) |
401 | 425 |
|
402 | | - $http.get('data/admins.json') |
| 426 | + $http.get('data/admins.json') |
403 | 427 | .then(function (res) { |
404 | 428 | admins = res.data |
405 | 429 | angular.forEach(admins, function(value, key){ |
|
0 commit comments