Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.js: Get mentors from Webservices #729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions partials/tabs/mentors.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="col m8 offset-m2">
<h1 class="fine center">Hello there!</h1>
<h4 class="light center">
We are the mentors for coala in GSoC 2018.
We are the mentors for coala in GSoC {{ gic.nextProgramYear }}.
</h4>
<h4 class="light center">
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a> -
Expand All @@ -18,7 +18,7 @@ <h4 class="light center">
<div class="row user">
<div class="parent-wrapper">
<div class="parent">
<div ng-repeat="member in gic.mentorsList" class="card child card-main sc">
<div ng-repeat="member in gic.mentorsList" class="card child card-main sc black-shadow">
<a ng-href="https://github.com/{{member.github_handle}}">
<div class="empty"></div>
<!-- data-proofer-ignore as html-proofer doesn't recognise ng-src -->
Expand All @@ -42,7 +42,7 @@ <h4 class="light center">
<div class="col m8 offset-m2">
<h1 class="fine center">Admins</h1>
<h4 class="light center">
We are the admins for coala in GSoC 2018.
We are the admins for coala in GSoC {{ gic.nextProgramYear }}.
</h4>
<h4 class="light center">
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a>
Expand All @@ -55,7 +55,7 @@ <h4 class="light center">
<div class="row user">
<div class="parent-wrapper">
<div class="parent">
<div ng-repeat="member in gic.adminsList" class="card card-main child sc">
<div ng-repeat="member in gic.adminsList" class="card card-main child sc black-shadow">
<a ng-href="https://github.com/{{member.github_handle}}">
<div class="empty"></div>
<!-- data-proofer-ignore as html-proofer doesn't recognise ng-src -->
Expand Down
3 changes: 3 additions & 0 deletions resources/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.black-shadow {
box-shadow: 0 0 15px 2px black;
}
.hash_value_dup {
position: 'absolute';
left: '-9999px';
Expand Down
24 changes: 24 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,30 @@
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() >= 6){
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")
Expand Down