diff --git a/app/assets/stylesheets/components/_metadata.scss b/app/assets/stylesheets/components/_metadata.scss deleted file mode 100644 index b284c2f238..0000000000 --- a/app/assets/stylesheets/components/_metadata.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import "govuk_publishing_components/individual_component_support"; - -.app-c-metadata { - @include govuk-font($size: 16); - - color: $govuk-secondary-text-colour; -} diff --git a/app/helpers/calendar_helper.rb b/app/helpers/calendar_helper.rb index cda7cffb16..61194674ba 100644 --- a/app/helpers/calendar_helper.rb +++ b/app/helpers/calendar_helper.rb @@ -8,4 +8,8 @@ def last_updated_date def time_tag_safe(date) tag.time(datetime: date) { l(date, format: "%e %B") }.html_safe end + + def format_date(date) + l date, format: "%e %B %Y" + end end diff --git a/app/views/calendar/bank_holidays.html.erb b/app/views/calendar/bank_holidays.html.erb index 2133bd6f2d..ee828c06d3 100644 --- a/app/views/calendar/bank_holidays.html.erb +++ b/app/views/calendar/bank_holidays.html.erb @@ -119,8 +119,8 @@ } %> - <%= render "components/metadata", { - last_updated: last_updated_date + <%= render "govuk_publishing_components/components/metadata", { + last_updated: format_date(last_updated_date) } %> diff --git a/app/views/calendar/when_do_the_clocks_change.html.erb b/app/views/calendar/when_do_the_clocks_change.html.erb index 739d1b59e9..ccd6d7faba 100644 --- a/app/views/calendar/when_do_the_clocks_change.html.erb +++ b/app/views/calendar/when_do_the_clocks_change.html.erb @@ -52,8 +52,8 @@
<%= t('bank_holidays.gmt_explanation') %>
- <%= render "components/metadata", { - last_updated: last_updated_date + <%= render "govuk_publishing_components/components/metadata", { + last_updated: format_date(last_updated_date) } %> <%= render :partial => "calendar_footer" %> diff --git a/app/views/components/_metadata.html.erb b/app/views/components/_metadata.html.erb deleted file mode 100644 index 053bea9ea1..0000000000 --- a/app/views/components/_metadata.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% - add_app_component_stylesheet("metadata") -%> - diff --git a/app/views/components/docs/metadata.yml b/app/views/components/docs/metadata.yml deleted file mode 100644 index 0096b136d4..0000000000 --- a/app/views/components/docs/metadata.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: Metadata -description: Calendar page metadata (i.e. last updated date). Should be called with a date object e.g. Date.parse("2-5-2008") -accessibility_criteria: Elements must have sufficient color contrast -examples: - default: - data: - last_updated: 2019-01-07 diff --git a/config/initializers/dartsass.rb b/config/initializers/dartsass.rb index 5959a8ab2c..6cb3fab60c 100644 --- a/config/initializers/dartsass.rb +++ b/config/initializers/dartsass.rb @@ -1,7 +1,6 @@ APP_STYLESHEETS = { "application.scss" => "application.css", "components/_calendar.scss" => "components/_calendar.css", - "components/_metadata.scss" => "components/_metadata.css", "components/_subscribe.scss" => "components/_subscribe.css", "views/_calendars.scss" => "views/_calendars.css", "views/_cookie-settings.scss" => "views/_cookie-settings.css", diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 4cedbc9a2c..58b6b63ec2 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -81,7 +81,6 @@ cy: download_ics: Llwythwch y dyddiadau hyn i lawr er mwyn eu hychwanegu at raglen calendr fel iCal neu Outlook extra_bank_holiday: Gŵyl banc ychwanegol holiday_entitlement_html: Nid oes yn rhaid i'ch cyflogwr roi gwyliau â thâl i chi ar wyliau banc neu gyhoeddus. - last_updated: Diweddarwyd ddiwethaf nations: england-and-wales: Cymru a Lloegr england-and-wales_for: ar gyfer Cymru a Lloegr diff --git a/config/locales/en.yml b/config/locales/en.yml index b85450a3cd..a87e517115 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -81,7 +81,6 @@ en: download_ics: Download these dates so you can add them to a calendar application such as iCal or Outlook extra_bank_holiday: Extra bank holiday holiday_entitlement_html: Your employer does not have to give you paid leave on bank or public holidays. - last_updated: Last updated nations: england-and-wales: England and Wales england-and-wales_for: for England and Wales diff --git a/test/components/metadata_test.rb b/test/components/metadata_test.rb deleted file mode 100644 index 7e8cf4887d..0000000000 --- a/test/components/metadata_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "component_test_helper" - -class MetadataComponentTest < ComponentTestCase - def component_name - "metadata" - end - - test "fails to render when no parameters given" do - assert_raise do - render_component({}) - end - end - - test "renders the component when a date object is given" do - render_component({ - last_updated: Date.parse("2-5-2008"), - }) - assert_select ".app-c-metadata", text: "Last updated: 2 May 2008" - end -end diff --git a/test/integration/bank_holidays_test.rb b/test/integration/bank_holidays_test.rb index 33386181d5..fe70eefa84 100644 --- a/test/integration/bank_holidays_test.rb +++ b/test/integration/bank_holidays_test.rb @@ -257,8 +257,8 @@ class BankHolidaysTest < ActionDispatch::IntegrationTest should "be formatted correctly" do Timecop.travel(Date.parse("5th Dec 2012")) do visit "/bank-holidays" - within ".app-c-metadata" do - assert page.has_content?("Last updated: 5 December 2012") + within ".gem-c-metadata" do + assert page.has_content?("Last updated 5 December 2012") end end end diff --git a/test/integration/gwyliau_banc_test.rb b/test/integration/gwyliau_banc_test.rb index 96107e0735..6e373b10ef 100644 --- a/test/integration/gwyliau_banc_test.rb +++ b/test/integration/gwyliau_banc_test.rb @@ -212,8 +212,8 @@ class GwyliauBancTest < ActionDispatch::IntegrationTest should "be translated and localised" do Timecop.travel(Date.parse("25th Dec 2012")) do visit "/gwyliau-banc" - within ".app-c-metadata" do - assert page.has_content?("Diweddarwyd ddiwethaf: 25 Rhagfyr 2012") + within ".gem-c-metadata" do + assert page.has_content?("Diweddarwyd ddiwethaf 25 Rhagfyr 2012") end end end