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

mentors.html: Change mentor page year dynamically #709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aedorado
Copy link

@aedorado aedorado commented Feb 5, 2019

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

@TravisBuddy
Copy link

Travis tests have failed

Hey @aedorado,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Ruby: 2.5.1

View build log

docker run -v=$(pwd):/app --workdir=/app coala/base coala --ci
Unable to find image 'coala/base:latest' locally
latest: Pulling from coala/base
















Digest: sha256:125d6cf24929d39db47b3ccd83d6ed1b6a231fc7e8afbf70bc4b5bd87653b0ff
Status: Downloaded newer image for coala/base:latest
Executing section global...
[ERROR][07:07:25] The bear InvalidLinkBear does not fulfill all requirements. You are not connected to the internet.
Executing section commit...
Executing section linecount...
Executing section filenames...
Executing section markdown_filenames...
Executing section spacing...
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  34|  34| 1. Install [asdf-vm](https://asdf-vm.github.io/asdf/#/core-manage-asdf-vm) for your OS.
|  35|  35| 2. Using asdf-vm, install [ruby](https://github.com/asdf-vm/asdf-ruby).
|  36|  36| 3. Install Jekyll
|  37|    |-    
|    |  37|+
|  38|  38|         $ gem install jekyll bundler
|  39|  39| 
|  40|  40| ### Clone and Run
[INFO][07:07:28] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  40|  40| ### Clone and Run
|  41|  41| 
|  42|  42| Clone coala Projects repository
|  43|    |-    
|    |  43|+
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|  45|     
|  46|  46| Run coala Projects website
[INFO][07:07:28] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  42|  42| Clone coala Projects repository
|  43|  43|     
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|    |-    
|    |  45|+
|  46|  46| Run coala Projects website
|  47|  47| 
|  48|  48|     $ cd projects
[INFO][07:07:28] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
[INFO][07:07:28] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
[INFO][07:07:28] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
[INFO][07:07:28] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  34|  34| 1. Install [asdf-vm](https://asdf-vm.github.io/asdf/#/core-manage-asdf-vm) for your OS.
|  35|  35| 2. Using asdf-vm, install [ruby](https://github.com/asdf-vm/asdf-ruby).
|  36|  36| 3. Install Jekyll
|  37|    |-    
|    |  37|+
|  38|  38|         $ gem install jekyll bundler
|  39|  39| 
|  40|  40| ### Clone and Run
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  40|  40| ### Clone and Run
|  41|  41| 
|  42|  42| Clone coala Projects repository
|  43|    |-    
|    |  43|+
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|  45|     
|  46|  46| Run coala Projects website
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  42|  42| Clone coala Projects repository
|  43|  43|     
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|    |-    
|    |  45|+
|  46|  46| Run coala Projects website
|  47|  47| 
|  48|  48|     $ cd projects
Executing section html...
Executing section yml...
Executing section new_linelength_projects...
Executing section old_linelength_projects...
Executing section cli...
TravisBuddy Request Identifier: b59c60c0-2914-11e9-9de4-fb4b948767f7

@aedorado
Copy link
Author

aedorado commented Feb 5, 2019

@li-boxuan Please review the PR.

@@ -386,6 +386,16 @@
self.mentorsList = {}
self.adminsList = {}

$scope.getGsocYear = function() {
var gsocSwitchMonth = 6;
var currentdate = new Date();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var currentdate = new Date();
var currentDate = new Date();

Copy link
Author

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.

@@ -386,6 +386,16 @@
self.mentorsList = {}
self.adminsList = {}

$scope.getGsocYear = function() {
var gsocSwitchMonth = 6;
Copy link
Member

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

gsoc_switch_month: 6

Copy link
Author

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?

Copy link
Author

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?

Copy link
Author

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
@TravisBuddy
Copy link

Travis tests have failed

Hey @aedorado,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Ruby: 2.5.1

View build log

docker run -v=$(pwd):/app --workdir=/app coala/base coala --ci
Unable to find image 'coala/base:latest' locally
latest: Pulling from coala/base
















Digest: sha256:125d6cf24929d39db47b3ccd83d6ed1b6a231fc7e8afbf70bc4b5bd87653b0ff
Status: Downloaded newer image for coala/base:latest
Executing section global...
[ERROR][20:24:32] The bear InvalidLinkBear does not fulfill all requirements. You are not connected to the internet.
Executing section commit...
Executing section linecount...
Executing section filenames...
Executing section markdown_filenames...
Executing section spacing...
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  34|  34| 1. Install [asdf-vm](https://asdf-vm.github.io/asdf/#/core-manage-asdf-vm) for your OS.
|  35|  35| 2. Using asdf-vm, install [ruby](https://github.com/asdf-vm/asdf-ruby).
|  36|  36| 3. Install Jekyll
|  37|    |-    
|    |  37|+
|  38|  38|         $ gem install jekyll bundler
|  39|  39| 
|  40|  40| ### Clone and Run
[INFO][20:24:34] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  40|  40| ### Clone and Run
|  41|  41| 
|  42|  42| Clone coala Projects repository
|  43|    |-    
|    |  43|+
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|  45|     
|  46|  46| Run coala Projects website
[INFO][20:24:34] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/README.md
|    |++++| /app/README.md
|  42|  42| Clone coala Projects repository
|  43|  43|     
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|    |-    
|    |  45|+
|  46|  46| Run coala Projects website
|  47|  47| 
|  48|  48|     $ cd projects
[INFO][20:24:34] Applied 'ShowPatchAction' on 'README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  34|  34| 1. Install [asdf-vm](https://asdf-vm.github.io/asdf/#/core-manage-asdf-vm) for your OS.
|  35|  35| 2. Using asdf-vm, install [ruby](https://github.com/asdf-vm/asdf-ruby).
|  36|  36| 3. Install Jekyll
|  37|    |-    
|    |  37|+
|  38|  38|         $ gem install jekyll bundler
|  39|  39| 
|  40|  40| ### Clone and Run
[INFO][20:24:34] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  40|  40| ### Clone and Run
|  41|  41| 
|  42|  42| Clone coala Projects repository
|  43|    |-    
|    |  43|+
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|  45|     
|  46|  46| Run coala Projects website
[INFO][20:24:34] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Trailing whitespaces.
|----|    | /app/data/locale/en/README.md
|    |++++| /app/data/locale/en/README.md
|  42|  42| Clone coala Projects repository
|  43|  43|     
|  44|  44|     $ git clone https://github.com/coala/projects.git
|  45|    |-    
|    |  45|+
|  46|  46| Run coala Projects website
|  47|  47| 
|  48|  48|     $ cd projects
[INFO][20:24:34] Applied 'ShowPatchAction' on 'data/locale/en/README.md' from 'SpaceConsistencyBear'.
Executing section html...
Executing section yml...
Executing section new_linelength_projects...
Executing section old_linelength_projects...
Executing section cli...
TravisBuddy Request Identifier: 656d0830-2b16-11e9-bdf3-9bb996cd785e

@KVGarg
Copy link
Contributor

KVGarg commented Feb 7, 2019

Travis build failure due to Spacing Inconsistencies in README.md.
Recent changes done - #700
@aedorado Please ask @jayvdb to look over this issue. Need assistance over this

Copy link
Member

@areebbeigh areebbeigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
return currentDate.getFullYear()
}

Maybe get rid of the else block and replace it with return currentDate.getFullYear()

@@ -1,3 +1,5 @@
---
---
Copy link
Member

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?

Copy link
Author

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.

Copy link
Contributor

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

Copy link
Member

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 ;-)

@KVGarg
Copy link
Contributor

KVGarg commented Mar 1, 2019

Also, rebase needed ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Change mentor page year dynamically
7 participants