diff --git a/partials/tabs/mentors.html b/partials/tabs/mentors.html index 28b87b02..061a6fe9 100644 --- a/partials/tabs/mentors.html +++ b/partials/tabs/mentors.html @@ -4,7 +4,7 @@

Hello there!

- We are the mentors for coala in GSoC 2018. + We are the mentors for coala in GSoC {{ gic.nextProgramYear }}.

Just drop a message on Gitter - @@ -18,7 +18,7 @@

-
+
@@ -42,7 +42,7 @@

Admins

- We are the admins for coala in GSoC 2018. + We are the admins for coala in GSoC {{ gic.nextProgramYear }}.

Just drop a message on Gitter @@ -55,7 +55,7 @@

-
+
diff --git a/resources/css/style.css b/resources/css/style.css index f2395d87..1f94747e 100644 --- a/resources/css/style.css +++ b/resources/css/style.css @@ -1,3 +1,6 @@ +.black-shadow { + box-shadow: 0 0 15px 2px black; +} .hash_value_dup { position: 'absolute'; left: '-9999px'; diff --git a/resources/js/app.js b/resources/js/app.js index af811167..548a5c35 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -381,25 +381,49 @@ return { restrict: 'E', templateUrl: '/partials/tabs/mentors.html', - controller: function ($scope, $rootScope) { + controller: function ($scope, $rootScope, $log) { self = this self.mentorsList = {} self.adminsList = {} + $scope.getMentorsWebservicesURL = function(year){ + return 'https://webservices.coala.io/mentors?year='+year+'&program=GSoC' + } + + var today = new Date() + if(today.getMonth() > 9){ + self.nextProgramYear = today.getFullYear() + 1 + } + else { + self.nextProgramYear = today.getFullYear() + } + + var mentorsWebservicesURL = $scope.getMentorsWebservicesURL(self.nextProgramYear); + + $http.get(mentorsWebservicesURL) + .then(function(response){ + var mentors = response.data + angular.forEach(mentors, function (data) { + self.mentorsList[data.user.login] = { + "github_handle": data.user.login, + "github_avatar_url": "https://avatars.githubusercontent.com/" + data.user.login + } + }); + }) $http.get('data/projects.liquid') .then(function (res) { $scope.projects = res.data.filter(project => project.status != "completed") - angular.forEach($scope.projects, function(value, key){ - angular.forEach(value.mentors, function(value, key){ - self.mentorsList[value] = { - "github_handle" : value, - "github_avatar_url": "https://avatars.githubusercontent.com/" +value + angular.forEach($scope.projects, function (value, key) { + angular.forEach(value.mentors, function (value, key) { + self.mentorsList[value] = { + "github_handle": value, + "github_avatar_url": "https://avatars.githubusercontent.com/" + value } }); }); }) - $http.get('data/admins.json') + $http.get('data/admins.json') .then(function (res) { admins = res.data angular.forEach(admins, function(value, key){