From 0b71b70db3a7e0a210aa124a21a5f79af39d0d3d Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Feb 2021 11:54:32 +0000 Subject: [PATCH 1/6] Remove ported assets These are only being used by licence-finder so we moved them there to simplify static: https://github.com/alphagov/licence-finder/pull/914 --- app/assets/stylesheets/helpers/_core.scss | 153 ----- .../stylesheets/helpers/_multi-step.scss | 182 ------ .../stylesheets/helpers/_publisher.scss | 338 ---------- app/assets/stylesheets/helpers/_text.scss | 594 ------------------ app/assets/stylesheets/static.scss | 5 - 5 files changed, 1272 deletions(-) delete mode 100644 app/assets/stylesheets/helpers/_core.scss delete mode 100644 app/assets/stylesheets/helpers/_multi-step.scss delete mode 100644 app/assets/stylesheets/helpers/_publisher.scss delete mode 100644 app/assets/stylesheets/helpers/_text.scss diff --git a/app/assets/stylesheets/helpers/_core.scss b/app/assets/stylesheets/helpers/_core.scss deleted file mode 100644 index e98664899..000000000 --- a/app/assets/stylesheets/helpers/_core.scss +++ /dev/null @@ -1,153 +0,0 @@ -// Core global styles -body { - @include ie(8) { - min-width: 1024px; - } -} - -p { - @include govuk-font(19); -} - -h2, -h3, -h4 { - font-weight: 400; -} - -h2 { - @include govuk-font(24); - margin-top: .5em; - margin-bottom: .25em; -} - -h3 { - @include govuk-font(19); - margin-top: .5em; - margin-bottom: .25em; -} - -h4 { - @include govuk-font(19); - margin-top: .5em; - margin-bottom: .25em; -} - -// Page headers -header.page-header div { // stylelint-disable-line selector-no-qualifying-type - @include govuk-media-query($from: tablet) { - margin-top: govuk-spacing(6); - margin-bottom: govuk-spacing(6); - } - - h1 { - @extend %govuk-heading-xl; - background-repeat: no-repeat; - color: $text-colour; - font-weight: 600; - - span { - @include govuk-font($size: 27, $line-height: 1); - display: block; - margin-bottom: .25em; - text-shadow: none; - color: $secondary-text-colour; - } - } -} - -// Licence Application -.relevant-authority { - margin: 0 0 govuk-spacing(4) 84px; - - h2 { - margin: 0; - } -} - -.licence .intro form { - ul { - padding-left: 12px; - } - - li { - list-style: none; - - label { - padding-left: govuk-spacing(1); - } - } -} - -// Stuff (mainly) used in publications - -// Meta-data -.meta-data { - @include govuk-font(16); - color: $secondary-text-colour; - - p { - text-align: left; - - a { - color: $secondary-text-colour; - } - @include govuk-font(16); - } -} - -// Error messages -.error-notification { - border: 1px solid #ffc946; - background-color: #fbedcd; - padding: 0 1em; - margin-bottom: 1em; - - p { - @include govuk-font(16); - } -} - -.close { - margin: 0; - position: absolute; - top: 0; - right: 0; - - a { - background-color: transparent; - background-image: image-url("close.png"); - background-position: 50% 50%; - background-repeat: no-repeat; - display: block; - margin: 0; - height: 2em; - width: 2em; - text-indent: -9999px; - - &:hover { - background-color: rgba(0, 0, 0, .25); - } - } -} - -.sets-cookie { - @include govuk-font(14); -} - -.cookie-container { - margin: 0; - position: absolute; - bottom: 1em; - right: 1em; -} - -.find-location-for-service .cookie-container { - bottom: 1em; - right: .75em; - - @include media-down(mobile) { - bottom: govuk-spacing(4); - right: 16px; - } -} diff --git a/app/assets/stylesheets/helpers/_multi-step.scss b/app/assets/stylesheets/helpers/_multi-step.scss deleted file mode 100644 index ebd4b69cd..000000000 --- a/app/assets/stylesheets/helpers/_multi-step.scss +++ /dev/null @@ -1,182 +0,0 @@ -// This is basically Smart Answers & Licence Finder & Finance Finder -// Additional Smart Answers specific css can be found in the smart-answers repo - -// Questions -.hint { - @include govuk-font(16); - display: block; -} - -.done-questions { - position: relative; -} - -.start-again { - background: #ffffff; - position: absolute; - right: 0; - top: -2.5em; - height: 2.5em; - width: 11em; - - a { - @include govuk-font(19, $line-height: 40 / 19); - display: block; - text-align: center; - text-decoration: underline; - - @include govuk-media-query($from: tablet) { - @include govuk-font(19, $line-height: 40 / 13); - } - - &:hover { - text-decoration: none; - } - } - - @include media-down(mobile) { - position: static; - width: auto; - padding: 0 1em; - - a { - text-align: right; - } - } -} - -.question-number { - padding-right: .5em; -} - -// stylelint-disable selector-no-qualifying-type, max-nesting-depth -.done-questions ol, -.upcoming-questions ol { - background-color: #ffffff; - margin: 0; - padding: 0; - position: relative; - z-index: 1; - - li { - list-style: none; - position: relative; - padding: .75em 1.5em .75em 1em; - - @include media-down(mobile) { - padding: .5em 1em; - } - - h3 { - @include govuk-font(16); - } - - &.done { - background: #d5ecea; - border-bottom: solid 1px #b6d6d2; - overflow: hidden; - padding-right: 9.5em; - - .answer { - @include govuk-font(16, $weight: bold); - color: #315843; - display: block; - margin: 0 .5em 0 1em; - - &.multiple { - display: block; - - ul { - margin-top: 0; - - li { - margin: 0; - padding: 0; - } - } - } - } - } - } -} -// stylelint-enable selector-no-qualifying-type, max-nesting-depth - -.upcoming-questions ol { - li { - background-color: #f0e7d7; - border-bottom: solid 1px #dac39c; - } -} - -.question .question-number { - font-weight: normal; -} - -li.done .undo { // stylelint-disable-line selector-no-qualifying-type - position: absolute; - top: (.75em / .9); - right: (1.5em / .9); - margin: 0; - @include govuk-font(14); - - a { - color: $text-colour; - display: block; - } -} - -li.done .answer ul { // stylelint-disable-line selector-no-qualifying-type - margin: .5em 0 0 -2.1em; - padding-left: 2.1em; -} - -li.done:hover .undo a { // stylelint-disable-line selector-no-qualifying-type - color: inherit; -} - -.step.current { - background-color: #ffffff; - margin-right: 15em; - padding: 0 10em 1em 0; - position: relative; - - @include media-down(tablet) { - margin-right: 0; - padding: 0 1em 1em; - } -} - -.next-question { - margin: 1.5em 0 .5em; -} - -// Results / outcome -.outcome { - background-color: #ffffff; - float: none; - margin-right: 0; - min-height: 480px; - - .inner { - padding-top: 2em; - } -} - -// Errors messages -.content-block .error, -article .error { - border: 1px solid #b01117; - background-color: #fff3cf; - color: #b01117; - margin: 0 0 -.5em -.5em; - padding: .5em; - - ul { - margin-bottom: 0; - } -} - -.error-message { - margin-top: 0; - color: #b01117; -} diff --git a/app/assets/stylesheets/helpers/_publisher.scss b/app/assets/stylesheets/helpers/_publisher.scss deleted file mode 100644 index d449c8f82..000000000 --- a/app/assets/stylesheets/helpers/_publisher.scss +++ /dev/null @@ -1,338 +0,0 @@ -// visited link colour overrides - -// stylelint-disable selector-max-id -#content.multi-page li a:visited, -#content.multi-page .pagination li a:visited { - color: $link-visited-colour; -} - -#content.multi-page { - header { - position: relative; - } - - aside { - z-index: 10; - border-bottom: 1px solid #bbbbbb; - margin-bottom: 1em; - padding-bottom: 1em; - overflow: hidden; - - @include govuk-media-query($from: tablet) { - margin: 0 0 2.5em; - } - } -} - -#content.single-page { - header div { - padding-bottom: 1em; - } -} -// stylelint-enable selector-max-id - -.video-guide { - .content-block .inner, - article .inner { - padding-bottom: 2em; - } - - .meta-data { - border-top: none; - margin: 1em 0 2em 2em; - } -} - -.licence .content-block .inner, -.licence article .inner { - padding-top: 0; -} - -// stylelint-disable max-nesting-depth, selector-no-qualifying-type -aside .page-navigation { - - @include media-down(mobile) { - margin-top: 0; - } - - ol { - margin: 0; - padding: 0; - float: left; - display: inline; - overflow: hidden; - width: 50%; - - @include media-down(mobile) { - float: none; - display: block; - width: auto; - } - } - - li { - list-style: decimal; - list-style-position: outside; - margin-right: .75em; - margin-left: 1.5em; - clear: left; - @include govuk-font(16); - - @include media-down(mobile) { - float: none; - margin: 0 1em 0 2.25em; - } - - a { - display: block; - padding: .25em 1em .25em 0; - - span { - cursor: pointer; - } - - &:hover span.part-title, - &:focus span.part-title, - &:hover span.part-description, - &:focus span.part-description { - color: $link-hover-colour; - } - } - - span { - &.part-number { - display: none; - width: 1.75em; - } - - &.part-label, - &.part-title { - line-height: 1.5; - display: inline; - } - - &.part-label { - color: $text-colour; - padding: 0 .5em 0 0; - } - - &.part-description { - line-height: 1.25; - display: block; - clear: left; - } - - &.part-title { - color: #2e3191; - text-decoration: underline; - line-height: 1.5; - } - } - - &.active { - padding-top: .25em; - padding-bottom: .25em; - - span.part-number { - padding: 0; - } - - span.part-title { - color: $text-colour; - text-decoration: none; - } - } - - @include media-down(mobile) { - &.active { - padding: 0; - } - - @include govuk-font(19, $line-height: (45 / 19)); - - span, - a { - margin: 0 -1em 0 -2.25em; - padding: 0 1em .75em 2.75em; - } - - span { - display: block; - - &.part-title, - &.part-label { - display: inline; - } - - &.part-label { - padding-right: 1em; - } - } - } - } - - ol[start] li { - margin-left: 1.8em; - - @include media-down(mobile) { - margin-left: 2.25em; - } - } -} -// stylelint-enable max-nesting-depth, selector-no-qualifying-type - -// guides pagination - -// stylelint-disable selector-no-qualifying-type -.pagination { - display: block; - margin: 4em 0 0; - border-bottom: 1px solid $border-colour; - - @include media-down(mobile) { - margin: 2em 0 0; - } - - ul { - margin: 0; - padding: 0; - } - - li { - @include govuk-font(16, $line-height: (20 / 16)); - float: left; - list-style: none; - text-align: right; - margin: 0; - padding: 0; - width: 49%; - - a { - background-color: transparent; - display: block; - color: $link-colour; - text-decoration: none; - - &:hover, - &:active { - background-color: $canvas-colour; - } - - .pagination-label { // stylelint-disable-line max-nesting-depth - @include govuk-font(27, $line-height: (33.75 / 27)); - margin-bottom: .1em; - display: block; - } - - .pagination-part-title { // stylelint-disable-line max-nesting-depth - text-decoration: underline; - } - } - - &.next { - float: right; - text-align: right; - } - - &.next a:before { - background: transparent image-url("arrow-sprite.png") no-repeat -102px -11px; - margin: -4px -32px 0 0; - display: block; - float: right; - width: 30px; - height: 38px; - content: " "; - } - - &.previous a:before { - background: transparent image-url("arrow-sprite.png") no-repeat -20px -11px; - margin: -4px 0 0 -32px; - display: block; - float: left; - width: 30px; - height: 38px; - content: " "; - } - - &.previous { - float: left; - text-align: left; - } - - &.previous a { - padding: .75em 0 .75em 3em; - } - - &.next a { - padding: .75em 3em .75em 0; - } - - @include media-down(mobile) { - &.previous, - &.next { - float: none; - width: 100%; - } - - &.next a { - text-align: right; - } - } - } - - .first, - .last { - min-height: 4.5em; - - span { - display: block; - min-height: 4.5em; - padding: .75em 5%; - width: 90%; - } - - .pagination-label { - display: block; - margin-bottom: .5em; - } - } -} -// stylelint-enable selector-no-qualifying-type - -// Transactions and local transactions styles - -.find-location-for-service, -.find-location-for-licence { - background-color: $panel-colour; - min-height: 2em; - line-height: 2; - margin: 2em 0; - padding: 1em .75em 1em 1em; - position: relative; - - @include media-down(mobile) { - margin: 1.2em 0; - padding-left: 1em; - padding-right: 1em; - - .postcode { - margin-left: 0; - } - } - - p.geolocate-me { // stylelint-disable-line selector-no-qualifying-type - border-top: 1px solid $border-colour; - @include govuk-font(16); - margin-bottom: 0; - padding-top: 1em; - - @include media-down(mobile) { - margin-left: -2.5em; - padding-right: 2.5em; - } - } - - input[type="submit"] { - border-color: $border-colour; - } -} diff --git a/app/assets/stylesheets/helpers/_text.scss b/app/assets/stylesheets/helpers/_text.scss deleted file mode 100644 index fe7af1829..000000000 --- a/app/assets/stylesheets/helpers/_text.scss +++ /dev/null @@ -1,594 +0,0 @@ -// Text styles for articles. - -.content-block, -article { - h1 { - @include govuk-font(24, $weight: bold); - margin-top: 1.5em; - margin-bottom: .75em; - } - - header h1 { - @include govuk-font(27, $weight: bold); - font-weight: 700; - color: $text-colour; - margin-top: 0; - margin-bottom: 0; - - span { - @include govuk-font(16); - display: block; - margin-bottom: .4em; - } - } - - h1 + h2 { - margin-top: .75em; - } - - h2 { - @include govuk-font(24, $weight: bold); - margin: 1.2em 0 .4em; - } - - h2 + h3 { - margin-top: .75em; - } - - h3 { - @include govuk-font(19, $weight: bold); - margin-top: 1em; - margin-bottom: .75em; - } - - h3 + h4 { - margin-top: .75em; - } - - h4 { - margin-top: 1.5em; - margin-bottom: 0; - } - - h3 + table { - margin-top: .652em; - } - - h4 + table { - margin-top: .75em; - } - - h2 + p, - h3 + p, - h4 + p, - h2 + ol, - h3 + ol, - h4 + ol, - h2 + ul, - h3 + ul, - h4 + ul { - margin-top: .2em; - } - - h1, - h2, - h3, - h4 { - color: $text-colour; - } - - p, - ul, - ol { - margin: .75em 0; - } - - p { - @include govuk-font(19); - } - - p + .help-notice { - margin-top: 2em; - } - - li { - @include govuk-font(19); - margin: .25em 0; - padding-left: .3em; - - @include media-down(mobile) { - margin-left: 16px; - padding-left: 0; - } - - ul, - ol { - margin: 0; - list-style-position: inside; - } - - li { - @include govuk-font(19); - list-style-type: circle; - } - - p { - @include govuk-font(19); - margin: 0; - } - } - - ul, - ol { - padding-left: 1em; - margin-top: .75em; - margin-bottom: .75em; - - @include media-down(mobile) { - padding-left: 0; - margin-left: 0; - } - } - - // Example has a green background, so we need an additional indent to - // avoid the bullets hanging on the edge of the colour. - .example ul, - .example ol { - margin-left: .5em; - } - - ul { - list-style-type: circle; - list-style-image: image-url("bullet-disc-5px.gif"); - } - - ol { - list-style-type: decimal; - } - - table ul { - padding-left: .75em; - margin: 0; - } - - table ul li:last-child { - margin-bottom: 0; - } - - dl { - margin-top: 1.5em; - margin-bottom: 1.88em; - } - - dt { - @include govuk-font(19); - margin-bottom: .25em; - } - - dd { - margin-bottom: .75em; - } - - table { - border-collapse: collapse; - border-spacing: 0; - margin: 1em 0 2em; - width: 100%; - @include media-down(mobile) { - margin: 1em 0 2em; - width: 100%; - } - } - - table caption { - @include govuk-font(24, $weight: bold); - margin: .4em .5em .4em .7em; - text-align: left; - - @include media-down(mobile) { - padding-left: 0; - } - } - - th, - td { - @include govuk-font(16, $tabular: true); - vertical-align: top; - padding: .75em .5em .75em 0; - } - - td { - border-bottom: solid 1px $border-colour; - - small { - @include govuk-font(16); - } - } - - th { - line-height: 1.25em; - text-align: left; - font-weight: 700; - border-bottom: solid 1px $border-colour; - } - - // More article formatting including markdown styles. - - .mainstream & .summary { - margin: 0 0 2em; - padding: 0; - color: $text-colour; - - p { - @include govuk-font(19); - } - - @include media-down(mobile) { - margin: 0 0 2em; - padding: 0; - } - } - - .summary p, - .summary h2 { - border: none; - margin: 0 .75em 0 0; - } - - .summary h2 { - line-height: 1.35em; - } - - .licence-finder &.outcome ul { // stylelint-disable-line selector-no-qualifying-type - padding: 1em; - margin: 0 -1em; - - li { - list-style-type: none; - list-style-image: none; - margin: 0 0 .75em; - padding: 0; - } - } - - .advisory { - background: image-url("icon-information.png") no-repeat scroll 98% 1em #d5e8f3; - line-height: 1.3em; - margin: 0 -1em 1em; - padding: 1em; - text-align: left; - - @include device-pixel-ratio { - background-image: image-url("icon-information-2x.png"); - background-size: 27px 27px; - } - - p { - margin: 0 .75em 0 0; - min-height: 1.75em; - padding-right: 3em; - } - - strong { - font-weight: 400; - } - - &.high-alert { - background-color: $panel-colour; - border-color: #cc0000; - } - - @include media-down(mobile) { - margin: 0 0 1em; - } - } - - .intro { - margin-bottom: 1.5em; - padding-bottom: 1em; - - .get-started-intro > p:first-child { - margin-top: 0; - } - - @include media-down(mobile) { - margin: 0 0 1.5em; - padding: 0; - } - } - - #wrapper.place & .intro { // stylelint-disable-line selector-max-id - margin-bottom: 0; - } - - .example { - border-left: 10px solid $panel-colour; - padding-left: 1.5em; - margin: 2.5em 0; - - strong { - display: block; - } - - @include media-down(mobile) { - margin: .75 0; - } - } - - .application-notice, - .advisory.minor, - .form-download, - .subscribe { - padding: .25em 0 .25em 3.5em; - - @include media-down(mobile) { - margin: 1em 0 1.5em; - } - } - - .application-notice { - padding: .1em 0 .1em 1em; - } - - .advisory.minor { - background-image: none; - padding: .75em 1em; - } - - .help-notice { - background: none; - background: image-url("icon-important.png") no-repeat scroll 0 .5em; - - @include device-pixel-ratio { - background-image: image-url("icon-important-2x.png"); - background-size: 34px 34px; - } - - p { - font-weight: 600; - } - - p a { - font-weight: 600; - } - } - - a.important { // stylelint-disable-line selector-no-qualifying-type - background: image-url("icon-important.png") no-repeat scroll 100% 0 #ffffff; - } - - .subscribe { - background: image-url("icon-calendar.png") no-repeat scroll 98% 1em #d5e8f3; - - @include device-pixel-ratio { - background-image: image-url("icon-calendar-2x.png"); - background-size: 27px 27px; - } - } - - .info-notice { - background: none; - border-left: 10px solid $border-colour; - margin-bottom: 1em; - - &:after { - clear: both; - content: ""; - display: block; - } - } - - .help-notice p, - .info-notice p, - .subscribe p { - padding-right: 4em; - } - - .info-notice p { - padding: 0 1em 0 0; - } - - .help-notice p { // stylelint-disable no-duplicate-selectors - padding: 0 1em 0 2em; - } - - p + .help-notice, - p + .info-notice { - margin-top: 2em; - } - - .form-download { - padding: .25em 0; - } - - .form-download p { - padding-right: 3em; - } - - .form-download a { - display: block; - font-weight: 600; - background: image-url("icon-file-download.png") no-repeat scroll 0 0; - min-height: 2.5em; - padding: 0 0 0 2.5em; - - @include device-pixel-ratio { - background-image: image-url("icon-file-download-2x.png"); - background-size: 25px 25px; - } - } - - .address { - margin: 2.5em 0; - min-width: 35%; - } - - h2 + .address, - h3 + .address { - margin-top: .5em; - } - - // stylelint-disable selector-no-qualifying-type - ol.places { - list-style-type: none; - padding-left: 0; - margin-left: 0; - - &.answer_locations .information { - min-height: 3em; - } - - li { - margin: 0; - padding-left: 0; - } - } - // stylelint-enable selector-no-qualifying-type - - .place { - margin: 1.5em 0; - border-bottom: solid 1px $border-colour; - padding-bottom: 1.5em; - - .address { - margin: 0; - padding: 0; - width: auto; - display: block; - } - - .url { - overflow: hidden; - text-overflow: ellipsis; - } - - .additional-information { - @include govuk-font(16); - } - - .additional-information p { - margin: .25em 0; - } - - @include media-down(mobile) { - margin: .75em 0; - } - } - - // stylelint-disable selector-no-qualifying-type - ul.view-maps { - list-style: none; - padding: 0; - margin: 1em 0; - - li { - @include govuk-font(16); - display: inline-block; - margin-right: 1em; - } - } - - ol.steps { - padding-left: 0; - margin-left: 0; - overflow: hidden; - - > li { - background-position: 0 .87em; - background-repeat: no-repeat; - list-style-type: decimal; - margin-left: 0; - padding: .75em 0 .75em 2.2em; - - @for $i from 1 through 14 { - &:nth-child(#{$i}) { - background-image: image-url("icon-steps/icon-step-#{$i}.png"); - - @include device-pixel-ratio { // stylelint-disable-line max-nesting-depth - background-image: image-url("icon-steps/icon-step-#{$i}-2x.png"); - background-size: 24px 24px; - } - } - } - } - } - // stylelint-enable selector-no-qualifying-type -} - -.contact { - margin: .75em 0; - min-width: 60%; - - dl { - dt { - font-weight: bold; - margin: 0 0 .25em; - } - - dd { - margin: 0 0 .5em; - } - } - - @include media-down(mobile) { - margin: .75em 0; - } -} - -section.places h3 { // stylelint-disable-line selector-no-qualifying-type - margin-top: 0; -} - -.meta-data .contact { - width: auto; -} - -.contact dl dt, -.meta-data .contact dt { - float: left; - clear: left; -} - -.contact dl dd, -.meta-data .contact dd { - margin-left: 8.5em; -} - -.highlight-answer, -.highlighted-event { - background-color: #28a197; - color: #ffffff; - text-align: center; - padding: .1em 2em .2em; - margin: 0 -1em 1em; - - p { - line-height: 2.3em; - color: #ffffff; - - em { - font-size: 2.45em; - font-style: normal; - font-weight: 700; - display: block; - margin-bottom: .5em; - color: #ffffff; - } - } - - @include media-down(mobile) { - margin: 0 0 1em; - - @include govuk-font(48); - - p { - font-size: 1em; - line-height: inherit; - } - - p em { - font-size: 1em; - display: inline; - } - } -} diff --git a/app/assets/stylesheets/static.scss b/app/assets/stylesheets/static.scss index 69b827d0b..7a4afd75a 100644 --- a/app/assets/stylesheets/static.scss +++ b/app/assets/stylesheets/static.scss @@ -5,10 +5,5 @@ $govuk-use-legacy-palette: false; @import "header-footer-only"; // styles -@import "helpers/mixins"; -@import "helpers/core"; -@import "helpers/multi-step"; @import "helpers/organisations"; -@import "helpers/publisher"; -@import "helpers/text"; @import "helpers/wrapper"; From 0f183abbfb583c12d826d7101ad24b321874dc2d Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Feb 2021 12:23:11 +0000 Subject: [PATCH 2/6] Remove redundant mixins import `helpers/mixins` is already included in `header-footer-only` --- app/assets/stylesheets/core-layout.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/core-layout.scss b/app/assets/stylesheets/core-layout.scss index d33d25bf7..af6b12950 100644 --- a/app/assets/stylesheets/core-layout.scss +++ b/app/assets/stylesheets/core-layout.scss @@ -1,6 +1,5 @@ // import the base styles @import "header-footer-only"; -@import "helpers/mixins"; @import "helpers/reset"; @import "helpers/wrapper"; From b5e29046f47af828a41e885c978f9e045838124a Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Feb 2021 18:05:05 +0000 Subject: [PATCH 3/6] Use core_layout as default in tests When core_layout was declared default in slimmer [1] these tests shoul've been update to reflect that. [1] https://github.com/alphagov/slimmer/pull/136 --- test/integration/notifications_test.rb | 16 ++++++++-------- test/integration/templates_test.rb | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/notifications_test.rb b/test/integration/notifications_test.rb index bb1a067fb..0c71a7173 100644 --- a/test/integration/notifications_test.rb +++ b/test/integration/notifications_test.rb @@ -13,21 +13,21 @@ def stub_redis_response(hash) context "emergency banner notifications" do should "not render a banner if one does not exist" do - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_not page.has_selector? ".govuk-emergency-banner" end should "render a banner if one does exist" do stub_redis_response(campaign_class: "foo", heading: "bar") - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert page.has_selector? ".govuk-emergency-banner" end should "render a banner with a heading and campaign colour" do stub_redis_response(campaign_class: "notable-death", heading: "Alas poor Yorick") - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert page.has_selector? ".govuk-emergency-banner.notable-death" assert_match "Alas poor Yorick", page.body @@ -40,7 +40,7 @@ def stub_redis_response(hash) link: "https://yoricks.gov", ) - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_match "More information", page.body assert_match(/yoricks\.gov/, page.body) @@ -54,7 +54,7 @@ def stub_redis_response(hash) link_text: "Some specified text for more information", ) - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_match "Some specified text for more information", page.body end @@ -65,7 +65,7 @@ def stub_redis_response(hash) heading: "Alas poor Yorick", ) - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_not page.has_selector? ".more-information" assert_no_match(/yoricks\.gov/, page.body) @@ -78,7 +78,7 @@ def stub_redis_response(hash) short_description: "I knew him well", ) - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_match "I knew him well", page.body end @@ -89,7 +89,7 @@ def stub_redis_response(hash) heading: "Alas poor Yorick", ) - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_no_match "I knew him well", page.body end diff --git a/test/integration/templates_test.rb b/test/integration/templates_test.rb index c9f80f775..d6cda7ea8 100644 --- a/test/integration/templates_test.rb +++ b/test/integration/templates_test.rb @@ -3,14 +3,14 @@ class TemplatesTest < ActionDispatch::IntegrationTest context "fetching templates" do should "be 200 for templates that exist" do - %w[wrapper header_footer_only chromeless 404 406 500].each do |template| + %w[core_layout header_footer_only chromeless 404 406 500].each do |template| get "/templates/#{template}.html.erb" assert_equal 200, last_response.status end end should "return the rendered templates" do - visit "/templates/wrapper.html.erb" + visit "/templates/core_layout.html.erb" assert_no_match(/<%/, page.source) # Should be no ERB tags assert page.has_selector?("#wrapper") end From 6c17f33f672c4624c5db44594dd4390c221f3e29 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Feb 2021 18:10:28 +0000 Subject: [PATCH 4/6] Remove wrapper template Deprecated and no longer used by any application --- app/views/root/wrapper.html.erb | 1 - docs/slimmer_templates.md | 6 ---- test/integration/templates/wrapper_test.rb | 33 ------------------- .../templates/wrapper_with_js_last.rb | 33 ------------------- 4 files changed, 73 deletions(-) delete mode 100644 app/views/root/wrapper.html.erb delete mode 100644 test/integration/templates/wrapper_test.rb delete mode 100644 test/integration/templates/wrapper_with_js_last.rb diff --git a/app/views/root/wrapper.html.erb b/app/views/root/wrapper.html.erb deleted file mode 100644 index e82f5b31a..000000000 --- a/app/views/root/wrapper.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render partial: 'base' %> diff --git a/docs/slimmer_templates.md b/docs/slimmer_templates.md index 67bc31bd5..15f6c470e 100644 --- a/docs/slimmer_templates.md +++ b/docs/slimmer_templates.md @@ -17,9 +17,3 @@ GOV.UK. Use this layout if you want to explicitly control the full layout of your page including centering all the content. - -## `wrapper` (deprecated) - -This template historically contained all the styles for GOV.UK. - -**You should not use this template** diff --git a/test/integration/templates/wrapper_test.rb b/test/integration/templates/wrapper_test.rb deleted file mode 100644 index 5055a41d2..000000000 --- a/test/integration/templates/wrapper_test.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_relative "../../integration_test_helper" - -class WrapperTest < ActionDispatch::IntegrationTest - should "render the template" do - visit "/templates/wrapper.html.erb" - - within "head", visible: :all do - assert page.has_selector?("title", text: "GOV.UK - The best place to find government services and information", visible: :all) - - assert page.has_selector?("link[href$='static.css']", visible: :all) - end - - within "body" do - within "header#global-header" do - assert page.has_selector?("form#search") - end - - assert page.has_selector?("#global-cookie-message") - assert page.has_selector?("#user-satisfaction-survey-container") - - assert page.has_selector?("#wrapper") - - within "footer" do - assert page.has_selector?(".footer-categories") - - assert page.has_selector?(".footer-meta") - end - end - - assert page.has_selector?("script[src$='libs/jquery/jquery-1.12.4.js']", visible: :all) - assert page.has_selector?("script[src$='application.js']", visible: :all) - end -end diff --git a/test/integration/templates/wrapper_with_js_last.rb b/test/integration/templates/wrapper_with_js_last.rb deleted file mode 100644 index af0cf49d6..000000000 --- a/test/integration/templates/wrapper_with_js_last.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_relative "../../integration_test_helper" - -class WrapperWithJSLastTest < ActionDispatch::IntegrationTest - should "render the template" do - visit "/templates/wrapper_with_js_last.html.erb" - - within "head", visible: :all do - assert page.has_selector?("title", text: "GOV.UK - The best place to find government services and information", visible: :all) - - assert page.has_selector?("link[href$='static.css']", visible: :all) - end - - within "body" do - within "header#global-header" do - assert page.has_selector?("form#search") - end - - assert page.has_selector?("#global-cookie-message") - assert page.has_selector?("#user-satisfaction-survey") - - assert page.has_selector?("#wrapper") - - within "footer" do - assert page.has_selector?(".footer-categories") - - assert page.has_selector?(".footer-meta") - end - - assert page.has_selector?("script[src$='libs/jquery/jquery-1.12.4.js']", visible: :all) - assert page.has_selector?("script[src$='application.js']", visible: :all) - end - end -end From 9329c8e3e5485e07dc37a964c03aeef5c54430a9 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Feb 2021 18:22:03 +0000 Subject: [PATCH 5/6] Remove homepage template Previously used by `frontend` to render the homepage, this now deprecated and no longer used by any application. --- app/controllers/root_controller.rb | 1 - app/views/root/homepage.html.erb | 13 -------- test/integration/templates/homepage_test.rb | 33 --------------------- 3 files changed, 47 deletions(-) delete mode 100644 app/views/root/homepage.html.erb delete mode 100644 test/integration/templates/homepage_test.rb diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index e129126b5..f07594382 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -11,7 +11,6 @@ class RootController < ApplicationController campaign print proposition_menu - homepage ].freeze def template if NON_LAYOUT_TEMPLATES.include?(params[:template]) diff --git a/app/views/root/homepage.html.erb b/app/views/root/homepage.html.erb deleted file mode 100644 index ebb87b0cf..000000000 --- a/app/views/root/homepage.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% - # There is a requirement to add the thank you comment in a place which is - # obvious. Rendering file with the govuk_template lets us put the comment - # after the govuk_template. govuk_template as it stands doesn't have a - # content_for which could otherwise be used. - - # This is only wanted for the homepage and can't be put in to the frontend - # template on frontend due to the way slimmer would not copy over the - # comment -%> -<%= render partial: 'base', locals: { hide_nav: true } %> -<%= render template: 'layouts/govuk_template' %> - diff --git a/test/integration/templates/homepage_test.rb b/test/integration/templates/homepage_test.rb deleted file mode 100644 index b9b6b5fb3..000000000 --- a/test/integration/templates/homepage_test.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_relative "../../integration_test_helper" - -class HomepageTest < ActionDispatch::IntegrationTest - should "render the template" do - visit "/templates/homepage.html.erb" - - within "head", visible: :all do - assert page.has_selector?("title", text: "GOV.UK - The best place to find government services and information", visible: :all) - - assert page.has_selector?("link[href$='static.css']", visible: :all) - end - - within "body" do - within "header#global-header" do - assert page.has_selector?("form#search") - end - - assert page.has_selector?("#global-cookie-message") - assert page.has_selector?("#user-satisfaction-survey-container") - - assert page.has_selector?("#wrapper") - - within "footer" do - assert page.has_selector?(".footer-categories") - - assert page.has_selector?(".footer-meta") - end - end - - assert page.has_selector?("script[src$='libs/jquery/jquery-1.12.4.js']", visible: :all) - assert page.has_selector?("script[src$='application.js']", visible: :all) - end -end From 6bd1da10c8c8e0137713d5d6967d56cb0c1aa248 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 15 Feb 2021 10:23:28 +0000 Subject: [PATCH 6/6] Preserve thank you message See https://gds.blog.gov.uk/2013/11/29/thank-you-martha/ --- app/views/layouts/govuk_template.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/govuk_template.html.erb b/app/views/layouts/govuk_template.html.erb index 9dd238e9d..41bb47978 100644 --- a/app/views/layouts/govuk_template.html.erb +++ b/app/views/layouts/govuk_template.html.erb @@ -141,3 +141,4 @@ +