From 8c16eb154359607af4a57d6509028c3295233d03 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 29 Nov 2022 15:57:02 +0100 Subject: [PATCH] fix(a11y): more external link having title saying it will open in new tab --- app/views/layouts/commencer/_no_procedure.html.haml | 2 +- app/views/root/_footer.html.haml | 10 +--------- app/views/root/landing.html.haml | 2 +- app/views/shared/_footer_content_list.html.haml | 9 +++++++++ app/views/shared/_france_connect_login.html.haml | 2 +- .../shared/help/dropdown_items/_faq_item.html.haml | 2 +- app/views/users/_procedure_footer.html.haml | 10 +--------- app/views/users/confirmations/new.html.haml | 2 +- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 10 files changed, 18 insertions(+), 23 deletions(-) create mode 100644 app/views/shared/_footer_content_list.html.haml diff --git a/app/views/layouts/commencer/_no_procedure.html.haml b/app/views/layouts/commencer/_no_procedure.html.haml index 51da3ccf6..9e4f49068 100644 --- a/app/views/layouts/commencer/_no_procedure.html.haml +++ b/app/views/layouts/commencer/_no_procedure.html.haml @@ -12,4 +12,4 @@ %span.small-simple= t('.are_you_new', app_name: APPLICATION_NAME.gsub("-","‑")).html_safe %br %br - = link_to t('views.users.sessions.new.find_procedure'), COMMENT_TROUVER_MA_DEMARCHE_URL, target: "_blank", class: "fr-btn fr-btn--secondary" + = link_to t('views.users.sessions.new.find_procedure'), COMMENT_TROUVER_MA_DEMARCHE_URL, title: new_tab_suffix(t('views.users.sessions.new.find_procedure')), class: "fr-btn fr-btn--secondary", **external_link_attributes diff --git a/app/views/root/_footer.html.haml b/app/views/root/_footer.html.haml index de056dda0..9b6a302f6 100644 --- a/app/views/root/_footer.html.haml +++ b/app/views/root/_footer.html.haml @@ -54,15 +54,7 @@ %p.fr-footer__content-desc = link_to t('links.footer.link_2_label'), t("links.footer.code.url"), title: new_tab_suffix(t('links.footer.link_2_label')), **external_link_attributes = t('links.footer.description_2') - %ul.fr-footer__content-list - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.legifrance.title'), t('users.procedure_footer.official_links.legifrance.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.legifrance.title')), class: 'fr-footer__content-link', **external_link_attributes - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.gouvernement.title'), t('users.procedure_footer.official_links.gouvernement.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.gouvernement.title')), class: 'fr-footer__content-link', **external_link_attributes - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.service_public.title'), t('users.procedure_footer.official_links.service_public.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.service_public.title')), class: 'fr-footer__content-link', **external_link_attributes - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.data_gouv.title'), t('users.procedure_footer.official_links.data_gouv.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.data_gouv.title')), class: 'fr-footer__content-link', **external_link_attributes + = render partial: "shared/footer_content_list" .fr-footer__bottom = render partial: 'users/general_footer_row' diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index b0c6264bb..046ab933e 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -26,7 +26,7 @@ %h2 Vous souhaitez effectuer une demande auprès d’une administration ? %p.fr-h5 Réalisez vos demandes en toute simplicité et retrouvez vos dossiers en ligne - = link_to "Comment trouver ma démarche ?", COMMENT_TROUVER_MA_DEMARCHE_URL, class: "fr-btn fr-btn--lg fr-mr-1w fr-mb-2w", **external_link_attributes + = link_to "Comment trouver ma démarche ?", COMMENT_TROUVER_MA_DEMARCHE_URL, class: "fr-btn fr-btn--lg fr-mr-1w fr-mb-2w", title: new_tab_suffix("Comment trouver ma démarche ?"), **external_link_attributes = link_to "Se connecter", new_user_session_path, class: "fr-btn fr-btn--secondary fr-btn--lg" - cache "numbers-panel", :expires_in => 3.hours do diff --git a/app/views/shared/_footer_content_list.html.haml b/app/views/shared/_footer_content_list.html.haml new file mode 100644 index 000000000..ed162a378 --- /dev/null +++ b/app/views/shared/_footer_content_list.html.haml @@ -0,0 +1,9 @@ +%ul.fr-footer__content-list + %li.fr-footer__content-item + = link_to t('users.procedure_footer.official_links.legifrance.title'), t('users.procedure_footer.official_links.legifrance.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.legifrance.title')), class: 'fr-footer__content-link', **external_link_attributes + %li.fr-footer__content-item + = link_to t('users.procedure_footer.official_links.gouvernement.title'), t('users.procedure_footer.official_links.gouvernement.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.gouvernement.title')), class: 'fr-footer__content-link', **external_link_attributes + %li.fr-footer__content-item + = link_to t('users.procedure_footer.official_links.service_public.title'), t('users.procedure_footer.official_links.service_public.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.service_public.title')), class: 'fr-footer__content-link', **external_link_attributes + %li.fr-footer__content-item + = link_to t('users.procedure_footer.official_links.data_gouv.title'), t('users.procedure_footer.official_links.data_gouv.url'), title: new_tab_suffix(t('users.procedure_footer.official_links.data_gouv.title')), class: 'fr-footer__content-link', **external_link_attributes diff --git a/app/views/shared/_france_connect_login.html.haml b/app/views/shared/_france_connect_login.html.haml index 897ba2010..c71332f90 100644 --- a/app/views/shared/_france_connect_login.html.haml +++ b/app/views/shared/_france_connect_login.html.haml @@ -11,7 +11,7 @@ = t('views.shared.france_connect_login.login_button') %span.fr-connect__brand FranceConnect %p - = link_to t('views.shared.france_connect_login.help_link'), "https://franceconnect.gouv.fr/", target: "_blank", rel: "noopener" + = link_to t('views.shared.france_connect_login.help_link'), "https://franceconnect.gouv.fr/", title: new_tab_suffix(t('views.shared.france_connect_login.help_link')), **external_link_attributes .france-connect-login-separator = t('views.shared.france_connect_login.separator') diff --git a/app/views/shared/help/dropdown_items/_faq_item.html.haml b/app/views/shared/help/dropdown_items/_faq_item.html.haml index 958d004b1..1a2a4461f 100644 --- a/app/views/shared/help/dropdown_items/_faq_item.html.haml +++ b/app/views/shared/help/dropdown_items/_faq_item.html.haml @@ -1,5 +1,5 @@ %li - = link_to FAQ_URL, target: "_blank", rel: "noopener" do + = link_to FAQ_URL, title: new_tab_suffix(t('help_dropdown.general_title')), **external_link_attributes do %span.icon.help .dropdown-description %span.help-dropdown-title diff --git a/app/views/users/_procedure_footer.html.haml b/app/views/users/_procedure_footer.html.haml index 3046ececa..fd7d40b38 100644 --- a/app/views/users/_procedure_footer.html.haml +++ b/app/views/users/_procedure_footer.html.haml @@ -69,15 +69,7 @@ = "#{service.nom}," = "#{service.organisme}," = string_to_html(service.adresse, wrapper_tag = 'span') - %ul.fr-footer__content-list - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.legifrance.title'), t('users.procedure_footer.official_links.legifrance.url'), class: 'fr-footer__content-link', target: '_blank' - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.gouvernement.title'), t('users.procedure_footer.official_links.gouvernement.url'), class: 'fr-footer__content-link', target: '_blank' - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.service_public.title'), t('users.procedure_footer.official_links.service_public.url'), class: 'fr-footer__content-link', target: '_blank' - %li.fr-footer__content-item - = link_to t('users.procedure_footer.official_links.data_gouv.title'), t('users.procedure_footer.official_links.data_gouv.url'), class: 'fr-footer__content-link', target: '_blank' + = render partial: "shared/footer_content_list" .fr-footer__bottom = render partial: 'users/general_footer_row', locals: { dossier: dossier } diff --git a/app/views/users/confirmations/new.html.haml b/app/views/users/confirmations/new.html.haml index b18231c64..8d8ca5609 100644 --- a/app/views/users/confirmations/new.html.haml +++ b/app/views/users/confirmations/new.html.haml @@ -34,5 +34,5 @@ %p Vous pouvez également consulter notre - = link_to('FAQ', FAQ_EMAIL_NON_RECU_URL, target: '_blank', rel: 'noopener') + = link_to('FAQ', FAQ_EMAIL_NON_RECU_URL, title: new_tab_suffix('FAQ'), **external_link_attributes) \. diff --git a/config/locales/en.yml b/config/locales/en.yml index a96bab0b6..0062b9469 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -35,6 +35,7 @@ en: help: 'Help' help_dropdown: + general_title: "Online help" problem_title: A problem with the website ? problem_description: Find your answer in the online help. technical_contact_title: Technical contact diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b91ebf742..a4807236c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -24,6 +24,7 @@ fr: sentence_for_humans: 'Si vous êtes un humain, laissez ce champ vide' help: 'Aide' help_dropdown: + general_title: "Aide en ligne" problem_title: Un problème avec le site ? problem_description: Trouvez votre réponse dans l’aide en ligne. technical_contact_title: Contact technique