From 349eb70c2d0b33825e4e41f35e9a2c9ee1d2156a Mon Sep 17 00:00:00 2001 From: Marcel Kornblum Date: Tue, 18 Apr 2023 13:15:34 +0100 Subject: [PATCH] WCM-436 Implement the first design of search v2 (#335) Many changes are in this large piece of work. # Search Functionality * Feature parity with v1 search except search exclusions which were removed * Search is performed using Wagtail's search capabilities * All new views instrumented with new detailed GTM functionality for performance analysis # Interface * Complete redesign of the search page * Searching for pages, people and teams has been unified into one page * "All" search category gives an overview of matching pages, people and teams * Opt-in / opt-out functionality connected to the `user.enable_v2_search` flag: * Opt-in invitation banner appears on all v1 search pages * Opt-out banner appears on all pages, if user is opted in * New view, template to support it * Users will be redirected from v1 to v2 search and vice versa depending on their `user.enable_v2_search` status * For opted-in users, implemented a new site-wide header and navigation: * Unified search bar replacing two distinct bars * Moved site navigation below the red line in the header * Moved the new bar into the new navigation area * Moved the profile widget into the top space where the old search bar used to be * Reworked the navigation design and states on desktop and mobile according to the new designs * Top header bar CSS completely reworked to better fit govuk grid guidelines and the design, as well as responsive layout considerations, if not the govuk CSS implementation * Django template structure reworked slightly to make post-beta rationalisation easier * Feedback mechanisms adopted: * used new django app taking functionality from https://github.com/uktrade/jml * linked from the beta banner, a new form to submit detailed feedback to new model and send email notification * a new "star rating" widget that submits data to GTM and triggers the feedback form # Other / behind the scenes changes * Put `TODO [DWPF-454]` comments in the codebase wherever beta-specific functionality is implemented, making it easier to cleanup the codebase at the end of the beta * Upgraded gov-frontend NPM package to the latest version, including several changes to HTML nodes for compatibility (e.g. `span` => `p` * Removed all hex value colour definitions from CSS, replacing with SCSS vars or functions as appropriate [DWPF-454]: https://uktrade.atlassian.net/browse/DWPF-454?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ > NB requires extra ENV vars: --------- Co-authored-by: Sam Dudley Co-authored-by: Cameron Lamb --- .circleci/config.yml | 4 +- .env.ci | 4 + .env.example | 3 + Makefile | 3 + assets/js/application.js | 10 +- assets/js/peoplefinder.js | 5 +- assets/stylesheets/components/_home.scss | 6 +- assets/stylesheets/components/_layout.scss | 29 +- .../stylesheets/components/_news_article.scss | 2 +- .../stylesheets/components/_peoplefinder.scss | 47 +- .../components/_search_and_profile_bar.scss | 162 +- .../stylesheets/components/_search_field.scss | 238 ++- .../components/_search_results.scss | 162 +- .../stylesheets/govuk-overrides/header.scss | 349 +++- assets/stylesheets/vars/_colors.scss | 6 + config/settings/base.py | 31 + config/urls.py | 8 +- content/models.py | 41 +- core/templates/base.html | 68 +- .../templates/confirm.html | 8 + .../templates/listing.html | 7 + .../templates/submit.html | 8 + core/templates/includes/footer.html | 5 - core/templates/includes/govt_uk_form.html | 12 +- core/templates/includes/header.html | 52 +- core/templates/includes/header_searchv2.html | 46 + core/templates/includes/pagination_v2.html | 39 + core/templates/includes/profile_panel.html | 25 + .../includes/search_and_profile_bar.html | 47 +- core/templates/menus/main_menu.html | 53 +- core/templates/tags/search_beta_banner.html | 52 + core/templatetags/paginator.py | 19 + manifest.yml | 2 +- package-lock.json | 1648 +++-------------- package.json | 22 +- peoplefinder/models.py | 11 +- peoplefinder/services/search.py | 2 +- .../static/peoplefinder/profile-photo.js | 334 ++-- .../peoplefinder/components/checkbox.html | 6 +- .../peoplefinder/components/checkboxes.html | 6 +- .../components/error-summary.html | 47 +- .../peoplefinder/components/input.html | 22 +- .../components/manager/search-form.html | 17 +- .../components/search-result-person.html | 20 +- .../peoplefinder/components/team-card.html | 17 +- .../templates/peoplefinder/search.html | 4 +- peoplefinder/test/test_models.py | 8 + peoplefinder/urls.py | 1 + peoplefinder/views/search.py | 22 +- poetry.lock | 283 ++- pyproject.toml | 24 +- requirements.txt | 36 +- search/forms.py | 13 - search/search.py | 107 +- .../search/partials/page_results.html | 13 - .../search/partials/result/page.html | 17 + .../search/partials/result/people.html | 3 + .../search/partials/result/teams.html | 3 + .../partials/search_category_all_tabs.html | 10 + .../partials/search_category_single_tab.html | 13 + .../search/partials/search_form.html | 19 +- .../search/partials/search_results.html | 16 + .../search/partials/search_results_all.html | 17 + .../partials/search_results_category.html | 43 + .../search_results_single_category.html | 3 + .../search/partials/see_all_results_form.html | 19 - .../search/partials/team_results.html | 5 - search/templates/search/search.html | 23 +- search/templates/search/search_v2.html | 29 + search/templates/search/v2_search.html | 85 - search/templatetags/__init__.py | 0 search/templatetags/search.py | 104 ++ search/test/test_search.py | 2 +- search/test/test_utils.py | 8 + search/urls.py | 15 + search/utils.py | 138 ++ search/views.py | 148 +- 77 files changed, 2553 insertions(+), 2383 deletions(-) create mode 100644 core/templates/django_feedback_govuk/templates/confirm.html create mode 100644 core/templates/django_feedback_govuk/templates/listing.html create mode 100644 core/templates/django_feedback_govuk/templates/submit.html create mode 100644 core/templates/includes/header_searchv2.html create mode 100644 core/templates/includes/pagination_v2.html create mode 100644 core/templates/includes/profile_panel.html create mode 100644 core/templates/tags/search_beta_banner.html create mode 100644 core/templatetags/paginator.py create mode 100644 peoplefinder/test/test_models.py delete mode 100644 search/forms.py delete mode 100644 search/templates/search/partials/page_results.html create mode 100644 search/templates/search/partials/result/page.html create mode 100644 search/templates/search/partials/result/people.html create mode 100644 search/templates/search/partials/result/teams.html create mode 100644 search/templates/search/partials/search_category_all_tabs.html create mode 100644 search/templates/search/partials/search_category_single_tab.html create mode 100644 search/templates/search/partials/search_results.html create mode 100644 search/templates/search/partials/search_results_all.html create mode 100644 search/templates/search/partials/search_results_category.html create mode 100644 search/templates/search/partials/search_results_single_category.html delete mode 100644 search/templates/search/partials/see_all_results_form.html delete mode 100644 search/templates/search/partials/team_results.html create mode 100644 search/templates/search/search_v2.html delete mode 100644 search/templates/search/v2_search.html create mode 100644 search/templatetags/__init__.py create mode 100644 search/templatetags/search.py create mode 100644 search/test/test_utils.py create mode 100644 search/urls.py create mode 100644 search/utils.py diff --git a/.circleci/config.yml b/.circleci/config.yml index fceacab01..4e524ee29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,9 @@ jobs: command: make build - run: name: install npm packages - command: npm ci + command: | + nvm install 18 + npm ci - run: name: build webpack command: npm run build diff --git a/.env.ci b/.env.ci index 7fce12d48..29c6bcabf 100644 --- a/.env.ci +++ b/.env.ci @@ -38,6 +38,9 @@ PROFILE_EDITED_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx # Profile deleted PROFILE_DELETED_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx +# Beta feedback notification +FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx + # Hawk authentication HAWK_INCOMING_ACCESS_KEY=xxx HAWK_INCOMING_SECRET_KEY=xxx @@ -54,4 +57,5 @@ PERSON_UPDATE_WEBHOOK_URL= # Home page HIDE_NEWS=False +FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS="support@example.com," # TESTS_KEEP_DB=1 diff --git a/.env.example b/.env.example index d3c941a88..db6d742a2 100644 --- a/.env.example +++ b/.env.example @@ -70,6 +70,7 @@ PROFILE_DELETION_REQUEST_EMAIL=support@example.com PROFILE_DELETION_REQUEST_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx PROFILE_EDITED_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx PROFILE_DELETED_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx +FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx # Hawk authentication HAWK_INCOMING_ACCESS_KEY=xxx @@ -99,3 +100,5 @@ IMPORT_USER_PWD= # Home page HIDE_NEWS=False + +FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS="marcel.kornblum@digital.trade.gov.uk," diff --git a/Makefile b/Makefile index d192618fa..46476fbb8 100644 --- a/Makefile +++ b/Makefile @@ -156,3 +156,6 @@ e2e-codegen: poetry run playwright codegen http://localhost:8000 mv .env.orig .env docker stop wagtail-test-server + +dump-db: + pg_dump digital_workspace -U postgres -h localhost -p 5432 -O -x -c -f dw.dump diff --git a/assets/js/application.js b/assets/js/application.js index 74ed53e39..12de76e03 100644 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -1,6 +1,8 @@ -const images = require.context('../images', true) -const imagePath = (name) => images(name, true) +import "htmx.org/dist/htmx.js"; -require.context('govuk-frontend/govuk/assets'); -import { initAll } from 'govuk-frontend'; +const images = require.context("../images", true); +const imagePath = (name) => images(name, true); + +require.context("govuk-frontend/govuk/assets"); +import { initAll } from "govuk-frontend"; initAll(); diff --git a/assets/js/peoplefinder.js b/assets/js/peoplefinder.js index 2a80581c8..7b07fe7af 100644 --- a/assets/js/peoplefinder.js +++ b/assets/js/peoplefinder.js @@ -1,3 +1,2 @@ -import 'htmx.org/dist/htmx.js'; -import 'cropperjs/dist/cropper.css'; -export { default as Cropper } from 'cropperjs'; +import "cropperjs/dist/cropper.css"; +export { default as Cropper } from "cropperjs"; diff --git a/assets/stylesheets/components/_home.scss b/assets/stylesheets/components/_home.scss index ad64cf4d2..f0245c948 100644 --- a/assets/stylesheets/components/_home.scss +++ b/assets/stylesheets/components/_home.scss @@ -15,7 +15,7 @@ section { padding: 0 0 12px 0 !important; margin: 0 0 12px 0; - border-bottom: 5px solid #cf102d; + border-bottom: 5px solid $brand-color-red; } p { @@ -48,7 +48,7 @@ .quick-links { background-color: govuk-colour("light-grey"); - border-bottom: 5px solid #cf102d; + border-bottom: 5px solid $brand-color-red; padding: 12px; margin: 0; @@ -147,7 +147,7 @@ // D and I .news-item-3 { order: 3; - border-bottom: 5px solid #0064C5; + border-bottom: 5px solid $govuk-brand-colour; background-color: govuk-colour("light-grey"); .home-news-item-text-content { padding: 12px; diff --git a/assets/stylesheets/components/_layout.scss b/assets/stylesheets/components/_layout.scss index 65bc4d234..23a1e4fce 100644 --- a/assets/stylesheets/components/_layout.scss +++ b/assets/stylesheets/components/_layout.scss @@ -1,14 +1,16 @@ html { box-sizing: border-box; } -*, *:before, *:after { +*, +*:before, +*:after { box-sizing: inherit; } .ws-video-embed { iframe { - width: 100%!important; - height: calc(100vw * 0.30) + width: 100% !important; + height: calc(100vw * 0.3); } } @@ -18,17 +20,17 @@ html { } .ws-primary-content { - border-top: 1px solid #b1b4b6; - padding-top: 20px; + border-top: 1px solid govuk-colour("mid-grey"); + padding-top: 20px; } .ws-secondary-content { - border-top: 5px solid #cd1632; + border-top: 5px solid $brand-color-primary; padding-top: 20px; } .ws-article-content { - border-top: 1px solid #b1b4b6; + border-top: 1px solid govuk-colour("mid-grey"); } .ws-secondary-meta { @@ -36,15 +38,16 @@ html { } .ws-related-topics { - border-top:3px solid $govuk-error-colour; + border-top: 3px solid $govuk-error-colour; } .ws-hide { - position: absolute !important; /* Outside the DOM flow */ - height: 1px; width: 1px; /* Nearly collapsed */ - overflow: hidden; - clip: rect(1px 1px 1px 1px); /* IE 7+ only support clip without commas */ - clip: rect(1px, 1px, 1px, 1px); /* All other browsers */ + position: absolute !important; /* Outside the DOM flow */ + height: 1px; + width: 1px; /* Nearly collapsed */ + overflow: hidden; + clip: rect(1px 1px 1px 1px); /* IE 7+ only support clip without commas */ + clip: rect(1px, 1px, 1px, 1px); /* All other browsers */ } .ws-children-2-col { diff --git a/assets/stylesheets/components/_news_article.scss b/assets/stylesheets/components/_news_article.scss index 8a5359de8..f110ff796 100644 --- a/assets/stylesheets/components/_news_article.scss +++ b/assets/stylesheets/components/_news_article.scss @@ -34,7 +34,7 @@ h2 { a { - color: #005ea5; + color: $govuk-link-colour; } } diff --git a/assets/stylesheets/components/_peoplefinder.scss b/assets/stylesheets/components/_peoplefinder.scss index edd57bc2a..f50af0a37 100644 --- a/assets/stylesheets/components/_peoplefinder.scss +++ b/assets/stylesheets/components/_peoplefinder.scss @@ -26,7 +26,7 @@ .separated > *:not(:last-child) { padding-right: 10px; margin-right: 10px; - border-right: 1px solid #b1b4b6; + border-right: 1px solid govuk-colour("mid-grey"); } .p-0 { @@ -66,7 +66,7 @@ } .gds-border-bottom-1-grey { - border-bottom: 1px solid #b1b4b6; + border-bottom: 1px solid govuk-colour("mid-grey"); } // Components @@ -95,7 +95,7 @@ .pf-role-form { padding: 20px; - border: 1px solid #b1b4b6; + border: 1px solid govuk-colour("mid-grey"); margin-bottom: 20px; button { @@ -112,15 +112,15 @@ } .success { - border-left: 5px solid green; + border-left: 5px solid $govuk-success-colour; } .warning { - border-left: 5px solid orange; + border-left: 5px solid $brand-color-warning; } .error { - border-left: 5px solid #d4351c; + border-left: 5px solid $govuk-success-colour; } } @@ -185,8 +185,9 @@ .pf-team-card { height: 100%; padding: 22.5px; - border: 1px solid #b1b4b6; - box-shadow: 7px 7px 0 #fff, 8px 8px 0 #b1b4b6; + border: 1px solid govuk-colour("mid-grey"); + box-shadow: 7px 7px 0 govuk-colour("white"), + 8px 8px 0 govuk-colour("mid-grey"); } .pf-team-card__name { @@ -201,7 +202,7 @@ .pf-team-card__metadata { font-size: 14px; - color: #505a5f; + color: govuk-colour("dark-grey"); margin-bottom: 0; } @@ -239,7 +240,7 @@ margin-bottom: 0; margin-left: 0.35em; line-height: 1.6; - border-left: thin solid #000; + border-left: thin solid govuk-colour("black"); &:last-child { border-left: none; @@ -251,12 +252,12 @@ height: 0.6em; margin-right: 0.1em; vertical-align: top; - border-bottom: thin solid #000; + border-bottom: thin solid govuk-colour("black"); content: ""; } &:last-child:before { - border-left: thin solid #000; + border-left: thin solid govuk-colour("black"); } } @@ -295,7 +296,7 @@ padding-bottom: 10px; &:not(:last-child) { - border-bottom: 1px solid #f3f2f1; + border-bottom: 1px solid govuk-colour("light-grey"); } } @@ -313,7 +314,7 @@ } .team-select__current-team { - color: #505a5f; + color: govuk-colour("dark-grey"); text-decoration: line-through; } @@ -334,10 +335,11 @@ display: flex; &__picture { - margin-right: 15px; + width: 25%; + margin-right: 1rem; img { - width: 200px; + max-width: 100%; } &.inactive-profile { @@ -348,6 +350,8 @@ } &__details { + width: 75%; + &__item { margin-bottom: 5px; } @@ -361,3 +365,14 @@ width: 50%; } } + +// @TODO [DWPF-454] remove .search-v2 class and merge all overrides into main declarations +.search-v2 { + .pf-team-card { + box-shadow: none; + } + + .pf-team-card__name { + font-size: 19px; + } +} diff --git a/assets/stylesheets/components/_search_and_profile_bar.scss b/assets/stylesheets/components/_search_and_profile_bar.scss index 2f3ddf183..c91cf941d 100644 --- a/assets/stylesheets/components/_search_and_profile_bar.scss +++ b/assets/stylesheets/components/_search_and_profile_bar.scss @@ -1,63 +1,137 @@ +// @TODO [DWPF-454] remove all instances of .search-and-profile-bar .search-and-profile-bar { - background-color: $brand-color-grey90; - background-image: url("../images/search-and-profile-bar-pattern.png"); + background-color: $brand-color-grey90; + background-image: url("../images/search-and-profile-bar-pattern.png"); } .ws-search-and-profile-bar__search { - padding: govuk-spacing(2) 0; + padding: govuk-spacing(2) 0; } .ws-search-and-profile-bar__profile { - padding: 0 0 0 govuk-spacing(3); + padding: 0 0 0 govuk-spacing(3); - @include govuk-media-query($until: desktop) { - display: none; - } + @include govuk-media-query($until: desktop) { + display: none; + } } -.people-finder-panel { - display: flex; - justify-content: flex-end; +.nav-and-profile-bar { + background-color: $brand-color-navy; + border-top: 5px solid $brand-color-primary; +} - .profile-link { +.people-finder-panel { display: flex; + justify-content: flex-end; + + .profile-link { + display: flex; + + &:link, + &:hover, + &:visited { + color: govuk-colour("white"); + } - &:link, - &:hover, - &:visited { - color: govuk-colour("white"); + &:focus { + @include govuk-focused-text; + + .profile-details { + @include govuk-focused-text; + } + } } - &:focus { - @include govuk-focused-text; + @include govuk-media-query($until: desktop, $media-type: "screen") { + .profile-link { + display: none; + } + } - .profile-details { - @include govuk-focused-text; - } + .profile-details { + @include govuk-font($size: 16, $weight: bold); + background-color: darken($brand-color-grey90, 5%); + padding: govuk-spacing(2) govuk-spacing(3) govuk-spacing(2) govuk-spacing(6); + text-align: right; + color: govuk-colour("white"); } - } - @media only screen and (max-width: 767px) { - .profile-link { - display: none; - } - } - - .profile-details { - @include govuk-font($size: 16, $weight: bold); - background-color: darken($brand-color-grey90, 5%); - padding: govuk-spacing(2) govuk-spacing(3) govuk-spacing(2) govuk-spacing(6); - text-align: right; - color: govuk-colour("white"); - } - - .profile-image { - width: 64px; - height: 64px; - } - - .profile-prompt { - @include govuk-font($size: 14); - display: block; - } + .profile-image { + width: 64px; + height: 64px; + } + + .profile-prompt { + @include govuk-font($size: 14); + display: block; + } +} + +// @TODO [DWPF-454] remove .search-v2 class and merge all overrides into main declarations +.search-v2 { + .people-finder-panel { + .profile-link { + align-items: center; + column-gap: 10px; + } + + .profile-link:focus { + box-shadow: none; + + .profile-details { + box-shadow: none; + } + } + + .profile-details { + padding: 0; + display: flex; + flex-direction: column; + background: none; + color: govuk-colour("black"); + font-weight: normal; + text-decoration-color: govuk-colour("black"); + + .salutation { + text-decoration: underline; + } + + .profile-prompt { + display: inline; + text-decoration: none; + + span { + display: inline-block; + } + } + } + + .profile-image { + width: 40px; + height: 40px; + } + } + + @include govuk-media-query($until: desktop, $media-type: "screen") { + .people-finder-panel { + position: absolute; + top: 15px; + right: 0; + + .profile-link { + display: flex; + column-gap: 5px; + + .profile-prompt { + display: none; + } + + img { + width: 20px; + height: 20px; + } + } + } + } } diff --git a/assets/stylesheets/components/_search_field.scss b/assets/stylesheets/components/_search_field.scss index be63d59f0..25e92159e 100644 --- a/assets/stylesheets/components/_search_field.scss +++ b/assets/stylesheets/components/_search_field.scss @@ -1,118 +1,174 @@ $input-size: 40px; @function encode-hex($hex) { - // Turn colour into a string - $output: inspect($hex); - // Slice the '#' from the start of the string so we can add it back on encoded. - $output: str-slice($output, 2); - // Add the '#' back on the start, but as an encoded character for embedding. - @return "%23" + $output; + // Turn colour into a string + $output: inspect($hex); + // Slice the '#' from the start of the string so we can add it back on encoded. + $output: str-slice($output, 2); + // Add the '#' back on the start, but as an encoded character for embedding. + @return "%23"+$output; } +// @TODO [DWPF-454] remove all instances of .search-and-profile-bar from codebase .search-and-profile-bar { - .govuk-width-container { - display: grid; - //width: auto; - grid-template-columns: repeat(2, 1fr); - column-gap: 20px; - input { - border: none; + .govuk-width-container { + display: grid; + //width: auto; + grid-template-columns: repeat(2, 1fr); + column-gap: 20px; + + input { + border: none; + } } - } } -.search-form { - display: flex; - flex: 0 $input-size; - margin: 12px 0; - input { // overly specific to prevent some overrides from outside - @include govuk-font($size: 16, $line-height: (28 / 16)); - padding: 6px; - margin: 0; - //width: 100%; - height: $input-size; - background: govuk-colour("white"); - border-radius: 0; //otherwise iphones apply an automatic border radius - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - - // the .focus class is added by JS and ensures that the input remains above the label once clicked/filled in - &:focus, - &.focus { - z-index: 2; - } +// @TODO [DWPF-454] remove .nav-and-profile-bar, merge these with more general definitions +.nav-and-profile-bar { + .govuk-width-container { + column-gap: 20px; + + nav { + flex-grow: 5; + } - &:focus { - outline: $govuk-focus-width solid $govuk-focus-colour; - // Ensure outline appears outside of the element - outline-offset: 0; + .site-search { + flex-grow: 10; + } } +} + +.search-form { + display: flex; + flex: 0 $input-size; + margin: 12px 0; - //max-width: 360px; - } - - button { - flex-shrink: 0; - border: 0; - cursor: pointer; - border-radius: 0; - position: relative; - padding: 0; - width: $input-size; - height: $input-size; - background-color: $brand-color-primary; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='#{encode-hex(govuk-colour("white"))}'%3E%3C/path%3E%3C/svg%3E"); - background-position: center left; - background-size: $input-size $input-size; - background-repeat: no-repeat; - - text-indent: -5000px; - overflow: hidden; - - &:focus { - z-index: 2; - outline: $govuk-focus-width solid $govuk-focus-colour; - // Ensure outline appears outside of the element - outline-offset: 0; + input { + // overly specific to prevent some overrides from outside + @include govuk-font($size: 16, $line-height: (28 / 16)); + padding: 6px; + margin: 0; + //width: 100%; + height: $input-size; + background: govuk-colour("white"); + border-radius: 0; //otherwise iphones apply an automatic border radius + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + + // the .focus class is added by JS and ensures that the input remains above the label once clicked/filled in + &:focus, + &.focus { + z-index: 2; + } + + &:focus { + outline: $govuk-focus-width solid $govuk-focus-colour; + // Ensure outline appears outside of the element + outline-offset: 0; + } + + //max-width: 360px; } - &::-moz-focus-inner { - border: 0; + button { + flex-shrink: 0; + border: 0; + cursor: pointer; + border-radius: 0; + position: relative; + padding: 0; + width: $input-size; + height: $input-size; + background-color: $brand-color-primary; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='#{encode-hex(govuk-colour("white"))}'%3E%3C/path%3E%3C/svg%3E"); + background-position: center left; + background-size: $input-size $input-size; + background-repeat: no-repeat; + + text-indent: -5000px; + overflow: hidden; + + &:focus { + z-index: 2; + outline: $govuk-focus-width solid $govuk-focus-colour; + // Ensure outline appears outside of the element + outline-offset: 0; + } + + &::-moz-focus-inner { + border: 0; + } } - } } .site-search { - position: absolute; - right: 0; - top:-4px; - align-items: center; - min-width: 260px; - .search-form { - button { - background-color: $govuk-link-colour; + position: absolute; + right: 0; + top: -4px; + align-items: center; + min-width: 260px; + + .search-form { + button { + background-color: $govuk-link-colour; + } + } +} + +// @TODO [DWPF-454] merge these overrides with the relevant base classes +.search-v2 { + .site-search { + position: inherit; + + .search-form { + input { + border: none; + } + } + } + + .search-form { + margin: 7px 0; } - } } .site-search-mobile { - .search-form { - button { - background-color: $govuk-link-colour; + .search-form { + button { + background-color: $govuk-link-colour; + } + } +} + +@include govuk-media-query($until: desktop, $media-type: "screen") { + .site-search { + display: none; + } + + .search-and-profile-bar { + .govuk-width-container { + display: flow-root; + } + } + + // @TODO [DWPF-454] remove this rule + .search-v2-banner { + + .govuk-phase-banner__content { + line-height: 1.5; + } } - } } -@media only screen and (max-width: 767px) { - .site-search { - display: none; - } +// @TODO [DWPF-454] remove this rule, it's only for the custom v2 opt-in banner +.opt-in-invitation { + background-color: $tag-blue-background; + padding: 0 1em; + margin-top: 1em; - .search-and-profile-bar { - .govuk-width-container { - display: flow-root; + .govuk-phase-banner { + border-bottom: none; } - } -} \ No newline at end of file +} diff --git a/assets/stylesheets/components/_search_results.scss b/assets/stylesheets/components/_search_results.scss index e906f47b9..f12370fe7 100644 --- a/assets/stylesheets/components/_search_results.scss +++ b/assets/stylesheets/components/_search_results.scss @@ -17,16 +17,162 @@ } } -.v2-search-results { - &__category { - padding-top: 20px; - margin-bottom: 20px; +// Search v2 +.search-results { + margin-bottom: 2rem; - border: 1px solid $govuk-border-colour; + .search-v2-hide { + display: none; } +} - ul { - padding-left: 0px; - list-style: none; +.search-results__categories { + border-bottom: 1px solid black; + margin-bottom: 1rem; + + div { + display: flex; + flex-direction: column; + gap: 0.25em; + padding-bottom: 1em; + + > a { + padding: 0.4em 1em; + margin-left: -1em; + margin-right: -1em; + + &[data-selected], + &:hover { + color: govuk-colour("white"); + background-color: $govuk-link-colour; + text-decoration: none; + } + &:focus { + color: govuk-colour("black"); + background-color: $govuk-focus-colour; + box-shadow: 0 -2px $govuk-focus-colour, 0 5px govuk-colour("black"); + } + } + } +} + +.search-results__all { + display: grid; + grid-template-columns: 1fr; + grid-template-rows: auto; + gap: 1rem; + + .left-col { + order: 2; + } + + .right-col { + order: 1; + } + + .people { + margin-bottom: 1rem; + } +} + +@include govuk-media-query($from: tablet) { + .search-results__categories { + div { + max-width: 660px; + flex-direction: row; + justify-content: space-between; + padding-bottom: 5px; + + > a { + margin: 0; + padding: 0.25em 0; + + &[data-selected], + &:hover { + color: $govuk-link-colour; + background-color: govuk-colour("white"); + box-shadow: 0 0 govuk-colour("white"), 0 5px $govuk-link-colour; + } + + &:focus { + color: govuk-colour("black"); + background-color: $govuk-focus-colour; + box-shadow: 0 -2px $govuk-focus-colour, 0 5px govuk-colour("black"); + } + } + } + } +} + +@include govuk-media-query($from: desktop) { + .search-results__all { + grid-template-columns: 2fr 1fr; + + .left-col { + order: 1; + } + .right-col { + order: 2; + } } + + .search-results__categories { + div { + max-width: none; + justify-content: flex-start; + gap: 1em; + } + } +} + +.search-results__list { + .pinned { + padding: 1rem; + margin-bottom: 2rem; + background-color: govuk-colour("light-grey"); + } +} + +.search-results__list[data-search-category="teams"] { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + grid-gap: 1.5rem; + margin-bottom: 1.5rem; +} + +.search-result { + container-type: inline-size; + width: 100%; +} + +.search-result--person { + margin-bottom: 1rem; + + [data-detail-additional] { + display: none; + } +} + +// Show a person's additional details when the container is medium-large. +@container (min-width: 320px) { + .search-result--person [data-detail-additional] { + display: block; + } +} + +.search-result--page { + padding-bottom: 0.5rem; + + &:not(:last-child) { + margin-bottom: 1rem; + border-bottom: 1px solid $govuk-border-colour; + } + + > * { + margin-bottom: 0.5rem; + } +} + +.beta-feedback { + margin-top: 30px; } diff --git a/assets/stylesheets/govuk-overrides/header.scss b/assets/stylesheets/govuk-overrides/header.scss index 4985dddd3..9f030644d 100644 --- a/assets/stylesheets/govuk-overrides/header.scss +++ b/assets/stylesheets/govuk-overrides/header.scss @@ -1,74 +1,347 @@ .govuk-header { - border-bottom: 0; + border-bottom: 0; } .govuk-header__content { - width: auto; - margin-top:10px; + width: auto; + margin-top: 10px; } .govuk-header--ws { - background-color: govuk-colour("white"); + background-color: govuk-colour("white"); } .govuk-header__link--ws { - &:link, - &:visited { - color: govuk-colour("black"); - } + + &:link, + &:visited { + color: govuk-colour("black"); + } } +// TODO [DWPF-454] merge this rule with the below one .govuk-header__container { - border-bottom: 5px solid $brand-color-primary; - margin-bottom: 0; - padding-top: 6px; + border-bottom: 5px solid $brand-color-primary; + margin-bottom: 0; + padding-top: 6px; } -.govuk-header__navigation-item--active--ws { - a { - &:link, - &:hover, - &:visited { - color: $brand-color-primary; +// TODO [DWPF-454] remove .search-v2 class nesting to target directly +.search-v2 { + .govuk-header__container { + padding: 10px 0 6px 0; + border-bottom: none; + } + + .govuk-width-container { + display: flex; + justify-content: space-between; + } + + .govuk-header__logo { + width: fit-content; + float: none; + padding: 0; + margin: 0; + + .govuk-header__link { + margin: 0; + padding: 0; + line-height: auto; + } + + .govuk-header__link:hover { + border: none; + } + } + + .govuk-header__logotype--ws img { + margin: 0; + width: 120px; + height: 54px; + } + + .govuk-header__content { + flex-grow: 10; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + margin: 0; + column-gap: 20px; + } + + .govuk-header__service-name--ws { + font-size: 24px; + margin: 0; + // margin: govuk-spacing(1) 0; + // @include govuk-media-query ($from: mobile) { + // @include govuk-font($size: 27, $weight: bold); + // } + } + + .nav-and-profile-bar { + + .govuk-header__navigation { + margin: 0; + } + + .govuk-header__navigation-list { + margin: 0; + padding: 0; + } + + .govuk-header__link, + .govuk-header__navigation-item, + .govuk-header__navigation-item--active--ws, + .ancestor { + padding-top: 17px; + padding-right: max(15px, calc(15px + env(safe-area-inset-right))); + padding-bottom: 18px; + padding-left: max(20px, calc(20px + env(safe-area-inset-left))); + text-decoration-thickness: 5px; + text-underline-offset: 17px; + + .govuk-header__link--ws { + + &:link, + &:visited { + color: govuk-colour("white"); + } + + &:focus { + color: govuk-colour("black"); + } + } + + } + + .govuk-header__link:hover { + text-decoration-color: $govuk-link-colour; + } + + .govuk-header__link:focus { + color: govuk-colour("black"); + outline: none; + box-shadow: none; + text-decoration: underline; + text-decoration-thickness: 5px; + } + + .govuk-header__navigation-item:focus-within { + background-color: $govuk-focus-colour; + color: govuk-colour("black"); + } + } + + .govuk-header__navigation-item--active--ws, + .ancestor { + a { + + &:link, + &:hover, + &:visited { + color: govuk-colour("white"); + } + + &:focus { + color: govuk-colour("black"); + background-color: $govuk-focus-colour; + } + } + } + + .govuk-header__menu-button[aria-expanded=true]:hover { + box-shadow: 0 0 govuk-colour("white"), + 0 4px $govuk-link-colour; + text-decoration: none; + ; + } +} + +@include govuk-media-query($until: desktop, $media-type: "screen") { + + // @TODO [DWPF-454] remove the .search-v2 nesting and merge with existing rules + .search-v2 { + .govuk-width-container { + flex-direction: column; + + .govuk-header__content { + justify-content: left; + padding: 10px 0 4px 0; + } + } + + .govuk-header__menu-button.govuk-js-header-toggle { + top: 81px; + font-size: 1rem; + } + + .nav-and-profile-bar { + background-color: $brand-color-navy; + + .govuk-width-container { + margin: 0; + } + + .govuk-header__navigation-item, + li.govuk-header__navigation-item--active--ws, + li.ancestor { + padding: 0; + border: none; + } + + .govuk-header__link, + a.govuk-header__navigation-item--active--ws, + a.ancestor { + display: inline-block; + width: 100%; + padding-top: 17px; + padding-bottom: 17px; + text-decoration: none; + } + + .govuk-header__link:hover, + .govuk-header__link:active, + a.govuk-header__navigation-item--active--ws, + a.ancestor { + background-color: $govuk-link-colour; + color: govuk-colour("white"); + text-decoration: none; + } + + .govuk-header__link:focus { + background-color: $govuk-focus-colour; + color: govuk-colour("black"); + text-decoration: none; + } + + .site-search { + display: block; + padding: 0 15px; + background-color: govuk-colour("light-grey"); + } + } + } +} + +@include govuk-media-query($from: tablet, $media-type: "screen") { + .search-v2 { + + .govuk-header__service-name--ws { + font-size: 27px; + } + .nav-and-profile-bar { + + .govuk-header__link, + a.govuk-header__navigation-item--active--ws, + a.ancestor { + padding-right: max(30px, calc(30px + env(safe-area-inset-right))); + padding-left: max(30px, calc(30px + env(safe-area-inset-left))); + } + + .site-search { + padding: 0 30px; + } + } + } +} + +@include govuk-media-query($from: desktop, $media-type: "screen") { + .search-v2 { + .nav-and-profile-bar { + .govuk-header__navigation-list { + display: flex; + gap: 1em; + } + + .govuk-header__link, + .govuk-header__navigation-item, + .govuk-header__navigation-item--active--ws, + .ancestor { + margin: 0; + + } + + .govuk-header__link:first-child, + .govuk-header__navigation-item:first-child, + .govuk-header__navigation-item--active--ws:first-child, + .ancestor:first-child { + padding-left: 0; + + } + + .govuk-header__link, + a.govuk-header__navigation-item--active--ws, + a.ancestor { + padding: 0; + } + + .govuk-header__link, + .govuk-header__navigation-item, + .govuk-header__navigation-item--active--ws, + .ancestor { + padding-right: 0; + padding-left: 0; + + } + + .site-search { + max-width: 33%; + padding: 0; + } + } + } +} + + +.govuk-header__navigation-item--active--ws, +.ancestor { + a { + + &:link, + &:hover, + &:visited { + color: $brand-color-primary + } } - } } .govuk-header__logo--ws { - @include govuk-media-query ($from: desktop) { - width: 20%; - } + @include govuk-media-query ($from: desktop) { + width: 20%; + } } .govuk-header__logotype--ws { - @include govuk-media-query ($from: desktop) { - img { - margin: govuk-spacing(1) 0; + @include govuk-media-query ($from: desktop) { + img { + margin: govuk-spacing(1) 0; + } } - } } .govuk-header__content--ws { - @include govuk-media-query ($from: desktop) { - width: 80%; - margin-top: govuk-spacing(1); - } + @include govuk-media-query ($from: desktop) { + width: 80%; + margin-top: govuk-spacing(1); + } } -.govuk-header__link--service-name--ws { - @include govuk-font($size: 27, $weight: bold); +.govuk-header__service-name--ws { + @include govuk-font($size: 27, $weight: bold); - @include govuk-media-query ($from: desktop) { - margin: govuk-spacing(1) 0; - } + @include govuk-media-query ($from: desktop) { + margin: govuk-spacing(1) 0; + } } .govuk-header__menu-button--ws { - color: govuk-colour("black"); + color: govuk-colour("black"); } .govuk-header__navigation-item--mobile-only { - @include govuk-media-query ($from: desktop) { - display: none; - } + @include govuk-media-query ($from: desktop) { + display: none; + } } diff --git a/assets/stylesheets/vars/_colors.scss b/assets/stylesheets/vars/_colors.scss index 31fa8bf76..2af70149b 100644 --- a/assets/stylesheets/vars/_colors.scss +++ b/assets/stylesheets/vars/_colors.scss @@ -2,10 +2,16 @@ $brand-color-red: #cf102d; $brand-color-navy: #00285f; $brand-color-jade: #004d44; $brand-color-violet: #4814a0; +$tag-blue-background: #D2E2F1; $brand-color-grey90: #404040; $brand-color-grey50: #a7a7a7; $brand-color-grey10: #e7e7e7; +$brand-color-warning: orange; + $brand-color-primary: $brand-color-red; $brand-color-secondary: $brand-color-navy; + +// $govuk-button-background-colour +// $govuk-button-text-colour diff --git a/config/settings/base.py b/config/settings/base.py index a55922c06..b6629bec6 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -16,6 +16,7 @@ env_file = os.path.join(BASE_DIR, ".env") if os.path.exists(env_file): env.read_env(env_file) +env.read_env() VCAP_SERVICES = env.json("VCAP_SERVICES", {}) @@ -118,6 +119,9 @@ "django_chunk_upload_handlers", "django_audit_log_middleware", "rest_framework", + "crispy_forms", + "crispy_forms_gds", + "django_feedback_govuk", ] WAGTAIL_APPS = [ @@ -455,6 +459,12 @@ "level": os.getenv("DJANGO_DB_LOG_LEVEL", "INFO"), "propagate": True, }, + "opensearch": { + "handlers": [ + "stdout", + ], + "level": "INFO", + }, }, } @@ -519,3 +529,24 @@ # Home page HIDE_NEWS = env.bool("HIDE_NEWS", False) + +# Crispy forms +CRISPY_ALLOWED_TEMPLATE_PACKS = ["gds"] +CRISPY_TEMPLATE_PACK = "gds" + +# Feedback +DJANGO_FEEDBACK_GOVUK = { + "SERVICE_NAME": "the beta experience", + "FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID": env( + "FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID" + ), + "FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS": env.list( + "FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS", default=[] + ), + "COPY": { + "SUBMIT_TITLE": "Give your feedback on the beta search experience", + "FIELD_SATISFACTION_LEGEND": "How do you feel about your search experience today?", + "FIELD_COMMENT_LEGEND": "Tell us why you gave this response", + "FIELD_COMMENT_HINT": "If you would not like us to contact you for further user research please indicate below. Do not include any personal information.", + }, +} diff --git a/config/urls.py b/config/urls.py index 381c99ed6..dc4961229 100644 --- a/config/urls.py +++ b/config/urls.py @@ -3,6 +3,7 @@ from django.conf.urls import include from django.urls import path from django.views.generic import RedirectView +from django_feedback_govuk import urls as feedback_urls from wagtail import urls as wagtail_urls from wagtail.admin import urls as wagtailadmin_urls from wagtail.contrib.sitemaps.views import sitemap @@ -34,7 +35,8 @@ path("admin/", include(wagtailadmin_urls)), path("documents/", include(wagtaildocs_urls)), path("search/", search_views.search, name="search"), - path("v2-search/", search_views.v2_search, name="v2-search"), + # TODO[DWPF-454] remove this + path("search/", include("search.urls")), path("pingdom/", include("pingdom.urls")), # Peoplefinder path("people/", include(people_urlpatterns)), @@ -42,6 +44,10 @@ path("people-and-teams/", include(people_and_teams_urlpatterns)), path("peoplefinder/api/", include(api_urlpatterns)), path("sitemap.xml", sitemap), + # Feedback + path( + "feedback/", include(feedback_urls), name="feedback" + ), # @TODO [DWPF-454] remove feedback after beta # Wagtail path("", include(wagtail_urls)), ] diff --git a/content/models.py b/content/models.py index cefa15479..4ecf29d9b 100644 --- a/content/models.py +++ b/content/models.py @@ -5,16 +5,18 @@ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models +from django.db.models import Q, Subquery from simple_history.models import HistoricalRecords from wagtail.admin.panels import FieldPanel from wagtail.fields import StreamField -from wagtail.models import Page +from wagtail.models import Page, PageManager, PageQuerySet from wagtail.search import index from wagtail.snippets.models import register_snippet from content import blocks from content.utils import manage_excluded, manage_pinned from core.utils import set_seen_cookie_banner +from search.utils import split_query from user.models import User as UserModel @@ -75,7 +77,30 @@ def get_first_publisher(self) -> Optional[UserModel]: return None +class ContentPageQuerySet(PageQuerySet): + def pinned_q(self, query): + pinned = SearchPinPageLookUp.objects.filter_by_query(query) + + return Q(pk__in=Subquery(pinned.values("object_id"))) + + def pinned(self, query): + return self.filter(self.pinned_q(query)) + + def not_pinned(self, query): + return self.exclude(self.pinned_q(query)) + + def exclusions_q(self, query): + exclusions = SearchExclusionPageLookUp.objects.filter_by_query(query) + + return Q(pk__in=Subquery(exclusions.values("object_id"))) + + def exclusions(self, query): + return self.filter(self.exclusions_q(query)) + + class ContentPage(BasePage): + objects = PageManager.from_queryset(ContentPageQuerySet)() + is_creatable = False show_in_menus = True @@ -217,10 +242,20 @@ def save(self, *args, **kwargs): class SearchKeywordOrPhrase(models.Model): keyword_or_phrase = models.CharField(max_length=1000) + # TODO: Remove historical records. history = HistoricalRecords() +class SearchKeywordOrPhraseQuerySet(models.QuerySet): + def filter_by_query(self, query): + query_parts = split_query(query) + + return self.filter(search_keyword_or_phrase__keyword_or_phrase__in=query_parts) + + class SearchExclusionPageLookUp(models.Model): + objects = SearchKeywordOrPhraseQuerySet.as_manager() + search_keyword_or_phrase = models.ForeignKey( SearchKeywordOrPhrase, on_delete=models.CASCADE, @@ -228,10 +263,13 @@ class SearchExclusionPageLookUp(models.Model): content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content_object = GenericForeignKey("content_type", "object_id") + # TODO: Remove historical records. history = HistoricalRecords() class SearchPinPageLookUp(models.Model): + objects = SearchKeywordOrPhraseQuerySet.as_manager() + search_keyword_or_phrase = models.ForeignKey( SearchKeywordOrPhrase, on_delete=models.CASCADE, @@ -239,6 +277,7 @@ class SearchPinPageLookUp(models.Model): content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content_object = GenericForeignKey("content_type", "object_id") + # TODO: Remove historical records. history = HistoricalRecords() diff --git a/core/templates/base.html b/core/templates/base.html index a77f34308..22bbb001a 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -11,52 +11,82 @@ {% block title %} - {% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %} - {% endblock %} - {% block title_suffix %} - - Digital Workspace + {% if self.seo_title %} + {{ self.seo_title }} + {% else %} + {{ self.title }} + {% endif %} {% endblock %} + {% block title_suffix %}- Digital Workspace{% endblock %} - + - {% if settings.GTM_CODE %} + })(window,document,'script','dataLayer','{{ settings.GTM_CODE }}'); + gtm_data_then_click = function(object, data) { + dataLayer.push(data); + url=object.getAttribute("href"); + setTimeout(function(){location.href = url}, 500); + return false; + }; + {% endif %} - - - - + + + - - + {% render_bundle 'main' 'css' %} {% block stylesheets %}{% endblock %} {% block libraries %}{% endblock %} - {% if settings.GTM_CODE %} + height="0" + width="0" + style="display:none; + visibility:hidden"> {% endif %} - Skip to main content - {% include "includes/header.html" %} - {% include "includes/search_and_profile_bar.html" %} + Skip to main content + {% if user.enable_v2_search %} + {% include "includes/header_searchv2.html" %} + {% else %} + {# @TODO [DWPF-454] Remove these legacy header templates and the if condition #} + {% include "includes/header.html" %} + {% include "includes/search_and_profile_bar.html" %} + {% endif %} + {% if user.enable_v2_search or "search" in request.get_full_path %} + {# @TODO [DWPF-454] Remove this banner and the template file #} + {% include "tags/search_beta_banner.html" %} + {% endif %} {% cookie_banner %} {% site_alert %}
-
+
{% block breadcrumbs %} {% breadcrumbs %} {% endblock %} diff --git a/core/templates/django_feedback_govuk/templates/confirm.html b/core/templates/django_feedback_govuk/templates/confirm.html new file mode 100644 index 000000000..6616fba6b --- /dev/null +++ b/core/templates/django_feedback_govuk/templates/confirm.html @@ -0,0 +1,8 @@ +{% extends "1_col_content.html" %} +{% comment %} @TODO [DWPF-454] remove the package and this template {% endcomment %} +{% load feedback_tags %} +{% block content %} +
+
{% feedback_confirm %}
+
+{% endblock content %} diff --git a/core/templates/django_feedback_govuk/templates/listing.html b/core/templates/django_feedback_govuk/templates/listing.html new file mode 100644 index 000000000..0bcc770ca --- /dev/null +++ b/core/templates/django_feedback_govuk/templates/listing.html @@ -0,0 +1,7 @@ + +{% extends "1_col_content.html" %} +{% comment %} @TODO [DWPF-454] remove the package and this template {% endcomment %} +{% load feedback_tags %} +{% block content %} + {% feedback_listing %} +{% endblock content %} diff --git a/core/templates/django_feedback_govuk/templates/submit.html b/core/templates/django_feedback_govuk/templates/submit.html new file mode 100644 index 000000000..cf67638c2 --- /dev/null +++ b/core/templates/django_feedback_govuk/templates/submit.html @@ -0,0 +1,8 @@ +{% extends "1_col_content.html" %} +{% comment %} @TODO [DWPF-454] remove the package and this template {% endcomment %} +{% load feedback_tags %} +{% block content %} +
+
{% feedback_submit %}
+
+{% endblock content %} diff --git a/core/templates/includes/footer.html b/core/templates/includes/footer.html index db36ca0eb..702fc00c4 100644 --- a/core/templates/includes/footer.html +++ b/core/templates/includes/footer.html @@ -35,11 +35,6 @@

Support links

- {% if user.enable_v2_search %} - - {% endif %} Built by the DBT Digital, Data and Technology team diff --git a/core/templates/includes/govt_uk_form.html b/core/templates/includes/govt_uk_form.html index 3e8b23459..9d4522f85 100644 --- a/core/templates/includes/govt_uk_form.html +++ b/core/templates/includes/govt_uk_form.html @@ -1,6 +1,7 @@ {% if form.non_field_errors %} - {% endif %} -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/core/templates/includes/header.html b/core/templates/includes/header.html index a8ecbc6ca..3357bfa3f 100644 --- a/core/templates/includes/header.html +++ b/core/templates/includes/header.html @@ -1,35 +1,37 @@ {% load menu_tags %} {% load render_bundle webpack_static from webpack_loader %} - {#{% get_menu "main" as main_navigation %}#} - - diff --git a/core/templates/includes/header_searchv2.html b/core/templates/includes/header_searchv2.html new file mode 100644 index 000000000..257fb46fd --- /dev/null +++ b/core/templates/includes/header_searchv2.html @@ -0,0 +1,46 @@ +{% load menu_tags %} +{% load render_bundle webpack_static from webpack_loader %} +{# @TODO [DWPF-454] remove search-v2 class, rename this template #} + diff --git a/core/templates/includes/pagination_v2.html b/core/templates/includes/pagination_v2.html new file mode 100644 index 000000000..c5dfd64da --- /dev/null +++ b/core/templates/includes/pagination_v2.html @@ -0,0 +1,39 @@ +{% load paginator %} + + diff --git a/core/templates/includes/profile_panel.html b/core/templates/includes/profile_panel.html new file mode 100644 index 000000000..6cff66d8d --- /dev/null +++ b/core/templates/includes/profile_panel.html @@ -0,0 +1,25 @@ +{% load render_bundle webpack_static from webpack_loader %} + diff --git a/core/templates/includes/search_and_profile_bar.html b/core/templates/includes/search_and_profile_bar.html index 84d0e2dcf..9186ee61d 100644 --- a/core/templates/includes/search_and_profile_bar.html +++ b/core/templates/includes/search_and_profile_bar.html @@ -1,13 +1,18 @@ {% load render_bundle webpack_static from webpack_loader %} - +{# TODO [DWPF-454] Delete this template #}
- {# if not request.user.enable_v2_search #} -
- - + + + {% if people_and_teams_search_filters %} {% for filter in people_and_teams_search_filters %} @@ -18,32 +23,6 @@ {% endif %}
- {# else #} - - {# endif #} - + {% include 'includes/profile_panel.html' %}
diff --git a/core/templates/menus/main_menu.html b/core/templates/menus/main_menu.html index 0334bf07b..00a8b3735 100644 --- a/core/templates/menus/main_menu.html +++ b/core/templates/menus/main_menu.html @@ -1,33 +1,22 @@ - -
{% endfor %} - \ No newline at end of file + diff --git a/peoplefinder/templates/peoplefinder/components/error-summary.html b/peoplefinder/templates/peoplefinder/components/error-summary.html index e0864dfb6..f8d2800df 100644 --- a/peoplefinder/templates/peoplefinder/components/error-summary.html +++ b/peoplefinder/templates/peoplefinder/components/error-summary.html @@ -1,26 +1,27 @@ {% if form.errors %} -