diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 917c0d1e..402015c6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,4 +25,19 @@ def dgu_page_entries_info(collection, entry_name: nil) t("helpers.page_entries_info.more_pages.display_entries", entry_name:, first: from, last: to, total: collection.total_count) end.html_safe end + + def homepage_categories + items = [] + t('pages.home.homepage_links').each do |link| + items << { + link: { + text: link[:text], + path: search_path(filters: { topic: link[:text] }), + }, + description: link[:description], + } + end + + items + end end diff --git a/app/views/pages/_topics.html.erb b/app/views/pages/_topics.html.erb index 685435c1..b07802e4 100644 --- a/app/views/pages/_topics.html.erb +++ b/app/views/pages/_topics.html.erb @@ -1,63 +1,4 @@ -
-

<%= t('.topics_heading') %>

-
- -
-
+<%= render "govuk_publishing_components/components/cards", { + heading: t('pages.home.topics_heading'), + items: homepage_categories +} %> diff --git a/config/locales/views/pages/en.yml b/config/locales/views/pages/en.yml index a015290d..67ecc484 100644 --- a/config/locales/views/pages/en.yml +++ b/config/locales/views/pages/en.yml @@ -3,36 +3,36 @@ en: search: accessibility: search_button_label: "Search data.gov.uk" - topics: - topics_heading: "Data topics" - business_and_economy_label: "Business and economy" - business_and_economy_description: "Small businesses, industry, imports, exports and trade" - crime_and_justice_label: "Crime and justice" - crime_and_justice_description: "Courts, police, prison, offenders, borders and immigration" - defence_label: "Defence" - defence_description: "Armed forces, health and safety, search and rescue" - education_label: "Education" - education_description: "Students, training, qualifications and the National Curriculum" - environment_label: "Environment" - environment_description: "Weather, flooding, rivers, air quality, geology and agriculture" - government_label: "Government" - government_description: "Staff numbers and pay, local councillors and department business plans" - government_spending_label: "Government spending" - government_spending_description: "Includes all payments by government departments over £25,000" - health_label: "Health" - health_description: "Includes smoking, drugs, alcohol, medicine performance and hospitals" - mapping_label: "Mapping" - mapping_description: "Addresses, boundaries, land ownership, aerial photographs, seabed and land terrain" - government_reference_data_label: "Government reference data" - government_reference_data: "Trusted data that is referenced and shared across government departments" - digital_service_performance_label: "Digital service performance" - digital_service_performance: "Cost, usage, completion rate, digital take-up, satisfaction" - society_label: "Society" - society_description: "Employment, benefits, household finances, poverty and population" - towns_and_cities_label: "Towns and cities" - towns_and_cities_description: "Includes housing, urban planning, leisure, waste and energy, consumption" - transport_label: "Transport" - transport_description: "Airports, roads, freight, electric vehicles, parking, buses and footpaths" home: find_open_data: "Find open data" lede: "Find data published by central government, local authorities and public bodies to help you build products and services" + topics_heading: "Data topics" + homepage_links: + - text: "Business and economy" + description: "Small businesses, industry, imports, exports and trade" + - text: "Crime and justice" + description: "Courts, police, prison, offenders, borders and immigration" + - text: "Defence" + description: "Armed forces, health and safety, search and rescue" + - text: "Education" + description: "Students, training, qualifications and the National Curriculum" + - text: "Environment" + description: "Weather, flooding, rivers, air quality, geology and agriculture" + - text: "Government" + description: "Staff numbers and pay, local councillors and department business plans" + - text: "Government spending" + description: "Includes all payments by government departments over £25,000" + - text: "Health" + description: "Includes smoking, drugs, alcohol, medicine performance and hospitals" + - text: "Mapping" + description: "Addresses, boundaries, land ownership, aerial photographs, seabed and land terrain" + - text: "Government reference data" + description: "Trusted data that is referenced and shared across government departments" + - text: "Digital service performance" + description: "Cost, usage, completion rate, digital take-up, satisfaction" + - text: "Society" + description: "Employment, benefits, household finances, poverty and population" + - text: "Towns and cities" + description: "Includes housing, urban planning, leisure, waste and energy, consumption" + - text: "Transport" + description: "Airports, roads, freight, electric vehicles, parking, buses and footpaths" \ No newline at end of file