-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add 'How Government Works' page #2710
Conversation
59b993b
to
84cded9
Compare
84cded9
to
e2c27fa
Compare
e2c27fa
to
80cefb5
Compare
80cefb5
to
4524b72
Compare
04699cc
to
4524b72
Compare
4524b72
to
d09487c
Compare
Can't leave a comment in the right place! The images could be moved into the "buildings" folder, would mean we could rename the |
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.
Looking good, thanks :) Could you add a couple of images to the PR description please for the sake of comparison
Yeah, I think the whole images directory needs reviewing. I didn't want to put these into
Done |
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.
Looks good Bruce. Just a few minor comments.
We use the `classify` method to work out the presenter name from the schema name [1]. By default, Rails singularizes names when turning them into a class. This led to us incorrectly looking for the `HowGovernmentWorkPresenter`. Adding an inflection to tell Rails that this string is the same where singlular or plural, therefore leading to the correct presenter name being used. 1: https://github.com/alphagov/government-frontend/blob/e0c26e4d7685994e1def3a19751acc7e49c97ab5/app/services/presenter_builder.rb#L41
d09487c
to
60537b1
Compare
This will be used to get the relevant pieces of information from the content item for this page.
These images are included in the page, so need to be added here. The photograph of Churchill was already present in this repo as it is already included in another page.
This code has been lifted and shifted almost verbatim from Whitehall [1]. The only changes that have been made are: - replacing the Whitehall variable names with those used by Government Frontend - add links where we don't have the helper method available that are present in Whitehall - add missing alt text to images - replacing a hardcoded '300+' for agencies and other public bodies with a dynamic number that rounds down to the hundred (e.g. 480 would be 400+) - fixed a typo ("Agencies other public bodies" to "Agencies and other public bodies") Text has not been added to the locale files, since this page is mostly hardcoded content that is unlikely to be translated. 1: https://github.com/alphagov/whitehall/blob/1838b2e1aaf081165e8664cb9ee31941ac0acb3a/app/views/home/how_government_works.html.erb
The code ported from Whitehall was implementing it's own version of the big number component, so replacing to use the component instead.
60537b1
to
7880993
Compare
This adds the How Government Works page, which is currently rendered by Whitehall.
Trello card
Follow these steps if you are doing a Rails upgrade.