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

DRY up views by moving metadata logic into module #216

merged 10 commits into from Jan 3, 2017


Copy link

@fofr fofr commented Dec 22, 2016

  • Create a metadata module that provides all the parameters to be passed to the metadata and document footer metadata components
    • Module makes it hard to miss out an aspect of the metadata
    • Makes it easy to iterate across formats
    • Abstracts away the text direction, so it can't be forgotten
  • Update case studies to behave in the same was as other formats
    • Use full history rather than short history like other formats
  • Simplify fatality notices by moving image into presenter
  • Remove 'withdrawable' from format presenters, it's redundant
  • Stop rendering links to policy_areas on stat announcements, they are being deprecated, no
    other format links to them
fofr added 10 commits Dec 22, 2016
* Move image definition into presenter so the standard
sidebar_with_body template can be used
* Add alt text to the image – the image has value and the alt text is
useful to describe what the crest is
* Provide standard metadata parameters to presenter
* Simplify view significantly
* Make it harder to provide wrong details to metadata, or to forget
* Use same structure for published/updated as other formats, remove
* Access body in the same way as other formats in presenter
* Include metadata module and use methods
* Provide a high level text_direction method for all presenters
* Include metadata method in national applicability so that including
the module gets the necessary metadata automatically
The module is included in the base content item presenter.
Also remove unused UrlHelper
* Stop rendering links to policy_areas, they are being deprecated, no
other format links to them
* Use standard `from` and `part_of` methods
* Render links to topics, policies, etc as standard
* Update tests to query the `other` part of the hash metadata returns
* Format doesn’t currently provide an emphasised_organisations array,
protect against it not being present
@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-216 Dec 22, 2016 Inactive
@fofr fofr mentioned this pull request Dec 22, 2016
@gpeng gpeng merged commit 3ea139e into master Jan 3, 2017
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
@gpeng gpeng deleted the consolidate-views branch Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.