mentors.html: Change mentor page year dynamically#709
mentors.html: Change mentor page year dynamically#709aedorado wants to merge 1 commit intocoala:masterfrom
Conversation
Travis tests have failedHey @aedorado, Ruby: 2.5.1docker run -v=$(pwd):/app --workdir=/app coala/base coala --ciTravisBuddy Request Identifier: b59c60c0-2914-11e9-9de4-fb4b948767f7 |
|
@li-boxuan Please review the PR. |
resources/js/app.js
Outdated
|
|
||
| $scope.getGsocYear = function() { | ||
| var gsocSwitchMonth = 6; | ||
| var currentdate = new Date(); |
There was a problem hiding this comment.
| var currentdate = new Date(); | |
| var currentDate = new Date(); |
resources/js/app.js
Outdated
| self.adminsList = {} | ||
|
|
||
| $scope.getGsocYear = function() { | ||
| var gsocSwitchMonth = 6; |
There was a problem hiding this comment.
Hi @li-boxuan . Not entirely sure how we can go about injecting this variable into the angularjs script. Do you have anything in mind?
There was a problem hiding this comment.
I could add frontmatter to the file app.js and use the variable as var gsocSwitchMonth = {{ site.gsoc_switch_month }}. Does this look like a good enough solution to you?
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 coala#706
Travis tests have failedHey @aedorado, Ruby: 2.5.1docker run -v=$(pwd):/app --workdir=/app coala/base coala --ciTravisBuddy Request Identifier: 656d0830-2b16-11e9-bdf3-9bb996cd785e |
areebbeigh
left a comment
There was a problem hiding this comment.
Lines 396 to 398 in 9bf75d3
Maybe get rid of the else block and replace it with return currentDate.getFullYear()
| @@ -1,3 +1,5 @@ | |||
| --- | |||
| --- | |||
There was a problem hiding this comment.
@jayvdb This is the frontmatter needed by jekyll to interpolate a file. Without this we cannot read the value gsocSwitchMonth from the _config.yml file as suggested by @li-boxuan.
There was a problem hiding this comment.
To avoid this @aedorado you can pass the value to function getGsocYear() from html page itself.
Doing so, will omit those two new lines containing hyphen
There was a problem hiding this comment.
Yes please. embedding jekyll liquid variables inside JS is just too confusing ;-)
|
Also, rebase needed ;-) |
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