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

PP-1798 Add govuk template #318

Merged
merged 11 commits into from
Apr 10, 2017
Merged

PP-1798 Add govuk template #318

merged 11 commits into from
Apr 10, 2017

Conversation

tombye
Copy link
Contributor

@tombye tombye commented Mar 30, 2017

What

This updates pay-selfservice to use the GOVUK template, like pay-frontend.

How

It adds the NPM package of the mustache version of the GOVUK template. It adds a transpilation script, already used in pay-frontend, to convert its tags to a version supporting block inheritance.

The templating library this app uses, hoganJS, supports this extension so this just works™.

Notes

Apart from making the GOVUK template the base template for all pages, this also separates out the header and side navigation into partials.

It also makes the header look more like that used on the payments product page.

New header full-width

new_layout_template_desktop

New header small-screen

new_layout_template_mobile

New header small-screen with menu open

new_layout_template_mobile_open

@tombye tombye changed the title Add govuk template PP-1798 Add govuk template Mar 30, 2017
@ghost
Copy link

ghost commented Mar 30, 2017

There were errors, for info, please see...

@rauligs rauligs self-requested a review March 30, 2017 08:51
@rauligs rauligs self-assigned this Mar 31, 2017
@rauligs rauligs force-pushed the add-govuk_template branch 3 times, most recently from f276de1 to e4bd3c0 Compare April 4, 2017 09:20
@rauligs
Copy link
Contributor

rauligs commented Apr 5, 2017

👍 Will merge as soon it goes 🍏

Includes the addition of a script (used in
pay-frontend) to convert the standard GOVUK
Mustache template to the version that supports
inheritance.

This was added so we didn't need to use the
version with inheritance on the GOVUK template
repo (which only comes as a tarball so is harder
to manage).

See this commit for details of the process:

alphagov/govuk-prototype-kit@e382758
`vendorViews` was duplicating the paths the
template engine searched for templates to compile.
We also needed to add the GOVUK template views
folder to these paths.

The GOVUK template's assets folder also needed to
be added to the static asset path.
Because this includes some default HTML to go in
the `{{$content}}` block, this required a new
sub-block called `{{$mainContent}}` for all the
pages that use the base templates to put their
content in.
Moves the 'log out' link out to a partial and uses
the propositional navigation pattern to combine it
with the 'My Services' link.
Uses the banner built for indicating the phase
(alpha/beta) the service is in.

See:
http://govuk-elements.herokuapp.com/alpha-beta-banners/

Requires some temporary styles to support the
wider central column.
Also includes
- some fixes for mobile
- styles to make it (roughly) match the product
  page format
- fixes for a few visual bugs
The new implementation puts the 'Log out' and 'My
Services' links in a propositional navigation
partial (used by the GOVUK template). This means
the tests that found the navigation by looking for
an unordered list fail.

This makes the selector for them more specific so
they cna find the navigation and fixes some issues
with another test due to the new inheritance we're
using.
It was previously added on the assumption that the
`currentGatewayAccount` variable is always sent
through. This is not true so this protects against
situations where that isn't the case.
Merges the staff templates with the layout ones to
make only one for each state (logged in/out).
The GOVUK template has <link> tags for IE6-8
variants of the main stylesheet. Until these are
removed we should provide the files so the network
requests are fulfilled.

(Without our using any of the associated Sass
helpers, they are essentially duplicates of
`application.css` and are only delivered to those
browsers.)
@rauligs rauligs merged commit dd1c2d5 into master Apr 10, 2017
@rauligs rauligs deleted the add-govuk_template branch April 10, 2017 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants