Skip to content

Commit 9bf75d3

Browse files
committed
mentors.html: Change mentor page year dynamically
Have the year on the GSoC mentor page change dynamically based on the current month. If it's past September, the page will show the next year, otherwise it will show the current year. Closes #706
1 parent fa09436 commit 9bf75d3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

partials/tabs/mentors.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="col m8 offset-m2">
55
<h1 class="fine center">Hello there!</h1>
66
<h4 class="light center">
7-
We are the mentors for coala in GSoC 2018.
7+
We are the mentors for coala in GSoC {{ getGsocYear() }}.
88
</h4>
99
<h4 class="light center">
1010
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a> -
@@ -42,7 +42,7 @@ <h4 class="light center">
4242
<div class="col m8 offset-m2">
4343
<h1 class="fine center">Admins</h1>
4444
<h4 class="light center">
45-
We are the admins for coala in GSoC 2018.
45+
We are the admins for coala in GSoC {{ getGsocYear() }}.
4646
</h4>
4747
<h4 class="light center">
4848
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a>

resources/js/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
---
13
(function(){
24
var app = angular.module('coala', ['ngSanitize','btford.markdown', 'ngRoute']);
35

@@ -386,6 +388,16 @@
386388
self.mentorsList = {}
387389
self.adminsList = {}
388390

391+
$scope.getGsocYear = function() {
392+
var gsocSwitchMonth = {{ site.gsoc_switch_month }}
393+
var currentDate = new Date()
394+
if (currentDate.getMonth() >= gsocSwitchMonth) {
395+
return currentDate.getFullYear() + 1
396+
} else {
397+
return currentDate.getFullYear()
398+
}
399+
}
400+
389401
$http.get('data/projects.liquid')
390402
.then(function (res) {
391403
$scope.projects = res.data.filter(project => project.status != "completed")

0 commit comments

Comments
 (0)