-
Notifications
You must be signed in to change notification settings - Fork 223
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
mentors.html: Change mentor page year dynamically #709
base: master
Are you sure you want to change the base?
Conversation
Travis tests have failedHey @aedorado, Ruby: 2.5.1docker run -v=$(pwd):/app --workdir=/app coala/base coala --ci
TravisBuddy Request Identifier: b59c60c0-2914-11e9-9de4-fb4b948767f7 |
@li-boxuan Please review the PR. |
resources/js/app.js
Outdated
@@ -386,6 +386,16 @@ | |||
self.mentorsList = {} | |||
self.adminsList = {} | |||
|
|||
$scope.getGsocYear = function() { | |||
var gsocSwitchMonth = 6; | |||
var currentdate = new Date(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var currentdate = new Date(); | |
var currentDate = new Date(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in the new commit.
resources/js/app.js
Outdated
@@ -386,6 +386,16 @@ | |||
self.mentorsList = {} | |||
self.adminsList = {} | |||
|
|||
$scope.getGsocYear = function() { | |||
var gsocSwitchMonth = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer reading the number from
Line 9 in ca8a58f
gsoc_switch_month: 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @li-boxuan Made the desired changes.
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 --ci
TravisBuddy Request Identifier: 656d0830-2b16-11e9-bdf3-9bb996cd785e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 396 to 398 in 9bf75d3
} else { | |
return currentDate.getFullYear() | |
} |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these being added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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