<%= render "layouts/flash" %>
<%= yield %>
diff --git a/app/views/layouts/management.html.erb b/app/views/layouts/management.html.erb
index 921d91b2b..4c01900d2 100644
--- a/app/views/layouts/management.html.erb
+++ b/app/views/layouts/management.html.erb
@@ -7,6 +7,7 @@
+ <%= render Layout::SkipToMainContentComponent.new %>
<%= render Layout::AdminHeaderComponent.new(manager_logged_in) %>
@@ -16,7 +17,7 @@
<%= render "/management/menu" %>
-
+
<%= label_tag :show_menu, t("admin.menu.admin"),
"aria-hidden": true, class: "button hollow expanded" %>
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index 3fb976b1d..f8c76bb55 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -228,6 +228,7 @@ en:
zero: "You don't have new notifications"
notifications: Notifications
sdg: "SDG"
+ skip_to_main_content: "Skip to main content"
notifications:
index:
empty_notifications: You don't have new notifications.
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 821c85f5d..507ee7701 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -228,6 +228,7 @@ es:
zero: "No tienes notificaciones nuevas"
notifications: Notificaciones
sdg: "ODS"
+ skip_to_main_content: "Saltar al contenido principal"
notifications:
index:
empty_notifications: No tienes notificaciones nuevas.
diff --git a/public/403.html b/public/403.html
index da449d613..5ce743d62 100644
--- a/public/403.html
+++ b/public/403.html
@@ -33,7 +33,7 @@
-
+
403
Access to this page has been disabled by the administrators.
diff --git a/public/404.html b/public/404.html
index 82a7fdc35..665f464cd 100644
--- a/public/404.html
+++ b/public/404.html
@@ -33,7 +33,7 @@
-
+
404
Not found.
diff --git a/public/422.html b/public/422.html
index 3e118553d..941362f53 100644
--- a/public/422.html
+++ b/public/422.html
@@ -33,7 +33,7 @@
-
+
422
The change you wanted was rejected.
diff --git a/public/500.html b/public/500.html
index 3084a5e2c..bfdba1ecd 100644
--- a/public/500.html
+++ b/public/500.html
@@ -33,7 +33,7 @@
-
+
500
Internal server error.
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index a0309ef8a..16a958e38 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -62,6 +62,8 @@ module Capybara
unless url.match?("robots.txt") || url.match?("active_storage/representations")
expect(page).to have_css "main", count: 1
+ expect(page).to have_css "#main", count: 1
+ expect(page).to have_css "main#main"
end
end
end
diff --git a/spec/system/home_spec.rb b/spec/system/home_spec.rb
index 2efff1af1..82db40218 100644
--- a/spec/system/home_spec.rb
+++ b/spec/system/home_spec.rb
@@ -183,4 +183,20 @@ describe "Home" do
within(".header-card") { expect(page).not_to have_link }
end
end
+
+ describe "Link to skip to main content" do
+ it "is visible on focus" do
+ visit root_path
+
+ expect(page).to have_link "Skip to main content", visible: :hidden
+ expect(page).to have_css "main"
+ expect(page).not_to have_css "main:target"
+
+ page.execute_script("$('.skip-to-main-content a').focus()")
+ sleep 0.01 until page.has_link?("Skip to main content", visible: :visible)
+ click_link "Skip to main content"
+
+ expect(page).to have_css "main:target"
+ end
+ end
end