Page contents:
--
- <% @content_item.header_links.each do |header_link| %>
-
- <%=header_link[:title]%> - <% end %> -
From 64c2cc160d879f4b20498a3e63343b9d66c6a807 Mon Sep 17 00:00:00 2001 From: Ian James <1732331+injms@users.noreply.github.com> Date: Wed, 18 Sep 2019 13:26:59 +0100 Subject: [PATCH 1/7] Revert "Revert "Update to GOV.UK Frontend v3"" --- Gemfile | 4 +- Gemfile.lock | 13 +- app/assets/stylesheets/application.scss | 11 +- app/assets/stylesheets/hacks/_full-width.scss | 25 +- .../stylesheets/hacks/_header-tweaks.scss | 2 +- app/assets/stylesheets/mixins/_margins.scss | 16 +- .../stylesheets/modules/_change-history.scss | 34 +- .../stylesheets/modules/_collection.scss | 12 +- .../modules/_community-contact.scss | 5 +- .../modules/_govspeak-wrapper.scss | 11 +- app/assets/stylesheets/modules/_hero.scss | 62 +-- .../modules/_improve-this-page.scss | 66 ---- app/assets/stylesheets/modules/_metadata.scss | 31 -- app/assets/stylesheets/modules/_notice.scss | 8 +- .../stylesheets/modules/_page-contents.scss | 40 +- .../stylesheets/modules/_page-header.scss | 51 +-- app/assets/stylesheets/modules/_panel.scss | 18 +- .../stylesheets/modules/_related-content.scss | 26 +- app/assets/stylesheets/modules/_search.scss | 118 ------ .../modules/_service-standard-point.scss | 38 +- .../stylesheets/modules/_subsections.scss | 162 -------- .../stylesheets/modules/_typography.scss | 17 +- app/assets/stylesheets/print.scss | 5 - app/presenters/topic_presenter.rb | 69 +++- app/views/content_items/guide.html.erb | 162 ++++---- app/views/content_items/homepage.html.erb | 88 ++--- .../content_items/service_standard.html.erb | 103 +++-- app/views/content_items/topic.html.erb | 119 +++--- app/views/layouts/application.html.erb | 28 +- app/views/shared/_change_history.html.erb | 13 +- .../shared/_custom_phase_message.html.erb | 2 +- .../_custom_phase_message_homepage.html.erb | 2 +- app/views/shared/_email_signup.html.erb | 8 + app/views/shared/_improve_this_page.html.erb | 60 --- .../accordion-with-descriptions-spec.js | 360 ------------------ test/integration/guide_test.rb | 23 +- test/integration/improve_this_page_test.rb | 20 - test/integration/service_standard_test.rb | 9 +- test/integration/topic_test.rb | 32 -- 39 files changed, 452 insertions(+), 1421 deletions(-) delete mode 100644 app/assets/stylesheets/modules/_improve-this-page.scss delete mode 100644 app/assets/stylesheets/modules/_metadata.scss delete mode 100644 app/assets/stylesheets/modules/_search.scss delete mode 100644 app/assets/stylesheets/modules/_subsections.scss create mode 100644 app/views/shared/_email_signup.html.erb delete mode 100644 app/views/shared/_improve_this_page.html.erb delete mode 100644 spec/javascripts/accordion-with-descriptions-spec.js delete mode 100644 test/integration/improve_this_page_test.rb diff --git a/Gemfile b/Gemfile index a3dfe160..f8aaf27f 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'gds-api-adapters', '~> 60.0.0' gem 'govuk_app_config', '~> 2.0' gem 'govuk_elements_rails' gem 'govuk_frontend_toolkit', '~> 8.2.0' -gem 'govuk_publishing_components', '~> 17.21.0' +gem 'govuk_publishing_components', '~> 20.3.0' gem 'plek', '3.0.0' gem 'rails', '~> 5.2.3' gem 'rails-i18n', '~> 5.1.3' @@ -18,7 +18,7 @@ gem 'uglifier', '>= 1.3.0' group :development, :test do gem 'govuk-lint' gem 'jasmine-rails' - gem 'phantomjs', '~> 2.1.1' + gem 'phantomjs', '~> 2.1', '>= 2.1.1.0' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 9092172d..9d8383d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,7 +114,7 @@ GEM govuk_frontend_toolkit (8.2.0) railties (>= 3.1.0) sass (>= 3.2.0) - govuk_publishing_components (17.21.0) + govuk_publishing_components (20.3.0) gds-api-adapters govuk_app_config govuk_frontend_toolkit @@ -246,7 +246,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) robotex (1.0.0) - rouge (3.7.0) + rouge (3.10.0) rubocop (0.72.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) @@ -274,9 +274,8 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sassc (2.0.1) + sassc (2.2.0) ffi (~> 1.9) - rake sassc-rails (2.1.2) railties (>= 4.0.0) sassc (>= 2.0) @@ -360,10 +359,10 @@ DEPENDENCIES govuk_app_config (~> 2.0) govuk_elements_rails govuk_frontend_toolkit (~> 8.2.0) - govuk_publishing_components (~> 17.21.0) + govuk_publishing_components (~> 20.3.0) jasmine-rails listen (>= 3.0.5, < 3.2) - phantomjs (~> 2.1.1) + phantomjs (~> 2.1, >= 2.1.1.0) plek (= 3.0.0) poltergeist pry-byebug @@ -382,4 +381,4 @@ RUBY VERSION ruby 2.6.3p62 BUNDLED WITH - 1.16.2 + 1.17.2 diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6e618e9b..2eda776a 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,4 +1,7 @@ -// The main application stylesheet +$govuk-compatibility-govuktemplate: true; +$govuk-compatibility-govukfrontendtoolkit: true; +$govuk-compatibility-govukelements: true; +@import "govuk_publishing_components/all_components"; @import "common"; @@ -12,18 +15,12 @@ @import "modules/community-contact"; @import "modules/govspeak-wrapper"; @import "modules/hero"; -@import "modules/improve-this-page"; @import "modules/link-unit"; @import "modules/main-service-manual"; -@import "modules/metadata"; @import "modules/notice"; @import "modules/page-contents"; @import "modules/page-header"; @import "modules/panel"; @import "modules/related-content"; -@import "modules/search"; @import "modules/service-standard-point"; -@import "modules/subsections"; @import "modules/typography"; - -@import "govuk_publishing_components/all_components"; diff --git a/app/assets/stylesheets/hacks/_full-width.scss b/app/assets/stylesheets/hacks/_full-width.scss index 85856a2c..d77ce2d4 100644 --- a/app/assets/stylesheets/hacks/_full-width.scss +++ b/app/assets/stylesheets/hacks/_full-width.scss @@ -1,23 +1,10 @@ -.full-width { - // We're overriding static, we have to use IDs. - // scss-lint:disable IdSelector - #wrapper { - margin: 0; - width: auto; - max-width: 100%; - } - - #global-header-bar { +.app-full-width { + #global-header-bar { // scss-lint:disable IdSelector display: none; } +} - .govuk-beta-label { - border-bottom: none; - } - - .full-page-width-wrapper, - #wrapper .report-a-problem-toggle-wrapper, - #wrapper .report-a-problem-container { - @extend %site-width-container; - } +.app-\!-full-width-override { + margin: auto !important; + max-width: none !important; } diff --git a/app/assets/stylesheets/hacks/_header-tweaks.scss b/app/assets/stylesheets/hacks/_header-tweaks.scss index a24c393f..a50dc8fd 100644 --- a/app/assets/stylesheets/hacks/_header-tweaks.scss +++ b/app/assets/stylesheets/hacks/_header-tweaks.scss @@ -2,7 +2,7 @@ // this work, we need to slightly tweak the header's CSS from our app. .header-title { float: left; - color: $white; + color: govuk-colour("white"); @include bold-24; // When the title appears on its own line (the search box is hidden and only a diff --git a/app/assets/stylesheets/mixins/_margins.scss b/app/assets/stylesheets/mixins/_margins.scss index 33e5e42b..6ca7103c 100644 --- a/app/assets/stylesheets/mixins/_margins.scss +++ b/app/assets/stylesheets/mixins/_margins.scss @@ -1,16 +1,16 @@ @mixin responsive-bottom-margin { - margin-bottom: $gutter-half; + margin-bottom: govuk-spacing(3); @include media(tablet) { - margin-bottom: $gutter * 1.5; + margin-bottom: govuk-spacing(7); } } @mixin responsive-top-margin { - margin-top: $gutter-half; + margin-top: govuk-spacing(3); @include media(tablet) { - margin-top: $gutter * 1.5; + margin-top: govuk-spacing(7); } } @@ -21,11 +21,11 @@ @mixin gutter-bottom-margin { - margin-bottom: $gutter; + margin-bottom: govuk-spacing(6); } @mixin gutter-top-margin { - margin-top: $gutter; + margin-top: govuk-spacing(6); } @mixin gutter-vertical-margins { @@ -34,9 +34,9 @@ } @mixin gutter-bottom-margin-to-double { - margin-bottom: $gutter; + margin-bottom: govuk-spacing(3); @include media(tablet) { - margin-bottom: $gutter * 2; + margin-bottom: govuk-spacing(9); } } diff --git a/app/assets/stylesheets/modules/_change-history.scss b/app/assets/stylesheets/modules/_change-history.scss index 36469b5e..fb8c3534 100644 --- a/app/assets/stylesheets/modules/_change-history.scss +++ b/app/assets/stylesheets/modules/_change-history.scss @@ -1,33 +1,3 @@ -.change-history { - margin-top: 30px; - width: 66%; - - &__latest-change { - - dt { - @include core-19; - } - - dd { - @include bold-24; - margin-bottom: 10px; - } - } - - &__summary { - @include core-16; - color: $grey-1; - } - - &__past { - - time { - @include bold-19; - } - - li { - list-style: none; - margin-bottom: 10px; - } - } +.app-c-change-history__change-note { + color: $govuk-secondary-text-colour; } diff --git a/app/assets/stylesheets/modules/_collection.scss b/app/assets/stylesheets/modules/_collection.scss index 40e7701e..5f451fdc 100644 --- a/app/assets/stylesheets/modules/_collection.scss +++ b/app/assets/stylesheets/modules/_collection.scss @@ -1,12 +1,12 @@ .collection { - border-bottom: 1px solid $border-colour; + border-bottom: 1px solid $govuk-border-colour; - padding-bottom: $gutter-half; - margin-bottom: $gutter-half; + padding-bottom: govuk-spacing(3); + margin-bottom: govuk-spacing(3); @include media(tablet) { - padding-bottom: $gutter; - margin-bottom: $gutter; + padding-bottom: govuk-spacing(6); + margin-bottom: govuk-spacing(6); } &:last-child { @@ -22,7 +22,7 @@ &__description { @include core-24; - color: $secondary-text-colour; + color: $govuk-secondary-text-colour; margin-top: 0; } diff --git a/app/assets/stylesheets/modules/_community-contact.scss b/app/assets/stylesheets/modules/_community-contact.scss index 8628f3ec..cadd5cba 100644 --- a/app/assets/stylesheets/modules/_community-contact.scss +++ b/app/assets/stylesheets/modules/_community-contact.scss @@ -1,7 +1,6 @@ -.community-contact { - @include gutter-vertical-margins; +.app-c-community-contact { @include media(tablet) { text-align: right; - padding-top: $gutter-half; + padding-top: govuk-spacing(8); } } diff --git a/app/assets/stylesheets/modules/_govspeak-wrapper.scss b/app/assets/stylesheets/modules/_govspeak-wrapper.scss index e4a99eef..4880188d 100644 --- a/app/assets/stylesheets/modules/_govspeak-wrapper.scss +++ b/app/assets/stylesheets/modules/_govspeak-wrapper.scss @@ -8,17 +8,12 @@ .govuk-govspeak p, .govuk-govspeak ol, .govuk-govspeak ul { + line-height: 1.45; // govspeak margin bottom is 20px - margin-bottom: $gutter-half; + margin-bottom: govuk-spacing(3); } .govuk-govspeak h2 { - margin-top: 15px; - padding-top: 15px; - // govspeak margin-top is 45px - @include media(tablet) { - margin-top: 15px; - padding-top: 30px; - } + @extend %govuk-heading-m; } } diff --git a/app/assets/stylesheets/modules/_hero.scss b/app/assets/stylesheets/modules/_hero.scss index e4773fc0..0644458a 100644 --- a/app/assets/stylesheets/modules/_hero.scss +++ b/app/assets/stylesheets/modules/_hero.scss @@ -1,57 +1,25 @@ -.hero { - background-color: $govuk-blue; - color: $white; - - margin-bottom: $gutter-half; +.app-c-hero { + background-color: $govuk-brand-colour; + color: govuk-colour("white"); + margin-bottom: govuk-spacing(3); + position: relative; + top: -1px; @include media(tablet) { - margin-bottom: $gutter; + margin-bottom: govuk-spacing(6); } a:link, a:visited { - font-weight: bold; - color: $white; - } - - a:hover, - a:active { - color: $light-blue-25; + @include govuk-typography-weight-bold; } +} - &__content { - $border-top-width: 10px; - - @extend %site-width-container; - - padding: ($gutter-half + $border-top-width) 0 $gutter-half; - - @include media(tablet) { - padding: ($gutter + $border-top-width) 0 $gutter; - } - } - - &__title { - @include core-48; - margin-bottom: $gutter; - font-weight: bold; - } - - &__description { - @include core-24; - } - - &__feedback-link { - @include core-16; - line-height: 1.25; - margin-top: $gutter; - - @include media(tablet) { - margin-top: 0; - } - } +.app-c-hero-lead { + line-height: 1.35; +} - &__search { - margin-bottom: $gutter-half; - } +.app-c-hero__heading--inverse, +.app-c-hero__body--inverse { + color: govuk-colour("white"); } diff --git a/app/assets/stylesheets/modules/_improve-this-page.scss b/app/assets/stylesheets/modules/_improve-this-page.scss deleted file mode 100644 index b011b83a..00000000 --- a/app/assets/stylesheets/modules/_improve-this-page.scss +++ /dev/null @@ -1,66 +0,0 @@ -// Here we're using BEM which uses __ to denote an element within a block -// scss-lint:disable SelectorFormat - -.improve-this-page { - @include print { - display: none; - } -} - -.improve-this-page__prompt { - background-color: $govuk-blue; - color: $white; - padding: 10px $gutter-half 0; - - a:link, - a:visited { - color: $white; - display: inline-block; - - &:focus { - color: $black; - } - } - - &:focus { - outline: none; - } -} - -.improve-this-page__page-is-useful-button { - margin-right: 0.2em; -} - -.improve-this-page__is-useful-question { - @include bold-16; - - display: inline; -} - -.improve-this-page__anything-wrong { - float: right; -} - -.improve-this-page__form { - margin-top: $gutter; - padding: $gutter-half 0; - border-top: 10px solid $govuk-blue; - - .form-control { - width: 100%; - } -} - -.improve-this-page__close { - @include core-16; - - text-align: right; - display: block; - margin-bottom: 10px; - - @include media(tablet) { - display: inherit; - float: right; - padding-top: 0; - } -} diff --git a/app/assets/stylesheets/modules/_metadata.scss b/app/assets/stylesheets/modules/_metadata.scss deleted file mode 100644 index 07edd347..00000000 --- a/app/assets/stylesheets/modules/_metadata.scss +++ /dev/null @@ -1,31 +0,0 @@ -.metadata { - @include core-14; - @extend %contain-floats; - margin-bottom: 2em; - - dt { - float: left; - clear: left; - width: auto; - min-width: 120px; - - @include media(tablet) { - padding-right: $gutter-one-third; - } - } - - dd { - float: left; - width: 55%; - - @include media(tablet) { - width: 70%; - } - } - - // Adjust icon position for external links - a[rel="external"]:after { - content: "\A0\A0\A0\A0\A0\A0"; - background-position: right 0%; - } -} diff --git a/app/assets/stylesheets/modules/_notice.scss b/app/assets/stylesheets/modules/_notice.scss index 347412f4..07447485 100644 --- a/app/assets/stylesheets/modules/_notice.scss +++ b/app/assets/stylesheets/modules/_notice.scss @@ -1,17 +1,17 @@ .notice { clear: both; @include responsive-bottom-margin; - padding: $gutter-half; + padding: govuk-spacing(3); - border: 5px solid $govuk-blue; + border: 5px solid $govuk-brand-colour; @include media(tablet) { - padding: $gutter-two-thirds; + padding: govuk-spacing(4); } &__title { @include bold-36; - margin-bottom: $gutter-one-third; + margin-bottom: govuk-spacing(2); } &__description { diff --git a/app/assets/stylesheets/modules/_page-contents.scss b/app/assets/stylesheets/modules/_page-contents.scss index 26403ee6..cb0ea371 100644 --- a/app/assets/stylesheets/modules/_page-contents.scss +++ b/app/assets/stylesheets/modules/_page-contents.scss @@ -1,43 +1,15 @@ -.page-contents { - margin-top: 1em; - - @include media(tablet) { - margin-top: 0; - padding: 2em 0; - } - - &__title { - @include bold-16; - margin-bottom: 5px; - } - +.app-c-page-contents { &__list li { - @include core-16; - list-style-type: none; - margin-bottom: 5px; - margin-left: $gutter-half; - padding-right: $gutter-half; + margin-left: govuk-spacing(0); + padding-right: govuk-spacing(3); &:before { - content: "–"; - float: left; - display: block; - width: $gutter-half; - margin-left: -$gutter-half; + content: "– "; + display: inline-block; + padding-right: govuk-spacing(1); } } - &__list a { - text-decoration: none; - // Prevents emboldening from pushing text onto new lines - letter-spacing: 0.022em; - - &:hover, - &:focus, - &:active { - text-decoration: underline; - } - } // Styles required by GOVUK.HighlightActiveNavItem JS &__list .active { letter-spacing: 0; diff --git a/app/assets/stylesheets/modules/_page-header.scss b/app/assets/stylesheets/modules/_page-header.scss index 4210c173..2e0b4e09 100644 --- a/app/assets/stylesheets/modules/_page-header.scss +++ b/app/assets/stylesheets/modules/_page-header.scss @@ -1,43 +1,20 @@ -// Example usage: - -//
Context
-//-// How to work in an agile way: principles, tools and governance. -//
-//-// Additional descriptive text can sit here -//
-//<%= @content_item.category_title %>
-- <%= @content_item.description %> -
- <% end %> -+ <%= @content_item.description %> +
+ <% end %> +- <%= link_to "Give feedback about this page", "/contact/govuk", class: "feedback" %> + <%= link_to "Give feedback about this page", "/contact/govuk", class: "govuk-link" %>
+ + Show all page updates (<%= @content_item.previous_changes.length %>) +
++ Show all page updates (<%= @content_item.previous_changes.length + 1 %>)
-- Helping teams to create and run great public services that meet the <%= link_to 'Service Standard', '/service-manual/service-standard' %>. -
- -+ Helping teams to create and run great public services that meet the <%= link_to 'Service Standard', '/service-manual/service-standard', class: 'govuk-link app-link--inverse' %>. +
<%= link_to 'Contact the Service Manual team', '/contact/govuk' %> with any comments or questions.
++ <%= link_to 'Contact the Service Manual team', '/contact/govuk', class: 'govuk-link app-link--inverse' %> + with any comments or questions. +
+<%= topic["description"] %>
+<%= topic["description"] %>
The <%= link_to 'Service Standard', '/service-manual/service-standard' %> provides the principles of building a good service. This manual explains what teams can do to build great services that will meet the standard.
+The <%= link_to 'Service Standard', '/service-manual/service-standard', class: 'govuk-link' %> provides the principles of building a good service. This manual explains what teams can do to build great services that will meet the standard.
+You can view the <%= link_to 'communities of practice', '/service-manual/communities' %> to find more learning resources, see who has written the guidance in the manual and connect with digital people like you from across government.
+You can view the <%= link_to 'communities of practice', '/service-manual/communities', class: 'govuk-link' %> to find more learning resources, see who has written the guidance in the manual and connect with digital people like you from across government.
+- <%= @content_item.content_item["description"] %> -
-+ <%= @content_item.content_item["description"] %> +
+<%= point.description %>
-<%= link_to "Read more about point #{ point.number }", point.base_path %>
+ +#{point.description}
" if point.description.present? %> +<%= link_to "Read more about point #{ point.number }", point.base_path, class: 'govuk-link' %>
++
<%= @content_item.description %>
<%= link_group.description %>
- <% end %> -<%= link_group.description %>
<% end %> -