diff --git a/.gitignore b/.gitignore index 5d65150f9..db12ef0f2 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,8 @@ node_modules/ # Ignore public/system files public/system public/assets -public/export-opportunities +public/export-opportunities/assets/* +!public/export-opportunities/assets/ckeditor heroku_config_variables *.sh diff --git a/Gemfile b/Gemfile index 7c12544c9..ad64d3c40 100644 --- a/Gemfile +++ b/Gemfile @@ -2,21 +2,21 @@ source 'https://rubygems.org' ruby '2.7.4' -gem 'rails', '6.0.3.7' +gem 'rails', '6.0.4.6' gem 'bundler' -gem 'puma', '4.3.8' +gem 'puma', '5.6.2' gem 'pg', '1.1.4' -gem 'sidekiq' -gem 'sidekiq-cron' -gem 'sidekiq-failures' -gem 'redis', '3.3.3' +gem 'sidekiq', '>= 6.4.0' +gem 'sidekiq-cron', '1.2.0' +gem 'sidekiq-failures', '1.0.1' +gem 'redis', '>= 4.2.0' gem 'redis-namespace' gem 'faraday', '1.0.1' gem 'figaro' gem 'friendly_id' gem 'immutable-struct' -gem 'nokogiri', '1.11.4' +gem 'nokogiri', '1.12.5' # Authentication & authorisation gem 'devise', github: 'heartcombo/devise', branch: 'master' @@ -48,7 +48,7 @@ gem 'sass-rails' # Javascript gem 'jquery-rails' -gem 'ckeditor' +# gem 'ckeditor' # Ruby tools gem 'stringex', require: false diff --git a/Gemfile.lock b/Gemfile.lock index ff2fe49b8..b7b75d5a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,66 +13,66 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.0.3.7) - actionpack (= 6.0.3.7) + actioncable (6.0.4.6) + actionpack (= 6.0.4.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.7) - actionpack (= 6.0.3.7) - activejob (= 6.0.3.7) - activerecord (= 6.0.3.7) - activestorage (= 6.0.3.7) - activesupport (= 6.0.3.7) + actionmailbox (6.0.4.6) + actionpack (= 6.0.4.6) + activejob (= 6.0.4.6) + activerecord (= 6.0.4.6) + activestorage (= 6.0.4.6) + activesupport (= 6.0.4.6) mail (>= 2.7.1) - actionmailer (6.0.3.7) - actionpack (= 6.0.3.7) - actionview (= 6.0.3.7) - activejob (= 6.0.3.7) + actionmailer (6.0.4.6) + actionpack (= 6.0.4.6) + actionview (= 6.0.4.6) + activejob (= 6.0.4.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.3.7) - actionview (= 6.0.3.7) - activesupport (= 6.0.3.7) + actionpack (6.0.4.6) + actionview (= 6.0.4.6) + activesupport (= 6.0.4.6) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actionpack-page_caching (1.2.2) actionpack (>= 5.0.0) - actiontext (6.0.3.7) - actionpack (= 6.0.3.7) - activerecord (= 6.0.3.7) - activestorage (= 6.0.3.7) - activesupport (= 6.0.3.7) + actiontext (6.0.4.6) + actionpack (= 6.0.4.6) + activerecord (= 6.0.4.6) + activestorage (= 6.0.4.6) + activesupport (= 6.0.4.6) nokogiri (>= 1.8.5) - actionview (6.0.3.7) - activesupport (= 6.0.3.7) + actionview (6.0.4.6) + activesupport (= 6.0.4.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (6.0.3.7) - activesupport (= 6.0.3.7) + activejob (6.0.4.6) + activesupport (= 6.0.4.6) globalid (>= 0.3.6) - activemodel (6.0.3.7) - activesupport (= 6.0.3.7) - activerecord (6.0.3.7) - activemodel (= 6.0.3.7) - activesupport (= 6.0.3.7) - activestorage (6.0.3.7) - actionpack (= 6.0.3.7) - activejob (= 6.0.3.7) - activerecord (= 6.0.3.7) + activemodel (6.0.4.6) + activesupport (= 6.0.4.6) + activerecord (6.0.4.6) + activemodel (= 6.0.4.6) + activesupport (= 6.0.4.6) + activestorage (6.0.4.6) + actionpack (= 6.0.4.6) + activejob (= 6.0.4.6) + activerecord (= 6.0.4.6) marcel (~> 1.0.0) - activesupport (6.0.3.7) + activesupport (6.0.4.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) ast (2.4.0) @@ -1005,12 +1005,10 @@ GEM capybara-screenshot (1.0.24) capybara (>= 1.0, < 4) launchy - ckeditor (5.1.0) - orm_adapter (~> 0.5.0) cliver (0.3.2) coderay (1.1.2) - concurrent-ruby (1.1.8) - connection_pool (2.2.2) + concurrent-ruby (1.1.9) + connection_pool (2.2.5) crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.6) @@ -1077,8 +1075,8 @@ GEM fuubar (2.5.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.0.0) + activesupport (>= 5.0) hairtrigger (0.2.23) activerecord (>= 5.0, < 7) ruby2ruby (~> 2.4) @@ -1093,7 +1091,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) immutable-struct (2.4.1) interception (0.5) @@ -1123,19 +1121,19 @@ GEM listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.1) + loofah (2.14.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2020.0512) - mini_mime (1.1.0) - mini_portile2 (2.5.1) - minitest (5.14.4) + mini_mime (1.1.2) + mini_portile2 (2.6.1) + minitest (5.15.0) mock_redis (0.23.0) multi_json (1.15.0) multi_xml (0.6.0) @@ -1144,9 +1142,9 @@ GEM sass (>= 3.3) thor (~> 0.19) netrc (0.11.0) - nio4r (2.5.7) - nokogiri (1.11.4) - mini_portile2 (~> 2.5.0) + nio4r (2.5.8) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) racc (~> 1.4) normalize-scss (7.0.1) sass (~> 3.3) @@ -1201,34 +1199,34 @@ GEM pry-stack_explorer (0.4.9.3) binding_of_caller (>= 0.7) pry (>= 0.9.11) - public_suffix (4.0.5) - puma (4.3.8) + public_suffix (4.0.6) + puma (5.6.2) nio4r (~> 2.0) pundit (2.1.0) activesupport (>= 3.0.0) pundit-matchers (1.6.0) rspec-rails (>= 3.0.0) raabro (1.3.1) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-protection (2.0.8.1) rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.3.7) - actioncable (= 6.0.3.7) - actionmailbox (= 6.0.3.7) - actionmailer (= 6.0.3.7) - actionpack (= 6.0.3.7) - actiontext (= 6.0.3.7) - actionview (= 6.0.3.7) - activejob (= 6.0.3.7) - activemodel (= 6.0.3.7) - activerecord (= 6.0.3.7) - activestorage (= 6.0.3.7) - activesupport (= 6.0.3.7) + rails (6.0.4.6) + actioncable (= 6.0.4.6) + actionmailbox (= 6.0.4.6) + actionmailer (= 6.0.4.6) + actionpack (= 6.0.4.6) + actiontext (= 6.0.4.6) + actionview (= 6.0.4.6) + activejob (= 6.0.4.6) + activemodel (= 6.0.4.6) + activerecord (= 6.0.4.6) + activestorage (= 6.0.4.6) + activesupport (= 6.0.4.6) bundler (>= 1.3.0) - railties (= 6.0.3.7) + railties (= 6.0.4.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) @@ -1237,21 +1235,21 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (6.0.3.7) - actionpack (= 6.0.3.7) - activesupport (= 6.0.3.7) + railties (6.0.4.6) + actionpack (= 6.0.4.6) + activesupport (= 6.0.4.6) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.0.0) - rake (13.0.3) + rake (13.0.6) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (6.2.1) - redis (3.3.3) + rdoc (6.3.2) + redis (4.6.0) redis-namespace (1.7.0) redis (>= 3.0.4) regexp_parser (1.7.0) @@ -1332,15 +1330,14 @@ GEM activesupport (>= 4.2.0) show_me_the_cookies (5.0.1) capybara (>= 2, < 4) - sidekiq (5.0.4) - concurrent-ruby (~> 1.0) - connection_pool (~> 2.2, >= 2.2.0) - rack-protection (>= 1.5.0) - redis (~> 3.3, >= 3.3.3) + sidekiq (6.4.0) + connection_pool (>= 2.2.2) + rack (~> 2.0) + redis (>= 4.2.0) sidekiq-cron (1.2.0) fugit (~> 1.1) sidekiq (>= 4.2.1) - sidekiq-failures (1.0.0) + sidekiq-failures (1.0.1) sidekiq (>= 4.0.0) simplecov (0.18.5) docile (~> 1.1) @@ -1352,9 +1349,9 @@ GEM sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) stringex (2.8.5) temple (0.8.2) @@ -1384,13 +1381,13 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) yajl-ruby (1.4.1) - zeitwerk (2.4.2) + zeitwerk (2.5.4) PLATFORMS ruby @@ -1408,7 +1405,6 @@ DEPENDENCIES capybara capybara-email capybara-screenshot - ckeditor database_cleaner devise! devise-async @@ -1437,7 +1433,7 @@ DEPENDENCIES listen mock_redis neat (= 1.8.0) - nokogiri (= 1.11.4) + nokogiri (= 1.12.5) normalize-scss omniauth (= 2.0.3) omniauth-oauth2 (= 1.7.1) @@ -1451,12 +1447,12 @@ DEPENDENCIES pry-rails pry-rescue pry-stack_explorer - puma (= 4.3.8) + puma (= 5.6.2) pundit pundit-matchers - rails (= 6.0.3.7) + rails (= 6.0.4.6) rails-controller-testing - redis (= 3.3.3) + redis (>= 4.2.0) redis-namespace rest-client rspec-collection_matchers @@ -1473,9 +1469,9 @@ DEPENDENCIES sentry-raven (= 3.0.0) shoulda-matchers show_me_the_cookies - sidekiq - sidekiq-cron - sidekiq-failures + sidekiq (>= 6.4.0) + sidekiq-cron (= 1.2.0) + sidekiq-failures (= 1.0.1) simplecov spring spring-commands-rspec @@ -1488,7 +1484,7 @@ DEPENDENCIES yajl-ruby (>= 1.3.1) RUBY VERSION - ruby 2.7.2p137 + ruby 2.7.4p191 BUNDLED WITH 2.1.4 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 6bdf2d0b5..5fe52bf16 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -2,7 +2,6 @@ //= link_directory ../javascripts .js //= link_directory ../stylesheets .css -//= require config //= require jquery.placeholder.min //= require jquery.charactercounter //= require select2 @@ -22,8 +21,7 @@ //= link export-components/dit.classes.Dropdown //= link export-components/dit.components.cookie-notice -//= link export-components/dit.components.greatDomesticHeader -//= link export-components/dit.components.magnaHeader +//= link export-components/dit.components.header // Stylesheets //= link_tree ../stylesheets/transformation @@ -54,4 +52,3 @@ //= link transformation/pages/opportunity.css //= link transformation/pages/results.css //= link export-components/main.css -//= link export-components/magna-main.css diff --git a/app/assets/javascripts/admin.init.js.erb b/app/assets/javascripts/admin.init.js.erb index c458fab15..ff22b46ee 100644 --- a/app/assets/javascripts/admin.init.js.erb +++ b/app/assets/javascripts/admin.init.js.erb @@ -2,8 +2,7 @@ var ukti = window.ukti || {}; ukti.config = { - "ckeditorPath" : "/js/ckeditor/ckeditor.js", - "textEditorScriptPath" : "<%=image_path('ckeditor/ckeditor.js')%>" + 'ckeditorPath': '/export-opportunities/assets/ckeditor/ckeditor.js', }; $('body').addClass('js-enabled'); diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index 97aedb0f8..92a0bf8ce 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -1,7 +1,7 @@ //= require jquery-3.3.1.min //= require jquery.charactercounter -//= require datepicker.lang.en.js +//= require datepicker.lang.en //= require datepicker //= require moment //= require js.cookie @@ -20,4 +20,4 @@ //= require components/EnquiryResponse //= require components/ToggleFieldEdit //= require components/UploadWidget -//= require admin.init.js +//= require admin.init diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 7b4ce3233..ffa469982 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,4 +1,3 @@ -//= require config //= require jquery.placeholder.min //= require jquery.charactercounter //= require select2 diff --git a/app/assets/javascripts/components/EnquiryResponse.js b/app/assets/javascripts/components/EnquiryResponse.js index eff05d4c7..16e7a18f4 100644 --- a/app/assets/javascripts/components/EnquiryResponse.js +++ b/app/assets/javascripts/components/EnquiryResponse.js @@ -105,8 +105,8 @@ ukti.EnquiryResponse = (function($) { event.editor.element.$.dispatchEvent(raiseEvent); }); }); - CKEDITOR.replace( 'enquiry_response_email_body' ); - CKEDITOR.replace( 'enquiry_response_signature' ); + CKEDITOR.replace('enquiry_response_email_body'); + CKEDITOR.replace('enquiry_response_signature'); }; var initToggleFieldEdit = function () { diff --git a/app/assets/javascripts/config.js.erb b/app/assets/javascripts/config.js.erb deleted file mode 100644 index d585e688b..000000000 --- a/app/assets/javascripts/config.js.erb +++ /dev/null @@ -1,7 +0,0 @@ -var ukti = window.ukti || {}; - -ukti.config = { - "ckeditorPath" : "/js/ckeditor/ckeditor.js", - "textEditorScriptPath" : "<%=image_path('ckeditor/ckeditor.js')%>", - "registerURL": "<%=Figaro.env.SSO_ENDPOINT_BASE_URI%><%=Figaro.env.SSO_ENDPOINT_SSO_APPEND%>/accounts/signup" -}; \ No newline at end of file diff --git a/app/assets/javascripts/export-components/dit.components.magnaHeader.js b/app/assets/javascripts/export-components/dit.components.header.js similarity index 100% rename from app/assets/javascripts/export-components/dit.components.magnaHeader.js rename to app/assets/javascripts/export-components/dit.components.header.js diff --git a/app/assets/javascripts/transformation/dit.class.selective_lookup.js b/app/assets/javascripts/transformation/dit.class.selective_lookup.js index 7b851ec72..c21c2da5c 100644 --- a/app/assets/javascripts/transformation/dit.class.selective_lookup.js +++ b/app/assets/javascripts/transformation/dit.class.selective_lookup.js @@ -228,7 +228,7 @@ * @datamapping (Object) Allow change of required key name **/ SelectiveLookup.prototype.setContent = function() { - var data = this._private.service.data; + var data = this._private.service.data['items']; var $list = this._private.$list.empty(); var map; if(data && data.length) { diff --git a/app/assets/javascripts/transformation_admin/dit.page.opportunity.js b/app/assets/javascripts/transformation_admin/dit.page.opportunity.js index 39e2e0aee..16611bbc6 100644 --- a/app/assets/javascripts/transformation_admin/dit.page.opportunity.js +++ b/app/assets/javascripts/transformation_admin/dit.page.opportunity.js @@ -2,6 +2,7 @@ // // required dit.js // required dit.utils.js +//= require components/AsyncLoad //= require transformation/dit.class.selective_lookup.js //= require transformation/dit.class.cpv_code_lookup.js //= require transformation/dit.class.data_provider.js @@ -9,6 +10,11 @@ //= require transformation/dit.class.filter_multiple_select.js //= require transformation/dit.class.expander.js +var ukti = window.ukti || {}; + +ukti.config = { + 'ckeditorPath': '/export-opportunities/assets/ckeditor/ckeditor.js', +}; dit.page.opportunity = (new function () { var _cache = {} @@ -19,6 +25,7 @@ dit.page.opportunity = (new function () { setupFilterMultipleSelectFields(); setupExpanders(); setupCpvLookup(); + loadTextEditorScript(); delete this.init; // Run once } @@ -145,6 +152,42 @@ dit.page.opportunity = (new function () { } } + function loadTextEditorScript() { + if (ukti.config.ckeditorPath) { + ukti.asyncLoad.init(ukti.config.ckeditorPath, initTextEditor); + } + } + + function initTextEditor() { + CKEDITOR.stylesSet.add('mystyles', [ + // Block-level styles + { name: 'Heading 1', element: 'h1'}, + { name: 'Heading 2', element: 'h2'}, + { name: 'Heading 3', element: 'h3'}, + { name: 'Introduction', element: 'p', attributes: { 'class': 'introduction'} }, + // Inline styles + { name: 'Link button', element: 'a', attributes: { 'class': 'button' } }, + { name: 'List', element: 'ul', attributes: { 'class': 'list list-bullet' } }, + // Object styles + { name: 'Stretch', element: 'img', attributes: { 'class': 'stretch' } }, + ]); + CKEDITOR.on('instanceReady', function(evt) { + var editor = evt.editor; + editor.on('focus', function(event) { + event.editor.container.$.classList.add(focusOutlineClassname); + }); + editor.on('blur', function(event) { + event.editor.container.$.classList.remove(focusOutlineClassname); + }); + editor.on('change', function(event) { + event.editor.updateElement(); + var raiseEvent = document.createEvent('Event'); + raiseEvent.initEvent('change', true, true); + event.editor.element.$.dispatchEvent(raiseEvent); + }); + }); + CKEDITOR.replace('opportunity_description'); + }; }); $(document).ready(function() { diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 74eb0eeac..4c01e72a4 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -19,7 +19,6 @@ /* Former export_components styles */ // = require export-components/main -// = require export-components/magna-main /* New styles to be rolled into a style library */ // = require dit-styleguide-augment/main diff --git a/app/assets/stylesheets/export-components/header-footer/_header.scss b/app/assets/stylesheets/export-components/header-footer/_header.scss index 0effc88c7..f69c6fca2 100644 --- a/app/assets/stylesheets/export-components/header-footer/_header.scss +++ b/app/assets/stylesheets/export-components/header-footer/_header.scss @@ -1,164 +1,229 @@ - -// HEADER -// ======= - -// base styling. JS disabled - -@import '../partials/typography'; -@import '../partials/colours'; @import '../partials/mixins'; +@import '../partials/colours'; -.great-header { - // need to make sure it's not underneath anything - position: relative; - z-index: 5; - - // fix for SOO - .great-header-nav { - a.link, - a.link:hover { - margin-bottom: 0; - border: 0; - } - } - - a { - &:active:focus { - background-color: $focus-yellow; - color: $great-blue; - } - - &:focus { - @include focus - } - } +@mixin burger-icon-line { + background-color: $white; + transition: all 0.2s ease; + clear: right; + content: ''; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; } -// links in global header -.great-domestic-international-links { - a { - color: $mid-grey; - } - - .active { - color: $great-blue; - - &:after { - display: block; - position: absolute; - left: 0; - bottom: 0; - width: 100%; - height: 4px; - background-color: $flag-red; - content: ''; +.magna-header { + &.great-header { + &.expanded { + &:before { + content: ''; + background: rgba(0, 0, 0, 0.5); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + } + + .user-greeting { + display: block; + } + } + + &.signed-out { + .main-nav.mobile.expanded { + @media (max-width: 768px) { + margin-top: -14px; + } + } + } + + &.signed-in { + .main-nav-container.mobile { + @media (max-width: 768px) { + margin-top: -14px; + } + } + } + + .js-mobile-button.expanded { + z-index: 1; + } + + .mobile-only { + display: none; + + @media (max-width: 768px) { + display: block; + } + } + + .main-nav-container.mobile { + display: block; + z-index: 1; + position: relative; + } + + .main-nav.mobile.expanded { + background: #4b426d; + // padding: 0 20px 0; + z-index: 1; + + @media (max-width: 768px) { + margin-top: 0; + position: absolute; + } + } + + .main-nav.mobile .nav-list li { + border-bottom: 1px solid #635a7f; + + &:last-child { + border-bottom: 0; + } + + a, + button { + background: none; + border: 0; + color: #fff; + font-family: Overpass, Arial, Helvetica, Verdana; + font-size: 18px; + letter-spacing: 0; + line-height: 16px; + padding: 20px 0; + font-weight: 100; + text-decoration: none; + + &.new:after { + background: #eb4f4d; + border-radius: 4px; + content: 'new'; + font-family: 'FS Lucas', Arial, Helvetica, Verdana; + font-size: 16px; + padding: 5px 12px; + font-weight: 700; + line-height: 20px; + position: absolute; + top: 13px; + right: 0; + display: inline-block; + } + } + } + } + + .js-mobile-button { + display: none; + + @include button-reset; + + height: 50px; + position: absolute; + top: 45px; + right: 0; + color: $white; + background-color: $great-blue; + border: 2px solid $white; + padding: 10px 45px 10px 10px; + cursor: pointer; + + &:focus { + @include focus; + } + + &.ready { + display: block; + } + + .burger-icon { + // The three burger lines are formed using the span, and its before and after. + @include burger-icon-line; + + position: absolute; + right: 10px; + top: 22px; + transition: background-color 0.2s ease; + background-color: transparent; + + &:before { + @include burger-icon-line; + margin-top: -6px; + } + + &:after { + @include burger-icon-line; + } + + &:focus { + @include focus; + } + } + + // When expanded, the icon changes to an 'X', by rotating the top and bottom lines, and removing the middle one. + &.expanded { + background-color: $active-blue; + z-index: 1; + + .burger-icon { + background-color: transparent; + + &:before, + &:after { + width: 25px; + margin-right: -3px; + } + + &:before { + transform: rotate(45deg); + margin-top: 0; + } + + &:after { + transform: rotate(-45deg); + margin-top: -12px; + } + } + } + + @media (min-width: 768px) { + height: 40px; + padding-top: 5px; + padding-bottom: 5px; + top: 60px; + + .burger-icon { + top: 18px; + } + } + + &.mobile-only { + + @media (min-width: 768px) { + display: none; + } + } } - } -} - -// main header menu -.great-header-menu { - background-color: $great-blue; - position: relative; - - & > .container { - overflow: hidden; - padding-bottom: 25px; - } - - &.domestic > .container { - padding-top: 20px; - } - - &.international > .container { - padding-top: 25px; - } - - &.domestic .great-header-logo { - height: 80px; - } -} - -// language/country select and account links -.great-header-extra-links { - float: right; - font-size: 14px; - color: $white; - - li { - display: inline-block; - } - - a { - text-decoration: none; - color: inherit; - - &:hover { - text-decoration: underline; + + .user-greeting { + background: #006ccc; + color: #fff; + display: none; + font-family: Overpass, Arial, Helvetica, Verdana; + font-size: 20px; + padding: 15px 20px; } - - &:last-child { - margin-left: 15px; + + &.signed-in { + .great-header-search-wrapper form { + @media (min-width: 768px) { + margin-right: 118px; + } + } + + &#great-domestic-header .main-nav.desktop { + margin-right: 376px; + } } - - &:active:focus span { - color: $great-blue; - } - } - - .lang, - .country, - .account-link { - color: $stone; - margin-left: 5px; - } - - .lang { - text-transform: uppercase; - } -} - -.great-header-logo { - display: block; - float: left; -} - -// main navigation -.great-header-nav-container { - width: 100%; - background-color: $white; -} - -.great-header-nav { - padding: 15px 0; - max-width: 1200px; - margin: 0 auto; - - a.link-heading { - text-decoration: underline; - } - - .link-heading { - font-size: 19px; - color: $grey; - } -} - -// JS enabled styling -body.js-enabled { - @import 'js-header'; -} - -@media (max-width: 1260px) { - .great-header-nav { - margin: 0 30px; - } -} - -@import 'mobile-header'; - -@media (max-width: 420px) { - .great-header-nav { - margin: 0 20px; - } } diff --git a/app/assets/stylesheets/export-components/header-footer/_js-mobile-header.scss b/app/assets/stylesheets/export-components/header-footer/_js-mobile-header.scss index 5e9159ead..e946d3a26 100644 --- a/app/assets/stylesheets/export-components/header-footer/_js-mobile-header.scss +++ b/app/assets/stylesheets/export-components/header-footer/_js-mobile-header.scss @@ -1,179 +1,742 @@ +.great-header, +.great-sub-header { + position: relative; + z-index: 5; +} -// JS MOBILE HEADER -// ================= +.great-header:focus-within, +.great-sub-header:focus-within { + z-index: 6; +} -@media (max-width: 768px) { - .great-header-menu.international > .container { - padding-bottom: 25px; - } +.great-header a:focus, +.great-sub-header a:focus { + outline: #ffbf47 solid 4px; + outline-offset: 0; +} + +.great-header a:focus:active, +.great-sub-header a:focus:active { + background-color: #ffbf47; + color: #1e1348; +} + +.great-header .menu, +.great-sub-header .menu { + background-color: #1e1348; + position: relative; +} - .great-global-header { - @include float-clear; - height: auto; - } +.great-header .menu .container, +.great-sub-header .menu .container { + max-width: 1200px; + margin: 0 auto; + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -ms-flex-line-pack: center; + align-content: center; + padding: 0; +} - .great-header-menu.domestic .great-header-logo { - margin-top: -25px; +@media (max-width: 1260px) { - img { - height: 100%; + .great-header .menu .container, + .great-sub-header .menu .container { + margin: 0 30px; } - } +} - .great-header-logo img { - height: 50px; - width: auto; - } +@media (max-width: 420px) { + + .great-header .menu .container, + .great-sub-header .menu .container { + margin: 0 20px; + } +} - .great-header-extra-links { - top: 10px; - right: 30px; +.great-header .extra-links, +.great-sub-header .extra-links { + font-size: 14px; + color: #ffffff; position: absolute; - } + top: 25px; + right: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} - .great-header-menu > .container { - padding-bottom: 25px; - padding-top: 45px; - } +@media (max-width: 768px) { - .great-header-nav-container { - width: 100%; + .great-header .extra-links, + .great-sub-header .extra-links { + top: 10px; + } +} + +.great-header .extra-links li:last-child, +.great-sub-header .extra-links li:last-child { + margin-left: 10px; +} + +.great-header .main-nav-container.mobile, +.great-sub-header .main-nav-container.mobile { + display: none; margin: 0; - } +} + +@media (max-width: 768px) { + + .great-header .main-nav-container.mobile, + .great-sub-header .main-nav-container.mobile { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } +} + +.great-header .main-nav-container.desktop, +.great-sub-header .main-nav-container.desktop { + background-color: transparent; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-item-align: end; + align-self: flex-end; +} - .great-header-nav.domestic .js-top-level-list { - .link-heading { - color: $white; - display: block; +@media (max-width: 768px) { + + .great-header .main-nav-container.desktop, + .great-sub-header .main-nav-container.desktop { + display: none; } +} - .js-collapsible-menu { - position: static; +@media (max-width: 1260px) { + + .great-header .main-nav-container.desktop, + .great-sub-header .main-nav-container.desktop { + margin-left: 30px; } - } +} - .great-header-nav { - @include float-clear; +.great-header .main-nav.mobile, +.great-sub-header .main-nav.mobile { + display: none; + -webkit-transition: all .2s ease; transition: all .2s ease; - position: static; - background-color: $lightened-great-blue; - height: auto; + background-color: #3b3458; margin: 0; width: 100%; + opacity: 0; + overflow: hidden; +} - .js-nav-list { - margin: 0 30px; - width: auto; +.great-header .main-nav.mobile.expanded, +.great-sub-header .main-nav.mobile.expanded { + opacity: 1; + display: block; +} - a, - a.link-heading { - text-decoration: underline; - } +.great-header .main-nav.mobile .nav-list, +.great-sub-header .main-nav.mobile .nav-list { + margin: 4px 30px; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} - .column-quarter { - width: auto; - float: none; - } +.great-header .main-nav.desktop, +.great-sub-header .main-nav.desktop { + max-width: 1200px; +} + +.great-header .nav-list, +.great-sub-header .nav-list { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + position: relative; +} + +@media (max-width: 420px) { + + .great-header .nav-list, + .great-sub-header .nav-list { + margin: 4px 20px; } +} + +.great-header .menu-item, +.great-sub-header .menu-item { + width: auto; + padding: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + line-height: 1; +} + +.great-header .link-heading, +.great-sub-header .link-heading { + color: #ffffff; + font-family: inherit; + display: block; + font-size: 16px; + line-height: 30px; + padding: 15px; + text-decoration: none; + position: relative; +} + +.great-header .link-heading:hover, +.great-sub-header .link-heading:hover { + text-decoration: underline; +} - &.collapsed { - height: 0; - opacity: 0; - overflow: hidden; +@media (max-width: 768px) { + + .great-header .link-heading, + .great-sub-header .link-heading { + text-decoration: underline; + padding: 15px 0; + margin: 0; + line-height: 1; + } +} + +.magna-header.great-header.expanded:before { + content: ""; + background: rgba(0, 0, 0, 0.5); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; +} + +.magna-header.great-header.expanded .user-greeting { + display: block; +} + +@media (max-width: 768px) { + .magna-header.great-header.signed-out .main-nav.mobile.expanded { + margin-top: -14px; } +} - .js-top-level-list .link-heading { - margin: 0; - padding: 15px 0; +@media (max-width: 768px) { + .magna-header.great-header.signed-in .main-nav-container.mobile { + margin-top: -14px; } +} + +.magna-header.great-header .js-mobile-button.expanded { + z-index: 1; +} - .js-menuitem { - .link-heading { +.magna-header.great-header .mobile-only { + display: none; +} + +@media (max-width: 768px) { + .magna-header.great-header .mobile-only { display: block; - margin: 0; - padding: 15px 0; - } } - } +} + +.magna-header.great-header .main-nav-container.mobile { + display: block; + z-index: 1; + position: relative; +} + +.magna-header.great-header .main-nav.mobile.expanded { + background: #4b426d; + // padding: 0 20px; + z-index: 1; +} - .js-mobile-button { - @include button-reset; +@media (max-width: 768px) { + .magna-header.great-header .main-nav.mobile.expanded { + margin-top: 0; + position: absolute; + } +} + +.magna-header.great-header .main-nav.mobile .nav-list li { + border-bottom: 1px solid #635a7f; +} + +.magna-header.great-header .main-nav.mobile .nav-list li:last-child { + border-bottom: 0; +} + +.magna-header.great-header .main-nav.mobile .nav-list li a, +.magna-header.great-header .main-nav.mobile .nav-list li button { + background: none; + border: 0; + color: #fff; + font-family: Overpass, Arial, Helvetica, Verdana; + font-size: 18px; + letter-spacing: 0; + line-height: 16px; + padding: 20px 0; + font-weight: 100; + text-decoration: none; +} + +.magna-header.great-header .main-nav.mobile .nav-list li a.new:after, +.magna-header.great-header .main-nav.mobile .nav-list li button.new:after { + background: #eb4f4d; + border-radius: 4px; + content: "new"; + font-family: 'FS Lucas', Arial, Helvetica, Verdana; + font-size: 16px; + padding: 5px 12px; + font-weight: 700; + line-height: 20px; + position: absolute; + top: 13px; + right: 0; + display: inline-block; +} + +.magna-header .js-mobile-button { + display: none; + border: 0; + margin: 0; + width: auto; + overflow: visible; + background: transparent; + color: inherit; + cursor: pointer; + font: inherit; + line-height: normal; + -webkit-font-smoothing: inherit; + -moz-osx-font-smoothing: inherit; + -webkit-appearance: none; height: 50px; position: absolute; top: 45px; - right: 30px; - color: $white; - background-color: $great-blue; - border: 2px solid $white; - padding: 10px; - padding-right: 45px; + right: 0; + color: #ffffff; + background-color: #1e1348; + border: 2px solid #ffffff; + padding: 10px 45px 10px 10px; cursor: pointer; +} + +.magna-header .js-mobile-button:focus { + outline: #ffbf47 solid 4px; + outline-offset: 0; +} + +.magna-header .js-mobile-button.ready { + display: block; +} - // burger menu/X icon - span { - position: absolute; - right: 10px; - top: 22px; +.magna-header .js-mobile-button .burger-icon { + background-color: #ffffff; + -webkit-transition: all 0.2s ease; + transition: all 0.2s ease; + clear: right; + content: ""; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; + position: absolute; + right: 10px; + top: 22px; + -webkit-transition: background-color 0.2s ease; + transition: background-color 0.2s ease; + background-color: transparent; +} + +.magna-header .js-mobile-button .burger-icon:before { + background-color: #ffffff; + -webkit-transition: all 0.2s ease; + transition: all 0.2s ease; + clear: right; + content: ""; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; + margin-top: -6px; +} + +.magna-header .js-mobile-button .burger-icon:after { + background-color: #ffffff; + -webkit-transition: all 0.2s ease; + transition: all 0.2s ease; + clear: right; + content: ""; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; +} + +.magna-header .js-mobile-button .burger-icon:focus { + outline: #ffbf47 solid 4px; + outline-offset: 0; +} + +.magna-header .js-mobile-button.expanded { + background-color: #006ccc; + z-index: 1; +} + +.magna-header .js-mobile-button.expanded .burger-icon { + background-color: transparent; +} + +.magna-header .js-mobile-button.expanded .burger-icon:before, +.magna-header .js-mobile-button.expanded .burger-icon:after { + width: 25px; + margin-right: -3px; +} + +.magna-header .js-mobile-button.expanded .burger-icon:before { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + margin-top: 0; +} + +.magna-header .js-mobile-button.expanded .burger-icon:after { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + margin-top: -12px; +} + +@media (min-width: 768px) { + .magna-header .js-mobile-button { + height: 40px; + padding-top: 5px; + padding-bottom: 5px; + top: 60px; + } + + .magna-header .js-mobile-button .burger-icon { + top: 18px; + } +} + +@media (min-width: 768px) { + .magna-header .js-mobile-button.mobile-only { + display: none; + } +} + +.magna-header .user-greeting { + background: #006ccc; + color: #fff; + display: none; + font-family: Overpass, Arial, Helvetica, Verdana; + font-size: 20px; + padding: 15px 20px; +} + +@media (min-width: 768px) { + .magna-header.signed-in .great-header-search-wrapper form { + margin-right: 118px; + } +} + +.magna-header.signed-in#great-domestic-header .main-nav.desktop { + margin-right: 376px; +} + +.great-domestic-international-links a { + color: #666666; +} + +.great-domestic-international-links .active { + color: #1e1348; +} + +.great-domestic-international-links .active:after { + display: block; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 4px; + background-color: #b00d23; + content: ''; +} + +@media (max-width: 768px) { + .great-global-header { + height: auto; + } + + .great-global-header:after { + display: block; + content: ''; + clear: both; + } +} + +.great-header-logo { + height: 80px; + margin: 15px 0; +} + +.great-header-logo img { + height: 100%; +} + +@media (max-width: 768px) { + .great-header-logo { + height: 70px; + margin: 20px 0; + } +} + +@media (max-width: 420px) { + .great-header-logo { + height: 60px; + margin: 25px 0; + } +} + +.js-mobile-button { + display: none; +} + +@media (max-width: 768px) { + .js-mobile-button { + border: 0; + margin: 0; + width: auto; + overflow: visible; + background: transparent; + color: inherit; + cursor: pointer; + font: inherit; + line-height: normal; + -webkit-font-smoothing: inherit; + -moz-osx-font-smoothing: inherit; + -webkit-appearance: none; + height: 50px; + position: absolute; + top: 45px; + right: 0; + color: #ffffff; + background-color: #1e1348; + border: 2px solid #ffffff; + padding: 10px 45px 10px 10px; + cursor: pointer; + } + + .js-mobile-button:focus { + outline: #ffbf47 solid 4px; + outline-offset: 0; + } + + .js-mobile-button.ready { + display: block; + } + + .js-mobile-button .burger-icon { + background-color: #ffffff; + -webkit-transition: all .2s ease; + transition: all .2s ease; + clear: right; + content: ''; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; + position: absolute; + right: 10px; + top: 22px; + -webkit-transition: background-color .2s ease; + transition: background-color .2s ease; + background-color: transparent; + } + + .js-mobile-button .burger-icon:before { + background-color: #ffffff; + -webkit-transition: all .2s ease; + transition: all .2s ease; + clear: right; + content: ''; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; + margin-top: -6px; } - span, - span:after, - span:before { - background-color: $white; - transition: all .2s ease; - clear: right; - content: ''; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; + .js-mobile-button .burger-icon:after { + background-color: #ffffff; + -webkit-transition: all .2s ease; + transition: all .2s ease; + clear: right; + content: ''; + float: right; + height: 2px; + margin: 0 0 10px 10px; + width: 20px; } - span:before { - margin-top: -6px; + .js-mobile-button .burger-icon:focus { + outline: #ffbf47 solid 4px; + outline-offset: 0; } - &:focus { - @include focus; + .js-mobile-button.expanded { + background-color: #006ccc; } - } - .js-mobile-button.expanded { - background-color: $active-blue; + .js-mobile-button.expanded .burger-icon { + background-color: transparent; + } - span { - background-color: transparent; - transition: background-color .2s ease; + .js-mobile-button.expanded .burger-icon:before, + .js-mobile-button.expanded .burger-icon:after { + width: 25px; + margin-right: -3px; } - span:before, - span:after { - transition: all .2s ease; - width: 25px; - margin-right: -3px; + .js-mobile-button.expanded .burger-icon:before { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + margin-top: 0; } - span:before { - transform: rotate(45deg); - margin-top: 0; + .js-mobile-button.expanded .burger-icon:after { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + margin-top: -12px; } +} + +#great-domestic-header .account-link { + color: #dfd5c5; + text-decoration: none; +} + +#great-domestic-header .main-nav.desktop { + margin-right: 280px; +} + +#great-international-header .menu-item.active .link-heading:after { + display: block; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 4px; + background-color: #ffffff; + content: ''; +} - span:after { - transform: rotate(-45deg); - margin-top: -12px; +#great-international-header .sub-nav, +.great-sub-header .sub-nav { + max-width: 1200px; + margin: 0 auto; +} + +@media (max-width: 1260px) { + + #great-international-header .sub-nav, + .great-sub-header .sub-nav { + margin: 0 30px; } - } } @media (max-width: 420px) { - .great-header-nav .js-nav-list { - margin: 0 20px; - } - .great-header-menu { - .js-mobile-button, - .great-header-extra-links { - right: 20px; + #great-international-header .sub-nav, + .great-sub-header .sub-nav { + margin: 0 20px; + } +} + +#great-international-header .sub-nav-list, +.great-sub-header .sub-nav-list { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +#great-international-header .sub-nav-list .menu-item.active .link-heading:after, +.great-sub-header .sub-nav-list .menu-item.active .link-heading:after { + display: block; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 4px; + background-color: #ffffff; + content: ''; +} + +#great-international-header .sub-nav-mobile-list, +.great-sub-header .sub-nav-mobile-list { + margin-left: 30px; +} + +#great-international-header .sub-nav-mobile-list .link-heading, +.great-sub-header .sub-nav-mobile-list .link-heading { + padding: 7.5px; +} + +@media (hover: hover) { + + #great-international-header .link-heading:hover, + .great-sub-header .link-heading:hover { + text-decoration: underline; + } +} + +@media (max-width: 768px) { + + #great-international-header .link-heading, + .great-sub-header .link-heading { + padding: 10px 0; + text-decoration: none; + } + + #great-international-header .link-heading:last-child, + .great-sub-header .link-heading:last-child { + margin-bottom: 15px; + } +} + +.great-sub-header { + background-color: #00549f; +} + +@media (max-width: 768px) { + .great-sub-header { + display: none; } - } } diff --git a/app/assets/stylesheets/export-components/header-footer/_magna-base.scss b/app/assets/stylesheets/export-components/header-footer/_magna-base.scss deleted file mode 100644 index 7ab1e2aab..000000000 --- a/app/assets/stylesheets/export-components/header-footer/_magna-base.scss +++ /dev/null @@ -1,10 +0,0 @@ - -// GREAT HEADER & FOOTER V2 -// DOMESTIC & INTERNATIONAL -// ========================= - -@import 'common'; -@import 'magna-header'; -@import 'magna-mobile-header'; -@import 'magna-search'; -@import 'footer'; diff --git a/app/assets/stylesheets/export-components/header-footer/_magna-header.scss b/app/assets/stylesheets/export-components/header-footer/_magna-header.scss deleted file mode 100644 index a3425607f..000000000 --- a/app/assets/stylesheets/export-components/header-footer/_magna-header.scss +++ /dev/null @@ -1,229 +0,0 @@ -@import '../partials/magna-mixins'; -@import '../partials/magna-colours'; - -@mixin burger-icon-line { - background-color: $white; - transition: all 0.2s ease; - clear: right; - content: ''; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; -} - -.magna-header { - &.great-header { - &.expanded { - &:before { - content: ''; - background: rgba(0, 0, 0, 0.5); - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1; - } - - .user-greeting { - display: block; - } - } - - &.signed-out { - .main-nav.mobile.expanded { - @media (max-width: 768px) { - margin-top: -14px; - } - } - } - - &.signed-in { - .main-nav-container.mobile { - @media (max-width: 768px) { - margin-top: -14px; - } - } - } - - .js-mobile-button.expanded { - z-index: 1; - } - - .mobile-only { - display: none; - - @media (max-width: 768px) { - display: block; - } - } - - .main-nav-container.mobile { - display: block; - z-index: 1; - position: relative; - } - - .main-nav.mobile.expanded { - background: #4b426d; - // padding: 0 20px 0; - z-index: 1; - - @media (max-width: 768px) { - margin-top: 0; - position: absolute; - } - } - - .main-nav.mobile .nav-list li { - border-bottom: 1px solid #635a7f; - - &:last-child { - border-bottom: 0; - } - - a, - button { - background: none; - border: 0; - color: #fff; - font-family: Overpass, Arial, Helvetica, Verdana; - font-size: 18px; - letter-spacing: 0; - line-height: 16px; - padding: 20px 0; - font-weight: 100; - text-decoration: none; - - &.new:after { - background: #eb4f4d; - border-radius: 4px; - content: 'new'; - font-family: 'FS Lucas', Arial, Helvetica, Verdana; - font-size: 16px; - padding: 5px 12px; - font-weight: 700; - line-height: 20px; - position: absolute; - top: 13px; - right: 0; - display: inline-block; - } - } - } - } - - .js-mobile-button { - display: none; - - @include button-reset; - - height: 50px; - position: absolute; - top: 45px; - right: 0; - color: $white; - background-color: $great-blue; - border: 2px solid $white; - padding: 10px 45px 10px 10px; - cursor: pointer; - - &:focus { - @include focus; - } - - &.ready { - display: block; - } - - .burger-icon { - // The three burger lines are formed using the span, and its before and after. - @include burger-icon-line; - - position: absolute; - right: 10px; - top: 22px; - transition: background-color 0.2s ease; - background-color: transparent; - - &:before { - @include burger-icon-line; - margin-top: -6px; - } - - &:after { - @include burger-icon-line; - } - - &:focus { - @include focus; - } - } - - // When expanded, the icon changes to an 'X', by rotating the top and bottom lines, and removing the middle one. - &.expanded { - background-color: $active-blue; - z-index: 1; - - .burger-icon { - background-color: transparent; - - &:before, - &:after { - width: 25px; - margin-right: -3px; - } - - &:before { - transform: rotate(45deg); - margin-top: 0; - } - - &:after { - transform: rotate(-45deg); - margin-top: -12px; - } - } - } - - @media (min-width: 768px) { - height: 40px; - padding-top: 5px; - padding-bottom: 5px; - top: 60px; - - .burger-icon { - top: 18px; - } - } - - &.mobile-only { - - @media (min-width: 768px) { - display: none; - } - } - } - - .user-greeting { - background: #006ccc; - color: #fff; - display: none; - font-family: Overpass, Arial, Helvetica, Verdana; - font-size: 20px; - padding: 15px 20px; - } - - &.signed-in { - .great-header-search-wrapper form { - @media (min-width: 768px) { - margin-right: 118px; - } - } - - &#great-domestic-header .main-nav.desktop { - margin-right: 376px; - } - } -} diff --git a/app/assets/stylesheets/export-components/header-footer/_magna-js-mobile-header.scss b/app/assets/stylesheets/export-components/header-footer/_magna-js-mobile-header.scss deleted file mode 100644 index e946d3a26..000000000 --- a/app/assets/stylesheets/export-components/header-footer/_magna-js-mobile-header.scss +++ /dev/null @@ -1,742 +0,0 @@ -.great-header, -.great-sub-header { - position: relative; - z-index: 5; -} - -.great-header:focus-within, -.great-sub-header:focus-within { - z-index: 6; -} - -.great-header a:focus, -.great-sub-header a:focus { - outline: #ffbf47 solid 4px; - outline-offset: 0; -} - -.great-header a:focus:active, -.great-sub-header a:focus:active { - background-color: #ffbf47; - color: #1e1348; -} - -.great-header .menu, -.great-sub-header .menu { - background-color: #1e1348; - position: relative; -} - -.great-header .menu .container, -.great-sub-header .menu .container { - max-width: 1200px; - margin: 0 auto; - position: relative; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-line-pack: center; - align-content: center; - padding: 0; -} - -@media (max-width: 1260px) { - - .great-header .menu .container, - .great-sub-header .menu .container { - margin: 0 30px; - } -} - -@media (max-width: 420px) { - - .great-header .menu .container, - .great-sub-header .menu .container { - margin: 0 20px; - } -} - -.great-header .extra-links, -.great-sub-header .extra-links { - font-size: 14px; - color: #ffffff; - position: absolute; - top: 25px; - right: 0; - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} - -@media (max-width: 768px) { - - .great-header .extra-links, - .great-sub-header .extra-links { - top: 10px; - } -} - -.great-header .extra-links li:last-child, -.great-sub-header .extra-links li:last-child { - margin-left: 10px; -} - -.great-header .main-nav-container.mobile, -.great-sub-header .main-nav-container.mobile { - display: none; - margin: 0; -} - -@media (max-width: 768px) { - - .great-header .main-nav-container.mobile, - .great-sub-header .main-nav-container.mobile { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - } -} - -.great-header .main-nav-container.desktop, -.great-sub-header .main-nav-container.desktop { - background-color: transparent; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -ms-flex-item-align: end; - align-self: flex-end; -} - -@media (max-width: 768px) { - - .great-header .main-nav-container.desktop, - .great-sub-header .main-nav-container.desktop { - display: none; - } -} - -@media (max-width: 1260px) { - - .great-header .main-nav-container.desktop, - .great-sub-header .main-nav-container.desktop { - margin-left: 30px; - } -} - -.great-header .main-nav.mobile, -.great-sub-header .main-nav.mobile { - display: none; - -webkit-transition: all .2s ease; - transition: all .2s ease; - background-color: #3b3458; - margin: 0; - width: 100%; - opacity: 0; - overflow: hidden; -} - -.great-header .main-nav.mobile.expanded, -.great-sub-header .main-nav.mobile.expanded { - opacity: 1; - display: block; -} - -.great-header .main-nav.mobile .nav-list, -.great-sub-header .main-nav.mobile .nav-list { - margin: 4px 30px; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; -} - -.great-header .main-nav.desktop, -.great-sub-header .main-nav.desktop { - max-width: 1200px; -} - -.great-header .nav-list, -.great-sub-header .nav-list { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - position: relative; -} - -@media (max-width: 420px) { - - .great-header .nav-list, - .great-sub-header .nav-list { - margin: 4px 20px; - } -} - -.great-header .menu-item, -.great-sub-header .menu-item { - width: auto; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; - line-height: 1; -} - -.great-header .link-heading, -.great-sub-header .link-heading { - color: #ffffff; - font-family: inherit; - display: block; - font-size: 16px; - line-height: 30px; - padding: 15px; - text-decoration: none; - position: relative; -} - -.great-header .link-heading:hover, -.great-sub-header .link-heading:hover { - text-decoration: underline; -} - -@media (max-width: 768px) { - - .great-header .link-heading, - .great-sub-header .link-heading { - text-decoration: underline; - padding: 15px 0; - margin: 0; - line-height: 1; - } -} - -.magna-header.great-header.expanded:before { - content: ""; - background: rgba(0, 0, 0, 0.5); - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1; -} - -.magna-header.great-header.expanded .user-greeting { - display: block; -} - -@media (max-width: 768px) { - .magna-header.great-header.signed-out .main-nav.mobile.expanded { - margin-top: -14px; - } -} - -@media (max-width: 768px) { - .magna-header.great-header.signed-in .main-nav-container.mobile { - margin-top: -14px; - } -} - -.magna-header.great-header .js-mobile-button.expanded { - z-index: 1; -} - -.magna-header.great-header .mobile-only { - display: none; -} - -@media (max-width: 768px) { - .magna-header.great-header .mobile-only { - display: block; - } -} - -.magna-header.great-header .main-nav-container.mobile { - display: block; - z-index: 1; - position: relative; -} - -.magna-header.great-header .main-nav.mobile.expanded { - background: #4b426d; - // padding: 0 20px; - z-index: 1; -} - -@media (max-width: 768px) { - .magna-header.great-header .main-nav.mobile.expanded { - margin-top: 0; - position: absolute; - } -} - -.magna-header.great-header .main-nav.mobile .nav-list li { - border-bottom: 1px solid #635a7f; -} - -.magna-header.great-header .main-nav.mobile .nav-list li:last-child { - border-bottom: 0; -} - -.magna-header.great-header .main-nav.mobile .nav-list li a, -.magna-header.great-header .main-nav.mobile .nav-list li button { - background: none; - border: 0; - color: #fff; - font-family: Overpass, Arial, Helvetica, Verdana; - font-size: 18px; - letter-spacing: 0; - line-height: 16px; - padding: 20px 0; - font-weight: 100; - text-decoration: none; -} - -.magna-header.great-header .main-nav.mobile .nav-list li a.new:after, -.magna-header.great-header .main-nav.mobile .nav-list li button.new:after { - background: #eb4f4d; - border-radius: 4px; - content: "new"; - font-family: 'FS Lucas', Arial, Helvetica, Verdana; - font-size: 16px; - padding: 5px 12px; - font-weight: 700; - line-height: 20px; - position: absolute; - top: 13px; - right: 0; - display: inline-block; -} - -.magna-header .js-mobile-button { - display: none; - border: 0; - margin: 0; - width: auto; - overflow: visible; - background: transparent; - color: inherit; - cursor: pointer; - font: inherit; - line-height: normal; - -webkit-font-smoothing: inherit; - -moz-osx-font-smoothing: inherit; - -webkit-appearance: none; - height: 50px; - position: absolute; - top: 45px; - right: 0; - color: #ffffff; - background-color: #1e1348; - border: 2px solid #ffffff; - padding: 10px 45px 10px 10px; - cursor: pointer; -} - -.magna-header .js-mobile-button:focus { - outline: #ffbf47 solid 4px; - outline-offset: 0; -} - -.magna-header .js-mobile-button.ready { - display: block; -} - -.magna-header .js-mobile-button .burger-icon { - background-color: #ffffff; - -webkit-transition: all 0.2s ease; - transition: all 0.2s ease; - clear: right; - content: ""; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; - position: absolute; - right: 10px; - top: 22px; - -webkit-transition: background-color 0.2s ease; - transition: background-color 0.2s ease; - background-color: transparent; -} - -.magna-header .js-mobile-button .burger-icon:before { - background-color: #ffffff; - -webkit-transition: all 0.2s ease; - transition: all 0.2s ease; - clear: right; - content: ""; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; - margin-top: -6px; -} - -.magna-header .js-mobile-button .burger-icon:after { - background-color: #ffffff; - -webkit-transition: all 0.2s ease; - transition: all 0.2s ease; - clear: right; - content: ""; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; -} - -.magna-header .js-mobile-button .burger-icon:focus { - outline: #ffbf47 solid 4px; - outline-offset: 0; -} - -.magna-header .js-mobile-button.expanded { - background-color: #006ccc; - z-index: 1; -} - -.magna-header .js-mobile-button.expanded .burger-icon { - background-color: transparent; -} - -.magna-header .js-mobile-button.expanded .burger-icon:before, -.magna-header .js-mobile-button.expanded .burger-icon:after { - width: 25px; - margin-right: -3px; -} - -.magna-header .js-mobile-button.expanded .burger-icon:before { - -webkit-transform: rotate(45deg); - transform: rotate(45deg); - margin-top: 0; -} - -.magna-header .js-mobile-button.expanded .burger-icon:after { - -webkit-transform: rotate(-45deg); - transform: rotate(-45deg); - margin-top: -12px; -} - -@media (min-width: 768px) { - .magna-header .js-mobile-button { - height: 40px; - padding-top: 5px; - padding-bottom: 5px; - top: 60px; - } - - .magna-header .js-mobile-button .burger-icon { - top: 18px; - } -} - -@media (min-width: 768px) { - .magna-header .js-mobile-button.mobile-only { - display: none; - } -} - -.magna-header .user-greeting { - background: #006ccc; - color: #fff; - display: none; - font-family: Overpass, Arial, Helvetica, Verdana; - font-size: 20px; - padding: 15px 20px; -} - -@media (min-width: 768px) { - .magna-header.signed-in .great-header-search-wrapper form { - margin-right: 118px; - } -} - -.magna-header.signed-in#great-domestic-header .main-nav.desktop { - margin-right: 376px; -} - -.great-domestic-international-links a { - color: #666666; -} - -.great-domestic-international-links .active { - color: #1e1348; -} - -.great-domestic-international-links .active:after { - display: block; - position: absolute; - left: 0; - bottom: 0; - width: 100%; - height: 4px; - background-color: #b00d23; - content: ''; -} - -@media (max-width: 768px) { - .great-global-header { - height: auto; - } - - .great-global-header:after { - display: block; - content: ''; - clear: both; - } -} - -.great-header-logo { - height: 80px; - margin: 15px 0; -} - -.great-header-logo img { - height: 100%; -} - -@media (max-width: 768px) { - .great-header-logo { - height: 70px; - margin: 20px 0; - } -} - -@media (max-width: 420px) { - .great-header-logo { - height: 60px; - margin: 25px 0; - } -} - -.js-mobile-button { - display: none; -} - -@media (max-width: 768px) { - .js-mobile-button { - border: 0; - margin: 0; - width: auto; - overflow: visible; - background: transparent; - color: inherit; - cursor: pointer; - font: inherit; - line-height: normal; - -webkit-font-smoothing: inherit; - -moz-osx-font-smoothing: inherit; - -webkit-appearance: none; - height: 50px; - position: absolute; - top: 45px; - right: 0; - color: #ffffff; - background-color: #1e1348; - border: 2px solid #ffffff; - padding: 10px 45px 10px 10px; - cursor: pointer; - } - - .js-mobile-button:focus { - outline: #ffbf47 solid 4px; - outline-offset: 0; - } - - .js-mobile-button.ready { - display: block; - } - - .js-mobile-button .burger-icon { - background-color: #ffffff; - -webkit-transition: all .2s ease; - transition: all .2s ease; - clear: right; - content: ''; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; - position: absolute; - right: 10px; - top: 22px; - -webkit-transition: background-color .2s ease; - transition: background-color .2s ease; - background-color: transparent; - } - - .js-mobile-button .burger-icon:before { - background-color: #ffffff; - -webkit-transition: all .2s ease; - transition: all .2s ease; - clear: right; - content: ''; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; - margin-top: -6px; - } - - .js-mobile-button .burger-icon:after { - background-color: #ffffff; - -webkit-transition: all .2s ease; - transition: all .2s ease; - clear: right; - content: ''; - float: right; - height: 2px; - margin: 0 0 10px 10px; - width: 20px; - } - - .js-mobile-button .burger-icon:focus { - outline: #ffbf47 solid 4px; - outline-offset: 0; - } - - .js-mobile-button.expanded { - background-color: #006ccc; - } - - .js-mobile-button.expanded .burger-icon { - background-color: transparent; - } - - .js-mobile-button.expanded .burger-icon:before, - .js-mobile-button.expanded .burger-icon:after { - width: 25px; - margin-right: -3px; - } - - .js-mobile-button.expanded .burger-icon:before { - -webkit-transform: rotate(45deg); - transform: rotate(45deg); - margin-top: 0; - } - - .js-mobile-button.expanded .burger-icon:after { - -webkit-transform: rotate(-45deg); - transform: rotate(-45deg); - margin-top: -12px; - } -} - -#great-domestic-header .account-link { - color: #dfd5c5; - text-decoration: none; -} - -#great-domestic-header .main-nav.desktop { - margin-right: 280px; -} - -#great-international-header .menu-item.active .link-heading:after { - display: block; - position: absolute; - left: 0; - bottom: 0; - width: 100%; - height: 4px; - background-color: #ffffff; - content: ''; -} - -#great-international-header .sub-nav, -.great-sub-header .sub-nav { - max-width: 1200px; - margin: 0 auto; -} - -@media (max-width: 1260px) { - - #great-international-header .sub-nav, - .great-sub-header .sub-nav { - margin: 0 30px; - } -} - -@media (max-width: 420px) { - - #great-international-header .sub-nav, - .great-sub-header .sub-nav { - margin: 0 20px; - } -} - -#great-international-header .sub-nav-list, -.great-sub-header .sub-nav-list { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - -ms-flex-wrap: wrap; - flex-wrap: wrap; -} - -#great-international-header .sub-nav-list .menu-item.active .link-heading:after, -.great-sub-header .sub-nav-list .menu-item.active .link-heading:after { - display: block; - position: absolute; - left: 0; - bottom: 0; - width: 100%; - height: 4px; - background-color: #ffffff; - content: ''; -} - -#great-international-header .sub-nav-mobile-list, -.great-sub-header .sub-nav-mobile-list { - margin-left: 30px; -} - -#great-international-header .sub-nav-mobile-list .link-heading, -.great-sub-header .sub-nav-mobile-list .link-heading { - padding: 7.5px; -} - -@media (hover: hover) { - - #great-international-header .link-heading:hover, - .great-sub-header .link-heading:hover { - text-decoration: underline; - } -} - -@media (max-width: 768px) { - - #great-international-header .link-heading, - .great-sub-header .link-heading { - padding: 10px 0; - text-decoration: none; - } - - #great-international-header .link-heading:last-child, - .great-sub-header .link-heading:last-child { - margin-bottom: 15px; - } -} - -.great-sub-header { - background-color: #00549f; -} - -@media (max-width: 768px) { - .great-sub-header { - display: none; - } -} diff --git a/app/assets/stylesheets/export-components/header-footer/_magna-mobile-header.scss b/app/assets/stylesheets/export-components/header-footer/_magna-mobile-header.scss deleted file mode 100644 index 1a51b04a5..000000000 --- a/app/assets/stylesheets/export-components/header-footer/_magna-mobile-header.scss +++ /dev/null @@ -1,15 +0,0 @@ -// MOBILE VIEW -// ============ -// JS disabled styling -@media (max-width: 768px) { - .great-header-nav { - .link-heading { - margin-top: .5em; - } - } -} - -// JS enabled styling -body.js-enabled { - @import 'magna-js-mobile-header'; -} diff --git a/app/assets/stylesheets/export-components/header-footer/_magna-search.scss b/app/assets/stylesheets/export-components/header-footer/_magna-search.scss deleted file mode 100644 index c22633036..000000000 --- a/app/assets/stylesheets/export-components/header-footer/_magna-search.scss +++ /dev/null @@ -1,99 +0,0 @@ - -// SEARCH COMPONENT -// ================= - -@import '../partials/magna-colours'; -@import '../partials/magna-typography'; -@import '../partials/magna-mixins'; - -.great-header-search-wrapper { - width: 100%; - background: transparent; - - @media (max-width: 768px) { - &.hidden { - display: none; - } - } - - form { - width: 240px; - float: right; - margin-left: 15px; - margin-top: -58px; - padding: 8px 0; - - & > * { - float: left; - } - - input { - height: 40px; - width: 200px; - font-family: $brand-font-alternative; - padding: 0 15px; - border: 0; - } - - button { - @include button-reset; - color: $white; - border: 0; - font-size: 0; // hide button text visually but not for screenreaders - height: 40px; - width: 40px; - background-repeat: no-repeat; - background-position: 50%; - background-color: $active-blue; - background-image: asset-url('search.svg'); - background-size: 20px; - padding: 0; - - &:focus, - &:focus:active { - @include focus; - } - - &:active { - background-color: $focus-yellow; - } - - } - } -} - -.great-header-search-container { - @include float-clear; - margin: 0 auto; - max-width: 1200px; -} - -@media (max-width: 768px) { - .great-header { - .great-header-search-wrapper form { - width: 100%; - margin-left: 0; - margin-top: 0; - padding-top: 20px; - padding-bottom: 20px; - - input { - width: calc(100% - 40px); - } - } - } - - .js-enabled { - .great-header { - .great-header-search-wrapper form { - padding-top: 0; - } - } - } -} - -@media (max-width: 420px) { - .great-header-search-container { - margin: 0 20px; - } -} diff --git a/app/assets/stylesheets/export-components/header-footer/_mobile-header.scss b/app/assets/stylesheets/export-components/header-footer/_mobile-header.scss index 988cbe48e..9a5a42583 100644 --- a/app/assets/stylesheets/export-components/header-footer/_mobile-header.scss +++ b/app/assets/stylesheets/export-components/header-footer/_mobile-header.scss @@ -1,17 +1,15 @@ - // MOBILE VIEW // ============ - // JS disabled styling @media (max-width: 768px) { - .great-header-nav { - .link-heading { - margin-top: .5em; + .great-header-nav { + .link-heading { + margin-top: .5em; + } } - } } // JS enabled styling body.js-enabled { - @import 'js-mobile-header'; + @import 'js-mobile-header'; } diff --git a/app/assets/stylesheets/export-components/header-footer/_search.scss b/app/assets/stylesheets/export-components/header-footer/_search.scss index 3b6bbad2d..1614dd2fd 100644 --- a/app/assets/stylesheets/export-components/header-footer/_search.scss +++ b/app/assets/stylesheets/export-components/header-footer/_search.scss @@ -2,14 +2,26 @@ // SEARCH COMPONENT // ================= -// base styling. JS disabled +@import '../partials/colours'; +@import '../partials/typography'; +@import '../partials/mixins'; .great-header-search-wrapper { width: 100%; - background-color: $white; + background: transparent; + + @media (max-width: 768px) { + &.hidden { + display: none; + } + } form { + width: 240px; float: right; + margin-left: 15px; + margin-top: -58px; + padding: 8px 0; & > * { float: left; @@ -19,11 +31,8 @@ height: 40px; width: 200px; font-family: $brand-font-alternative; - font-size: 16px; padding: 0 15px; - border-left: 2px solid $black; - border-top: 2px solid $black; - border-bottom: 2px solid $black; + border: 0; } button { @@ -36,7 +45,7 @@ background-repeat: no-repeat; background-position: 50%; background-color: $active-blue; - background-image: asset-url('search-icon.svg'); + background-image: asset-url('search.svg'); background-size: 20px; padding: 0; @@ -59,100 +68,30 @@ max-width: 1200px; } -// JS enabled - -body.js-enabled { - - .great-header-search-wrapper { - @include float-clear; - background: transparent; - - form { - width: 240px; - float: right; - margin-left: 15px; - margin-top: -58px; - padding: 8px 0; +@media (max-width: 768px) { + .great-header { + .great-header-search-wrapper form { + width: 100%; + margin-left: 0; + margin-top: 0; + padding-top: 20px; + padding-bottom: 20px; input { - border: 0; - } - } - } -} - -@media (max-width: 1260px) { - .great-header-search-container { - margin: 0 30px; - } -} - -@media (max-width: 900px) { - body.js-enabled { - .great-header.domestic { - .great-header-menu > .container { - padding-bottom: 0; - } - - .great-header-nav { - float: none; - margin-right: 0; - margin-top: 0; - } - - .great-header-nav.domestic .js-menu-control.expanded:after { - top: 145px; + width: calc(100% - 40px); } } } - .great-header-search-container { - margin: 0 30px; - } -} - -@media (max-width: 768px) { - body.js-enabled { - .great-header.domestic { - .great-header-menu > .container { - padding-bottom: 20px; - } - - .great-header-nav { - margin-right: 0; - } - - &.menu-expanded { - .great-header-search-wrapper { - display: none; - } - } - + .js-enabled { + .great-header { .great-header-search-wrapper form { - width: 100%; - margin-left: 0; - margin-top: 0; padding-top: 0; - padding-bottom: 20px; - - input { - width: calc(100% - 40px); - } } } } } -@media (max-width: 640px) { - .great-header-search-container { - margin: 0 20px; - } - - .great-header-search-wrapper form { - float: none; - } -} - @media (max-width: 420px) { .great-header-search-container { margin: 0 20px; diff --git a/app/assets/stylesheets/export-components/magna-main.scss b/app/assets/stylesheets/export-components/magna-main.scss deleted file mode 100644 index 1d6c23092..000000000 --- a/app/assets/stylesheets/export-components/magna-main.scss +++ /dev/null @@ -1,87 +0,0 @@ - -// These files are copied from directory-components -// and should not be edited here directly - -@import 'partials/magna-colours'; -@import 'partials/magna-mixins'; - -// Components - -@import 'header-footer/magna-base'; -@import 'cookie-notice/base'; -@import 'skip-link/base'; - -// Overrides/fixes - -@media (min-width: 768px) { - .great-header-search-wrapper.hidden { - overflow: unset; - position: unset; - text-indent: unset; - z-index: unset; - } -} - -@media (max-width: 768px) { - .main-nav .button { - margin: 15px 20px; - } -} - -.great-header-search-wrapper { - padding: 15px 0; -} - -body.js-enabled { - .great-header-search-wrapper { - padding: 0; - - form { - margin-bottom: 0; - } - } - - .great-header-nav .js-menu-control { - &.collapsed .link-heading:after { - top: 0; - } - - &.expanded .link-heading:after { - top: 3px; - } - } - - .great-header-nav .js-collapsible-menu a { - padding: 5px 0; - } -} - -.great-header, -.great-footer { - - ul { - margin: 0; - - li { - list-style: none; - padding-left: 0; - - &:before { - display: none; - } - } - } -} - -.great-header-nav-list { - @include float-clear; - margin: 0 -15px; -} - -@media (min-width: 641px) { - .column-quarter { - float: left; - width: 25%; - padding: 0 15px; - } -} diff --git a/app/assets/stylesheets/export-components/main.scss b/app/assets/stylesheets/export-components/main.scss index 5558b2e4b..472db5331 100644 --- a/app/assets/stylesheets/export-components/main.scss +++ b/app/assets/stylesheets/export-components/main.scss @@ -13,6 +13,21 @@ // Overrides/fixes +@media (min-width: 768px) { + .great-header-search-wrapper.hidden { + overflow: unset; + position: unset; + text-indent: unset; + z-index: unset; + } +} + +@media (max-width: 768px) { + .main-nav .button { + margin: 15px 20px; + } +} + .great-header-search-wrapper { padding: 15px 0; } diff --git a/app/assets/stylesheets/export-components/partials/_colours.scss b/app/assets/stylesheets/export-components/partials/_colours.scss index b856bee2a..ec77fdd7b 100644 --- a/app/assets/stylesheets/export-components/partials/_colours.scss +++ b/app/assets/stylesheets/export-components/partials/_colours.scss @@ -16,22 +16,22 @@ $offwhite: #fafafa; // rgb(220, 224, 223) $white: #ffffff; // rgb(255, 255, 255) // Blue -$active-blue: #006ccc; // rgb( 0, 108, 204) -$active-blue-alt: #328dc2; // rgb( 50, 141, 194) +$active-blue: #006ccc; // rgb(0, 108, 204) +$active-blue-alt: #328dc2; // rgb(50, 141, 194) $active-blue-disabled: #9bc6e9; // rgb(155, 198, 233) -$dark-blue: #132965; // rgb( 19, 41, 101) -$dark-navy: #160d37; // rgb( 22, 13, 55) -$great-blue: #1e1348; // rgb( 30, 19, 72) -$lightened-great-blue: #3b3458; // only used in footer -$mid-blue: #00549f; // rgb( 0, 84, 159) -$hero-blue: rgba(0,82,157,0.8); -$aqua: #007ea3; // rgb( 0, 126, 163) -$teal: #00A699; +$dark-blue: #132965; // rgb(19, 41, 101) +$dark-navy: #160d37; // rgb(22, 13, 55) +$great-blue: #1e1348; // rgb(30, 19, 72) +$lightened-great-blue: #3b3458; +$mid-blue: #00549f; // rgb(0, 84, 159) +$hero-blue: rgba(0, 82, 157, 0.8); +$aqua: #007ea3; // rgb(0, 126, 163) +$teal: #00a699; $light-blue: #2b8cc4; // from govuk elements $light-aqua: #8ae2fb; // rgb(138, 226, 251) // Other -$black: #000000; // rgb( 0, 0, 0) +$black: #000000; // rgb(0, 0, 0) $focus-yellow: #ffbf47; // rgb(255, 191, 71) $purple: #4f0b7b; // rgb( 79, 11, 123) diff --git a/app/assets/stylesheets/export-components/partials/_magna-colours.scss b/app/assets/stylesheets/export-components/partials/_magna-colours.scss deleted file mode 100644 index ec77fdd7b..000000000 --- a/app/assets/stylesheets/export-components/partials/_magna-colours.scss +++ /dev/null @@ -1,51 +0,0 @@ -// DIT colour palette - -// Red -$flag-red: #b00d23; // rgb(176, 13, 35) -$great-red: #e41f13; // rgb(228, 31, 19) -$great-red-alt: #ef5f56; // rgb(239, 95, 86) - -// Grey -$light-grey: #d8d8d8; // rgb(216, 216, 216) -$mid-grey: #666666; -$grey: #333333; // rgb( 51, 51, 51) - - -// White -$offwhite: #fafafa; // rgb(220, 224, 223) -$white: #ffffff; // rgb(255, 255, 255) - -// Blue -$active-blue: #006ccc; // rgb(0, 108, 204) -$active-blue-alt: #328dc2; // rgb(50, 141, 194) -$active-blue-disabled: #9bc6e9; // rgb(155, 198, 233) -$dark-blue: #132965; // rgb(19, 41, 101) -$dark-navy: #160d37; // rgb(22, 13, 55) -$great-blue: #1e1348; // rgb(30, 19, 72) -$lightened-great-blue: #3b3458; -$mid-blue: #00549f; // rgb(0, 84, 159) -$hero-blue: rgba(0, 82, 157, 0.8); -$aqua: #007ea3; // rgb(0, 126, 163) -$teal: #00a699; -$light-blue: #2b8cc4; // from govuk elements -$light-aqua: #8ae2fb; // rgb(138, 226, 251) - -// Other -$black: #000000; // rgb(0, 0, 0) -$focus-yellow: #ffbf47; // rgb(255, 191, 71) -$purple: #4f0b7b; // rgb( 79, 11, 123) - -// Stone -$stone: #dfd5c5; // rgb(223, 213, 197) -$stone-90: #e2d9cb; -$stone-80: #e5ddd1; -$stone-70: #e9e2d6; -$stone-60: #ece6dc; -$stone-50: #efeae2; -$stone-40: #f2eee8; -$stone-30: #f5f2ed; // rgb(245, 242, 237) -$stone-20: #fcfbf9; -$stone-10: #fdfdfc; - -$stone-light: #f5f2ed; // rgb(245, 242, 237) -$tap-highlight: rgba(0, 0, 0, 0.3); diff --git a/app/assets/stylesheets/export-components/partials/_magna-mixins.scss b/app/assets/stylesheets/export-components/partials/_magna-mixins.scss deleted file mode 100644 index 92f784ad6..000000000 --- a/app/assets/stylesheets/export-components/partials/_magna-mixins.scss +++ /dev/null @@ -1,238 +0,0 @@ - -// General mixins -// ---------------- - -@import 'magna-colours'; - -@mixin flag-red-underline { - &:after { - background-color: $flag-red; - content: ''; - height: 4px; - left: 0; - position: absolute; - width: 100%; - bottom: 0; - display: block; - } -} - -@mixin float-clear { - &:after { - display: block; - content: ''; - clear: both; - } -} - -@mixin great-red-trim { - background-color: $great-red; - content: ''; - height: 4px; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - -@mixin focus { - outline: $focus-yellow solid 4px; - outline-offset: 0; -} - -@mixin separator($colour) { - background-color: $colour; - content: ''; - display: inline-block; - height: 1em; - margin: 0 0.5em 0 0.3em; - width: 1px; - vertical-align: middle; -} - -@mixin rotate($deg) { - -ms-transform: rotate(#{$deg + 'deg'}); /* IE 9 */ - -webkit-transform: rotate(#{$deg + 'deg'}); - transform: rotate(#{$deg + 'deg'}); -} - -@mixin button-reset { - border: 0; - margin: 0; - width: auto; - overflow: visible; - background: transparent; - color: inherit; - cursor: pointer; - font: inherit; - line-height: normal; - -webkit-font-smoothing: inherit; - -moz-osx-font-smoothing: inherit; - -webkit-appearance: none; -} - -// BUTTONS -// prefixed with great- so they don't clash with govuk mixins -@mixin great-button($colour: $active-blue) { - @include button-reset; - font-size: 19px; - text-align: center; - display: inline-block; - font-weight: 700; - font-family: $brand-font; - background-color: $colour; - color: $white; - padding: 10px 30px; - text-decoration: none; - line-height: 30px; - - &:focus:active, - &:active { - color: $black; - background-color: $focus-yellow; - } - - &:focus { - @include focus; - } - - &:hover { - background-color: darken($colour, 5); - } - - &:after { - line-height: 50px; - } - - @media (max-width: 640px) { - width: 100%; - margin-bottom: 15px; - text-align: center; - } -} - -@mixin great-button-ghost($colour: $button-colour) { - @include great-button; - background-color: transparent; - border: 2px solid $colour; - color: $colour; - - &:hover, - &:focus { - background-color: $colour; - } - - &:focus { - @include focus; - } - - &:focus:active, - &:active { - color: $black; - background-color: $focus-yellow; - border-color: $focus-yellow; - } - - @if ($colour == $white) { - - &:focus, - &:hover { - color: $black; - background-color: $white; - } - - } @else { - - &:focus, - &:hover { - color: $white; - } - - &:focus:active { - color: $black; - } - - } -} - - -// CHEVRONS - -@mixin chevron($rotate, $colour) { - box-sizing: initial; - -ms-transform: rotate($rotate); - /* IE 9 */ - -webkit-transform: rotate($rotate); - transform: rotate($rotate); - content: ''; - border-style: solid; - display: inline-block; - height: 5px; - width: 5px; - position: relative; - vertical-align: top; - top: 1px; - border-color: $colour; - border-width: 0 2px 2px 0; - margin: 2px 0 0 10px; -} - -@mixin down-chevron-1($colour) { - @include chevron(45deg, $colour); - border-color: $colour; - border-width: 0 2px 2px 0; - top: 1px; -} - -@mixin left-chevron-1($colour) { - @include chevron(45deg, $colour); - border-color: $colour; - border-width: 0 0 2px 2px; - top: 0; -} - -@mixin right-chevron-1($colour) { - @include chevron(45deg, $colour); - border-color: $colour; - border-width: 2px 2px 0 0; - top: 0; -} - -@mixin right-chevron-2($colour) { - @include chevron(45deg, $colour); - vertical-align: middle; - border-color: $colour; - border-width: 2px 2px 0 0; - margin: 0 5px; - top: 0; -} - -@mixin up-chevron-1($colour) { - @include chevron(45deg, $colour); - border-color: $colour; - border-width: 2px 0 0 2px; - top: 5px; -} - -@mixin container { - position: relative; - - &:after { - max-width: 1200px; - display: block; - content: ''; - margin: 0 auto; - left: 0; - right: 0; - bottom: 0; - position: absolute; - - @media(max-width: 1260px) { - margin: 0 30px; - } - - @media(max-width: 420px) { - margin: 0 20px; - } - } -} diff --git a/app/assets/stylesheets/export-components/partials/_magna-typography.scss b/app/assets/stylesheets/export-components/partials/_magna-typography.scss deleted file mode 100644 index bc567558a..000000000 --- a/app/assets/stylesheets/export-components/partials/_magna-typography.scss +++ /dev/null @@ -1,85 +0,0 @@ - - -// Great specific fonts -$brand-font: 'Overpass', 'Roboto', arial, helvetica, verdana; -$brand-font-alternative: 'Roboto', arial, helvetica, verdana; -$quote-font: 'Georgia', serif; -$line-height: 1.6; -$hero-line-height: 1.2; - - -@mixin font-generator($font-family: $brand-font-alternative, $font-size: 19px, $font-size-mobile: 16px, $font-weight: 400, $font-style: normal, $line-height: 1.6) { - font-weight: $font-weight; - font-size: $font-size-mobile; - font-family: $font-family; - font-style: $font-style; - line-height: $line-height; - - @media (min-width: 641px) { - font-size: $font-size; - } -} - -@mixin body-xlarge { - @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6) -} - -@mixin body-large { - @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6) -} - -@mixin body-medium { - @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6) -} - -@mixin body-small { - @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6) -} - -@mixin quote-xlarge { - @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6) -} - -@mixin quote-large { - @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6) -} - -@mixin quote-medium { - @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6) -} - -@mixin quote-small { - @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6) -} - -@mixin body-xlarge-bold { - @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6, $font-weight: 700) -} - -@mixin body-large-bold { - @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6, $font-weight: 700) -} - -@mixin body-medium-bold { - @include font-generator($font-size: 19px, $font-size-mobile: 16px, $font-weight: 700, $line-height: 1.6) -} - -@mixin body-small-bold { - @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6, $font-weight: 700) -} - -@mixin brand-xxlarge { - @include font-generator($font-size: 48px, $font-size-mobile: 32px, $line-height: 1.2, $font-weight: 700, $font-family: $brand-font) -} - -@mixin brand-xlarge { - @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.4, $font-weight: 700, $font-family: $brand-font) -} - -@mixin brand-large { - @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6, $font-weight: 700, $font-family: $brand-font) -} - -@mixin brand-medium { - @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6, $font-weight: 700, $font-family: $brand-font) -} diff --git a/app/assets/stylesheets/export-components/partials/_mixins.scss b/app/assets/stylesheets/export-components/partials/_mixins.scss index b3e27d517..36c655882 100644 --- a/app/assets/stylesheets/export-components/partials/_mixins.scss +++ b/app/assets/stylesheets/export-components/partials/_mixins.scss @@ -36,7 +36,7 @@ } @mixin focus { - outline: $focus-yellow solid 3px; + outline: $focus-yellow solid 4px; outline-offset: 0; } @@ -76,7 +76,7 @@ @mixin great-button($colour: $active-blue) { @include button-reset; font-size: 19px; - white-space: nowrap; + text-align: center; display: inline-block; font-weight: 700; font-family: $brand-font; @@ -174,7 +174,7 @@ top: 1px; border-color: $colour; border-width: 0 2px 2px 0; - margin: 7px 0 0 10px; + margin: 2px 0 0 10px; } @mixin down-chevron-1($colour) { @@ -214,7 +214,7 @@ top: 5px; } -@mixin container() { +@mixin container { position: relative; &:after { @@ -236,18 +236,3 @@ } } } - -@mixin grid-column($width, $full-width: tablet, $float: left) { - - @include media($full-width) { - float: $float; - width: percentage($width); - } - - @include ie-lte(7) { - width: (($site-width + $gutter) * $width) - $gutter; - } - - padding: 0 $gutter-half; - @include box-sizing(border-box); -} diff --git a/app/assets/stylesheets/export-components/partials/_typography.scss b/app/assets/stylesheets/export-components/partials/_typography.scss index 11bd92933..1dc1bd5d7 100644 --- a/app/assets/stylesheets/export-components/partials/_typography.scss +++ b/app/assets/stylesheets/export-components/partials/_typography.scss @@ -1,10 +1,88 @@ + // Great specific fonts -$brand-font: 'Overpass','Roboto', arial, helvetica, verdana; +$brand-font: 'Overpass', 'Roboto', arial, helvetica, verdana; $brand-font-alternative: 'Roboto', arial, helvetica, verdana; $quote-font: 'Georgia', serif; +$line-height: 1.6; +$hero-line-height: 1.2; + + +@mixin font-generator($font-family: $brand-font-alternative, $font-size: 19px, $font-size-mobile: 16px, $font-weight: 400, $font-style: normal, $line-height: 1.6) { + font-weight: $font-weight; + font-size: $font-size-mobile; + font-family: $font-family; + font-style: $font-style; + line-height: $line-height; + + @media (min-width: 641px) { + font-size: $font-size; + } +} + +@mixin body-xlarge { + @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6) +} + +@mixin body-large { + @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6) +} + +@mixin body-medium { + @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6) +} + +@mixin body-small { + @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6) +} + +@mixin quote-xlarge { + @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6) +} + +@mixin quote-large { + @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6) +} + +@mixin quote-medium { + @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6) +} + +@mixin quote-small { + @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6) +} + +@mixin body-xlarge-bold { + @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.6, $font-weight: 700) +} + +@mixin body-large-bold { + @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6, $font-weight: 700) +} + +@mixin body-medium-bold { + @include font-generator($font-size: 19px, $font-size-mobile: 16px, $font-weight: 700, $line-height: 1.6) +} -// Great-specific typography mixins +@mixin body-small-bold { + @include font-generator($font-size: 16px, $font-size-mobile: 14px, $line-height: 1.6, $font-weight: 700) +} + +@mixin brand-xxlarge { + @include font-generator($font-size: 48px, $font-size-mobile: 32px, $line-height: 1.2, $font-weight: 700, $font-family: $brand-font) +} + +@mixin brand-xlarge { + @include font-generator($font-size: 36px, $font-size-mobile: 24px, $line-height: 1.4, $font-weight: 700, $font-family: $brand-font) +} + +@mixin brand-large { + @include font-generator($font-size: 24px, $font-size-mobile: 19px, $line-height: 1.6, $font-weight: 700, $font-family: $brand-font) +} + +@mixin brand-medium { + @include font-generator($font-size: 19px, $font-size-mobile: 16px, $line-height: 1.6, $font-weight: 700, $font-family: $brand-font) +} @mixin font-xlarge-normal { font-family: 'Roboto', arial, helvetica, sans-serif; diff --git a/app/assets/stylesheets/transformation/pages/opportunity.scss b/app/assets/stylesheets/transformation/pages/opportunity.scss index adc8bdb50..582ae1185 100644 --- a/app/assets/stylesheets/transformation/pages/opportunity.scss +++ b/app/assets/stylesheets/transformation/pages/opportunity.scss @@ -79,6 +79,13 @@ h1 { padding-left: $cols-2; position: relative; + h1 { + white-space: pre-wrap; /* CSS3 */ + white-space: -moz-pre-wrap; /* Firefox */ + white-space: -pre-wrap; /* Opera <7 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* IE & Chrome */ + } dd { margin-bottom: $spacing-3; diff --git a/app/controllers/api/cpv_lookup_controller.rb b/app/controllers/api/cpv_lookup_controller.rb new file mode 100644 index 000000000..d06b493d8 --- /dev/null +++ b/app/controllers/api/cpv_lookup_controller.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Api + # CpvLookupController + class CpvLookupController < ApplicationController + skip_before_action :verify_authenticity_token, raise: false + + def search + return not_found unless (term = params[:description]) + # binding.pry + results = Cn2019.search(query(term)).records + + respond_to do |format| + format.json { render status: :ok, json: results } + end + end + + private + + def not_found + render status: :not_found, json: { 'detail': 'Not found' } + end + + def query(term) + { + 'size': 100, + 'query': { + 'simple_query_string': { + 'query': term, + 'fields': ['description^5', 'english_text', 'parent_description'] + } + } + } + end + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 49f90feb8..5597082e1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -139,10 +139,8 @@ def require_sso! if Figaro.env.bypass_sso? redirect_to user_developer_omniauth_authorize_path - elsif Figaro.env.magna_header_enabled? - redirect_to user_magna_omniauth_authorize_path else - redirect_to user_exporting_is_great_omniauth_authorize_path + redirect_to user_magna_omniauth_authorize_path end end @@ -177,107 +175,105 @@ def ga360_campaign_parameters(utm_source, utm_medium, utm_campaign, utm_content) private - def administrator? - current_editor&.administrator? - end + def administrator? + current_editor&.administrator? + end - def previewer? - current_editor&.previewer? - end + def previewer? + current_editor&.previewer? + end - def publisher? - current_editor&.publisher? - end + def publisher? + current_editor&.publisher? + end - def uploader? - current_editor&.uploader? - end + def uploader? + current_editor&.uploader? + end - def staff? - current_editor&.staff? - end + def staff? + current_editor&.staff? + end - def check_if_admin - not_found unless administrator? - end + def check_if_admin + not_found unless administrator? + end - def not_found - respond_to do |format| - format.html { render 'errors/not_found', status: :not_found } - format.json { render json: { errors: 'Resource not found' }, status: :not_found } - format.all { head 404 } - end + def not_found + respond_to do |format| + format.html { render 'errors/not_found', status: :not_found } + format.json { render json: { errors: 'Resource not found' }, status: :not_found } + format.all { head 404 } end + end - def unsupported_format - respond_to do |format| - format.json { render json: { errors: 'JSON is not supported for this resource' }, status: :not_acceptable } - format.all { head 406 } - end + def unsupported_format + respond_to do |format| + format.json { render json: { errors: 'JSON is not supported for this resource' }, status: :not_acceptable } + format.all { head 406 } end + end - def user_not_authorized - render 'errors/unauthorized', status: :unauthorized - end + def user_not_authorized + render 'errors/unauthorized', status: :unauthorized + end - def internal_server_error - render 'errors/internal_server_error', status: :internal_server_error - end + def internal_server_error + render 'errors/internal_server_error', status: :internal_server_error + end - def invalid_authenticity_token(exception) - Raven.capture_exception(exception) - set_google_tag_manager - # ^ this method call is necessary to render - # the layout. It is usually run in a before_action. - # The exception this method rescues from is thrown - # before it has the chance. - render 'errors/invalid_authenticity_token', status: :unprocessable_entity - end + def invalid_authenticity_token(exception) + Raven.capture_exception(exception) + set_google_tag_manager + # ^ this method call is necessary to render + # the layout. It is usually run in a before_action. + # The exception this method rescues from is thrown + # before it has the chance. + render 'errors/invalid_authenticity_token', status: :unprocessable_entity + end - # Returns content provided by .yml files in app/content folder. - # Intended use is to keep content separated from the view code. - # Should make it easier to switch later to CMS-style content editing. - # Note: Rails may already provide a similar service for multiple - # language support, so this mechanism might be replaced by that - # at some point in the furture. - def get_content(*files) - content = {} - files.each do |file| - content = content.merge YAML.load_file('app/content/' + file) - end - content + # Returns content provided by .yml files in app/content folder. + # Intended use is to keep content separated from the view code. + # Should make it easier to switch later to CMS-style content editing. + # Note: Rails may already provide a similar service for multiple + # language support, so this mechanism might be replaced by that + # at some point in the furture. + def get_content(*files) + content = {} + files.each do |file| + content = content.merge YAML.load_file('app/content/' + file) end + content + end - def redis_oo_retry_count(redis) - # nil-safe redis fetch from counter - redis.get('oo_retry_error_count').to_i - end + def redis_oo_retry_count(redis) + # nil-safe redis fetch from counter + redis.get('oo_retry_error_count').to_i + end - def sidekiq_retry_count - rs = Sidekiq::RetrySet.new - retry_jobs = rs.select { |retri| retri.item['class'] == 'RetrieveVolumeOpps' } - retry_jobs.size - end + def sidekiq_retry_count + rs = Sidekiq::RetrySet.new + retry_jobs = rs.select { |retri| retri.item['class'] == 'RetrieveVolumeOpps' } + retry_jobs.size + end - def update_redis_counter(redis, sidekiq_retry_jobs_count, latest_sidekiq_failure) - # set initial value if it's the first time - redis.set('sidekiq_retry_jobs_last_failure', Time.zone.now) unless latest_sidekiq_failure + def update_redis_counter(redis, sidekiq_retry_jobs_count, latest_sidekiq_failure) + # set initial value if it's the first time + redis.set('sidekiq_retry_jobs_last_failure', Time.zone.now) unless latest_sidekiq_failure - if days_since_last_failure(latest_sidekiq_failure) > PUBLISH_SIDEKIQ_ERROR_DAYS - redis.set('oo_retry_error_count', sidekiq_retry_jobs_count) - redis.set('sidekiq_retry_jobs_last_failure', Time.zone.now) - end + if days_since_last_failure(latest_sidekiq_failure) > PUBLISH_SIDEKIQ_ERROR_DAYS + redis.set('oo_retry_error_count', sidekiq_retry_jobs_count) + redis.set('sidekiq_retry_jobs_last_failure', Time.zone.now) end + end - def days_since_last_failure(latest_sidekiq_failure) - return 0 unless latest_sidekiq_failure + def days_since_last_failure(latest_sidekiq_failure) + return 0 unless latest_sidekiq_failure - ((Time.zone.now - Time.zone.parse(latest_sidekiq_failure)) / 86_400) - end - - def sso_session_cookie - return Figaro.env.MAGNA_SSO_SESSION_COOKIE if Figaro.env.magna_header_enabled? + ((Time.zone.now - Time.zone.parse(latest_sidekiq_failure)) / 86_400) + end - Figaro.env.SSO_SESSION_COOKIE - end + def sso_session_cookie + Figaro.env.SSO_SESSION_COOKIE + end end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 397620fb5..215043256 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -9,16 +9,14 @@ def after_sign_out_path_for(_resource) sso_logout_url = "#{Figaro.env.sso_endpoint_base_uri}#{Figaro.env.SSO_ENDPOINT_SSO_APPEND}/accounts/logout/" if Figaro.env.bypass_sso? root_url - elsif Figaro.env.magna_header_enabled? - magna_sso_session_cookie = Figaro.env.magna_sso_session_cookie - cookie = "session_key=#{cookies[magna_sso_session_cookie]}" + else + sso_session_cookie = Figaro.env.sso_session_cookie + cookie = "session_key=#{cookies[sso_session_cookie]}" Faraday.post sso_logout_url do |req| req.headers['Cookie'] = cookie end - cookies.delete magna_sso_session_cookie + cookies.delete sso_session_cookie root_url - else - "#{sso_logout_url}?next=#{root_url}" end end diff --git a/app/models/cn2019.rb b/app/models/cn2019.rb new file mode 100644 index 000000000..1e04e2cae --- /dev/null +++ b/app/models/cn2019.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# Cn2019 +class Cn2019 < ApplicationRecord + include Elasticsearch::Model + include Elasticsearch::Model::Callbacks + + def as_indexed_json(_ = {}) + as_json( + only: %i[ + order level code parent code2 parent2 description english_text parent_description + ] + ) + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 36b5fd7a4..f89f28cb5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,10 +3,8 @@ class User < ApplicationRecord if Figaro.env.bypass_sso? devise :rememberable, :omniauthable, omniauth_providers: [:developer] - elsif Figaro.env.MAGNA_HEADER_ENABLED - devise :rememberable, :omniauthable, omniauth_providers: [:magna] else - devise :rememberable, :omniauthable, omniauth_providers: [:exporting_is_great] + devise :rememberable, :omniauthable, omniauth_providers: [:magna] end has_many :enquiries, -> { order(:created_at) }, dependent: :nullify, inverse_of: :user diff --git a/app/views/admin/enquiries/index.html.haml b/app/views/admin/enquiries/index.html.haml index 15d7c2065..ae80fb1a7 100644 --- a/app/views/admin/enquiries/index.html.haml +++ b/app/views/admin/enquiries/index.html.haml @@ -2,7 +2,6 @@ - content_for :action_specific_head do = stylesheet_link_tag 'transformation_admin/pages/enquiries_index' - = javascript_include_tag 'transformation_admin/dit.page.enquiries_index', skip_pipeline: true - if params[:reply_sent] %div.alert.flash.info diff --git a/app/views/includes/_transformation_scripts.html.haml b/app/views/includes/_transformation_scripts.html.haml index 18ca59de1..e99431bbf 100644 --- a/app/views/includes/_transformation_scripts.html.haml +++ b/app/views/includes/_transformation_scripts.html.haml @@ -11,10 +11,7 @@ -# namespace, native to ExOpps and inherited from original ExRed code. -# These files live outside ExOpps in the export-components repo. = javascript_include_tag 'export-components/dit.classes.Dropdown' -- if Figaro.env.magna_header_enabled? - = javascript_include_tag 'export-components/dit.components.magnaHeader' -- else - = javascript_include_tag 'export-components/dit.components.greatDomesticHeader' += javascript_include_tag 'export-components/dit.components.header' -# Persistent values for JS use diff --git a/app/views/includes/_transformation_styles.html.haml b/app/views/includes/_transformation_styles.html.haml index 454b48a60..fa74ba0ad 100644 --- a/app/views/includes/_transformation_styles.html.haml +++ b/app/views/includes/_transformation_styles.html.haml @@ -1,7 +1,4 @@ -- if Figaro.env.magna_header_enabled? - = stylesheet_link_tag 'export-components/magna-main', media: 'all' -- else - = stylesheet_link_tag 'export-components/main', media: 'all' += stylesheet_link_tag 'export-components/main', media: 'all' = stylesheet_link_tag 'transformation/main', media: 'all' /[if IE 9] = stylesheet_link_tag 'transformation/main_ie9_fixes' diff --git a/app/views/layouts/_dit_footer.html.erb b/app/views/layouts/_dit_footer.html.erb deleted file mode 100644 index 52540d212..000000000 --- a/app/views/layouts/_dit_footer.html.erb +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/app/views/layouts/_dit_header.html.erb b/app/views/layouts/_dit_header.html.erb deleted file mode 100644 index a11da61f1..000000000 --- a/app/views/layouts/_dit_header.html.erb +++ /dev/null @@ -1,75 +0,0 @@ - - - - diff --git a/app/views/layouts/_dit_header_2017.html.haml b/app/views/layouts/_dit_header_2017.html.haml deleted file mode 100644 index 24f5e508b..000000000 --- a/app/views/layouts/_dit_header_2017.html.haml +++ /dev/null @@ -1,67 +0,0 @@ -%script - document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled'); -%header{role: "banner"} - .navigation - .navigation-main.background--dark-blue - .navigation-main-section.outer-container - %nav - %ul.list-inline.list-separators.navigation-main-menu - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/new/'), title: "new to exporting"} New to exporting - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/occasional/'), title: "occasional exporter"} Occasional exporter - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/regular/'), title: "regular exporter"} Regular exporter - %li - - klass = current_page?('/dashboard') ? nil : 'navigation-main-link--active' - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: opportunities_path, title: t('nav.services.export_opportunities'), class: klass}= t('nav.services.export_opportunities') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "http://find-a-buyer.export.great.gov.uk/", title: t('nav.services.find_a_buyer')}= t('nav.services.find_a_buyer') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "https://selling-online-overseas.export.great.gov.uk/markets/", title: t('nav.services.selling_overseas')}= t('nav.services.selling_overseas') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: cms_url_for('/get-finance/'), title: t('nav.services.finance')}= t('nav.services.finance') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "https://events.trade.gov.uk/", title: t('nav.services.events')}= t('nav.services.events') - %a.button.navigation-main-button.font-white{title: "", href: "#"} - %i.icon.icon-menu> - All - .navigation-toggle.background--dark-navy - .outer-container - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-lig.font-light-grey.push--bottom.hide-mobile Export readiness - %ul.font-reg - %li.navigation-toggle-item.navigation-toggle-services - %a{href: cms_url_for('/new/'), title: "new to exporting"} New to exporting - %li.navigation-toggle-item.navigation-toggle-services - %a{href: cms_url_for('/occasional/'), title: "occasional exporter"} Occasional exporter - %li.navigation-toggle-item.navigation-toggle-services - %a.last{href: cms_url_for('/regular/'), title: "regular exporter"} Regular exporter - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-lig.push--bottom.hide-mobile.soft--left Online tools - %ul.font-reg - %li.navigation-toggle-item.navigation-toggle-services - - klass = current_page?('/dashboard') ? nil : 'navigation-toggle-active' - %a{href: opportunities_path, title: t('nav.services.export_opportunities'), class: klass}= t('nav.services.export_opportunities') - %li.navigation-toggle-item - %a{href: "http://find-a-buyer.export.great.gov.uk/", title: t('nav.services.find_a_buyer')}= t('nav.services.find_a_buyer') - %li.navigation-toggle-item - %a{href: "https://selling-online-overseas.export.great.gov.uk/markets/", title: t('nav.services.selling_overseas')}= t('nav.services.selling_overseas') - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-lig.push--bottom.hide-mobile.soft--left Other support - %ul.font-reg - %li.navigation-toggle-item.navigation-toggle-services - %a{href: cms_url_for('/get-finance'), title: t('nav.services.finance')}= t('nav.services.finance') - %li.navigation-toggle-item - %a{href: "https://events.trade.gov.uk/", title: t('nav.services.events')}= t('nav.services.events') - %ul.col-3.navigation-toggle-middle - %li.navigation-toggle-item - %a{href: cms_url_for('/about/'), title: "About"} About - %li.navigation-toggle-item - %a.last{href: "https://contact-us.export.great.gov.uk/selling_online_overseas", title: "Contact us"} Contact us - - - diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 7a26c77bb..f5a87248e 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -5,6 +5,7 @@ %html.no-js{:lang => "en-GB"} %head %title= "#{t('organisation.name')} - Opportunities" + = csrf_meta_tags = stylesheet_link_tag 'application-admin', media: 'all' = stylesheet_link_tag 'transformation_admin/temporary', media: 'all' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index cf3611671..f51513277 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -23,10 +23,7 @@ -# Global header-footer styles - unless request.fullpath.include?('/admin') - - if Figaro.env.magna_header_enabled? - = stylesheet_link_tag('export-components/magna-main') - - else - = stylesheet_link_tag('export-components/main') + = stylesheet_link_tag('export-components/main') = stylesheet_link_tag 'transformation/main' = stylesheet_link_tag 'transformation/pages/form' = stylesheet_link_tag 'transformation/pages/enquiries' @@ -42,10 +39,7 @@ -# Global header-footer styles - unless request.fullpath.include?('/admin') = javascript_include_tag 'export-components/dit.classes.Dropdown' - - if Figaro.env.magna_header_enabled? - = javascript_include_tag 'export-components/dit.components.magnaHeader' - - else - = javascript_include_tag 'export-components/dit.components.greatDomesticHeader' + = javascript_include_tag 'export-components/dit.components.header' %body{id: ExportOpportunities.flipper.enabled?(:new_header_and_footer) ? nil : 'dit'} @@ -55,10 +49,7 @@ = render 'shared/skip_link' = render 'shared/cookie_notice' - - if Figaro.env.magna_header_enabled? - = render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie? } - - else - = render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie? } + = render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie? } - if content_for?(:hero) .hero-header-wrapper @@ -80,10 +71,7 @@ = yield - - if Figaro.env.magna_header_enabled? - = render partial: 'shared/magna_footer' - - else - = render partial: 'shared/footer' + = render partial: 'shared/footer' = javascript_include_tag 'modernizr.min', defer: true = javascript_include_tag 'application' diff --git a/app/views/layouts/email.html.haml b/app/views/layouts/email.html.haml index c1fcf4323..5fa6a78f1 100644 --- a/app/views/layouts/email.html.haml +++ b/app/views/layouts/email.html.haml @@ -102,18 +102,6 @@ = yield %tfoot - %tr - %td{ :style=>"font-family:Arial,sans-serif; font-size:15px; padding:30px 30px 30px 30px;" } - %table{ :cellspacing=>"0", :cellpadding=>"0", :border=>"0", :width=>"100%" } - %tr - %td - %p - The Exporting is GREAT team - %br - = link_to Figaro.env.EXPORT_READINESS_URL.to_s, "www.great.gov.uk" + ApplicationController.new.ga360_campaign_parameters('email_alerts','email','exportOps','great') - %td{:style=>"text-align:right;"} - = image_tag "email/EIGLogo@2x.jpg", { :alt=>"Exporting is GREAT", :style=>"display:block; margin-bottom:10px;", :height=>"70" } - %tr %td{ :style=>"padding: 0px 30px 0 30px" } %hr{ :style=>"background-color:#B00D23; border-color:#B00D23; border-style:solid; border-width:2px; height:2px; margin:0px" } diff --git a/app/views/layouts/enquiries.html.erb b/app/views/layouts/enquiries.html.erb index d5288716f..a4fef519d 100644 --- a/app/views/layouts/enquiries.html.erb +++ b/app/views/layouts/enquiries.html.erb @@ -21,11 +21,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
@@ -44,10 +40,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/form.html.erb b/app/views/layouts/form.html.erb index eab7d7ddb..5ce801a41 100644 --- a/app/views/layouts/form.html.erb +++ b/app/views/layouts/form.html.erb @@ -19,11 +19,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -32,10 +28,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/general.html.erb b/app/views/layouts/general.html.erb index 0a737fab7..6352bed43 100644 --- a/app/views/layouts/general.html.erb +++ b/app/views/layouts/general.html.erb @@ -14,11 +14,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -26,10 +22,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/landing.html.erb b/app/views/layouts/landing.html.erb index 0ddb38af8..f7bf0c990 100644 --- a/app/views/layouts/landing.html.erb +++ b/app/views/layouts/landing.html.erb @@ -20,11 +20,7 @@ <%= render partial: 'includes/reactComponents' %> <%= render partial: 'includes/cookie_modal' %> <%= render partial: 'shared/skip_link' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie? } %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie? } %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -33,10 +29,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/notification.html.erb b/app/views/layouts/notification.html.erb index ba9e84b73..eae950a91 100644 --- a/app/views/layouts/notification.html.erb +++ b/app/views/layouts/notification.html.erb @@ -19,11 +19,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -31,10 +27,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/old/_dit_footer.html.haml b/app/views/layouts/old/_dit_footer.html.haml deleted file mode 100644 index 0f36941f4..000000000 --- a/app/views/layouts/old/_dit_footer.html.haml +++ /dev/null @@ -1,55 +0,0 @@ -%footer{role: "contentinfo"} - .footer.background--great-blue.soft--top - .outer-container - .footer-section - .col-8 - %a{href: cms_url_for('/'), title: "Go to the #{t('site_name')} homepage"} - %img.footer-logo{alt: "#{t('site_name')} logo", src: asset_path("logos/EiG-logo-stacked.svg")}/ - .col-4 - %ul.footer-links.footer-links--border - %li.push-half--bottom - %a{href: cms_url_for('/new/'), title: "New to exporting"} New to exporting - %li.push-half--bottom - %a{href: cms_url_for('/occasional/'), title: "Occasional exporter"} Occasional exporter - %li - %a{href: cms_url_for('/regular/'), title: "Regular exporter"} Regular exporter - .footer-section.footer-section-right - .col-6 - %ul.footer-links.footer-middle-section - %li.push-half--bottom - %a{href: opportunities_path, title: t('nav.services.export_opportunities')}= t('nav.services.export_opportunities') - %li.push-half--bottom - %a{href: "https://find-a-buyer.export.great.gov.uk/", title: t('nav.services.find_a_buyer')}= t('nav.services.find_a_buyer') - %li.push-half--bottom - %a{href: "https://selling-online-overseas.export.great.gov.uk/markets/", title: t('nav.services.selling_overseas')}= t('nav.services.selling_overseas') - %li.push-half--bottom - %a{href: cms_url_for('/get-finance/'), title: t('nav.services.finance')}= t('nav.services.finance') - %li - %a{href: "https://events.trade.gov.uk/", title: t('nav.services.events')}= t('nav.services.events') - .col-6 - %ul.footer-links.footer-links--border - %li.push-half--bottom - %a{href: cms_url_for('/about/'), title: "About"} About - %li.push-half--bottom - %a{href: "https://contact-us.export.great.gov.uk/selling_online_overseas", title: "Contact us"} Contact us - %li.push-half--bottom - %a{href: cms_url_for('/privacy-and-cookies/'), title: "Privacy and Cookies"} Privacy & cookies - %li.push-half--bottom - %a{href: cms_url_for('/terms-and-conditions/'), title: "Terms and conditions"} Terms & conditions - %li - %a{href: "https://www.gov.uk/government/organisations/department-for-international-trade", title: "Department for International Trade"} Department for International Trade - .outer-container - .footer-bottom - .navigation-strip - %ul.list-inline.list-separators - %li.float--left.soft--right - %a{href: "https://www.gov.uk/", title: "HM Government"} - %img{src: asset_path('logos/HM_Government_logo_horizontal.svg')}/ - %li.float--left.soft--left.footer-links--border - %a.link--grey{href: "https://great.gov.uk/", title: "part of great.gov.uk"} - Part of - %strong great.gov.uk - .footer-copy.font-light-grey.font-xsmall - %p © Crown copyright 2017. All rights reserved. - - diff --git a/app/views/layouts/old/_dit_header.html.haml b/app/views/layouts/old/_dit_header.html.haml deleted file mode 100644 index 2a14e8297..000000000 --- a/app/views/layouts/old/_dit_header.html.haml +++ /dev/null @@ -1,112 +0,0 @@ -%script - document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled'); -%header{role: "banner"} - .navigation - .navigation-strip.background--dark-navy - .outer-container - %ul.list-inline.list-separators - %li.float--left.soft-half--right.navigation-skip-to - %a.link.link--grey{href: "#content", title: "Skip to main content"} - %strong Skip to main content - %li.float--left.soft-half--right - %a.logo-hmg{href: "https://www.gov.uk/", title: "Go to the GOV.UK homepage"} - %img{src: asset_path('logos/HM_Government_logo_horizontal.svg'), alt: "HM Government logo"}/ - %li.float--left.soft-half--left - %a.link--white{href: "https://great.gov.uk/", title: "part of great.gov.uk"} - %span.hide-mobile.font-light-grey.font-light - Part of - %span.hide-mobile.font-light - %strong.font-regular great.gov.uk - - - if current_user - %ul.list-inline.list-separators.float--right.navigation-login.font-regular{id: "sso-signout"} - %li.float--left.soft-half--right - %a.link--white{href: dashboard_path, title: "Profile"} - %i.icon.icon--left.icon-sign-out - %span.hide-mobile - Profile - %li.float--left.soft-half--left.hide-mobile - %a.link--white{ href: destroy_user_session_path, title: "Sign out"} - %span - Sign out - - else - %ul.list-inline.list-separators.float--right.navigation-login.font-regular{id: "sso-signin"} - %li.float--left.soft-half--right - %a.link--white{href: dashboard_path, title: "Sign in"} - %i.icon.icon--left.icon-sign-in - %span.hide-mobile - Sign in - %li.float--left.soft-half--left.hide-mobile - %a.link--white{ href: "#{Figaro.env.SSO_ENDPOINT_BASE_URI}/accounts/signup", title: "Register"} - %span - Register - .background--great-blue - .outer-container - %a.float--left{href: cms_url_for('/'), title: "Go to the #{t('site_name')} homepage"} - %img.navigation-logo{alt: "#{t('site_name')} logo", src: asset_path('logos/EiG_logo_horizontal.svg')}/ - .navigation-main.background--dark-blue - .navigation-main-section.outer-container - %nav - %ul.list-inline.list-separators.navigation-main-menu - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/new/'), title: "new to exporting"} New to exporting - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/occasional/'), title: "occasional exporter"} Occasional exporter - %li - %a.navigation-main-link.background--light-blue.font-regular{href: cms_url_for('/regular/'), title: "regular exporter"} Regular exporter - %li - - klass = current_page?('/dashboard') ? nil : 'navigation-main-link--active' - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: opportunities_path, title: t('nav.services.export_opportunities'), class: klass}= t('nav.services.export_opportunities') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "http://find-a-buyer.export.great.gov.uk/", title: t('nav.services.find_a_buyer')}= t('nav.services.find_a_buyer') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "https://selling-online-overseas.export.great.gov.uk/markets/", title: t('nav.services.selling_overseas')}= t('nav.services.selling_overseas') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: cms_url_for('/get-finance/'), title: t('nav.services.finance')}= t('nav.services.finance') - %li - %a.navigation-main-link.navigation-main-link--secondary.font-light{href: "https://events.trade.gov.uk/", title: t('nav.services.events')}= t('nav.services.events') - %a.button.navigation-main-button.font-white{title: "", href: "#"} - %i.icon.icon-menu> - All - .navigation-toggle.background--dark-navy - .outer-container - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-light.push--bottom.hide-mobile Export readiness - %ul.font-reg - %li.navigation-toggle-item.navigation-toggle-services - %a{href: cms_url_for('/new/'), title: "new to exporting"} New to exporting - %li.navigation-toggle-item.navigation-toggle-services - %a{href: cms_url_for('/occasional/'), title: "occasional exporter"} Occasional exporter - %li.navigation-toggle-item.navigation-toggle-services - %a.last{href: cms_url_for('/regular/'), title: "regular exporter"} Regular exporter - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-light.push--bottom.hide-mobile Online tools - %ul.font-light - %li.navigation-toggle-item - - klass = current_page?('/dashboard') ? nil : 'navigation-toggle-active' - %a{href: opportunities_path, title: t('nav.services.export_opportunities'), class: klass}= t('nav.services.export_opportunities') - %li.navigation-toggle-item - %a{href: "http://find-a-buyer.export.great.gov.uk/", title: t('nav.services.find_a_buyer')}= t('nav.services.find_a_buyer') - %li.navigation-toggle-item - %a{href: "https://selling-online-overseas.export.great.gov.uk/markets/", title: t('nav.services.selling_overseas')}= t('nav.services.selling_overseas') - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-light.push--bottom.hide-mobile Other support - %ul.font-light - %li.navigation-toggle-item - %a{href: cms_url_for('/get-finance'), title: t('nav.services.finance')}= t('nav.services.finance') - %li.navigation-toggle-item - %a{href: "https://events.trade.gov.uk/", title: t('nav.services.events')}= t('nav.services.events') - .col-3 - .navigation-toggle-services-section - %h3.font-large.font-light-grey.font-light.push--bottom.hide-mobile About us - %ul.font-light - %li.navigation-toggle-item - %a{href: cms_url_for('/about/'), title: "About"} About great.gov.uk - %li.navigation-toggle-item - %a.last{href: "https://contact-us.export.great.gov.uk/selling_online_overseas", title: "Contact us"} Contact us - - - diff --git a/app/views/layouts/opportunity.html.erb b/app/views/layouts/opportunity.html.erb index 8c5418f1d..a28d976a7 100644 --- a/app/views/layouts/opportunity.html.erb +++ b/app/views/layouts/opportunity.html.erb @@ -19,11 +19,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -32,10 +28,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/layouts/results.html.erb b/app/views/layouts/results.html.erb index 7bfdbddb0..af0809d4e 100644 --- a/app/views/layouts/results.html.erb +++ b/app/views/layouts/results.html.erb @@ -19,11 +19,7 @@ <%= render partial: 'includes/analytics_body' %> <%= render partial: 'shared/skip_link' %> <%= render partial: 'shared/cookie_notice' %> - <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% else %> <%= render partial: 'shared/header', locals: { cookie_signed_in_user: user_signed_in_cookie?} %> - <% end %>
<%= content_for?(:errors) ? yield(:errors) : "" %> @@ -32,10 +28,6 @@ <%= render "components/feedback" %>
- <% if Figaro.env.magna_header_enabled? %> - <%= render partial: 'shared/magna_footer' %> - <% else %> <%= render partial: 'shared/footer' %> - <% end %> diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index 8d87e48d2..b1f2a9297 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,9 +1,7 @@