-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/refactor to single page #24
Conversation
stacytalbot
commented
Dec 18, 2018
•
edited
Loading
edited
- Update Citation text in the footer to match Charlottes new design in Trello
- Bold the first paragraph in the header
- Refactor the whole site down from 5 pages to 1
- Remove the 'page name' from the site title because it is now only one page and this can't be updated via js
- Delete all files no longer used
- Leave in code for cartoDB in case it is reinstated at a later date
…ong with the data
…ng with ajaxed data
app/controllers/site_controller.rb
Outdated
aichi_targets = generateImageUrls @aichi_targets | ||
sdgs = generateImageUrls @sdgs | ||
|
||
@habitatData = { |
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.
We could extract this into a serialiser to improve the readability of the controller.
If not the whole hash, at least the map
key seems the most suitable part for this.
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.
@Levia my first serializer - be gentle
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.
🤔 🤔 🤔
app/controllers/site_controller.rb
Outdated
@@ -67,6 +87,14 @@ def load_global | |||
@sdgs = YAML.load(File.open("#{Rails.root}/lib/data/content/sdgs.yml", 'r')) | |||
end | |||
|
|||
def generateImageUrls targets | |||
targets['list'].each do |target| |
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.
You should be able to use map
instead of each
so you won't need to return targets
at the end. map
returns the modified array.
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.
If i don't return targets, it doesn't work
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.
Ah, I see the point now. That's fine then!
end | ||
|
||
private | ||
def content |
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.
Could you please just add an extra line between private and the defitions? Also removing the indentation so it's at the same level as the public methods :)
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.
It already has that on mine locally?!
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.
Oh - i was looking in the wrong file haha, too many carols in here