fix(a11y/footer): add "new tab" suffix on title links

Cf #8050
This commit is contained in:
Colin Darie 2022-11-28 15:48:40 +01:00
parent e60fb1f0c1
commit 720995f48f
6 changed files with 14 additions and 8 deletions

View file

@ -129,6 +129,10 @@ module ApplicationHelper
{ target: "_blank", rel: "noopener noreferrer" }
end
def new_tab_suffix(title)
"#{title}#{t('utils.new_tab')}"
end
def download_details(attachment)
"#{attachment.filename.extension.upcase} #{number_to_human_size(attachment.byte_size)}"
end

View file

@ -50,19 +50,19 @@
.fr-footer__content
%p.fr-footer__content-desc
= t('links.footer.description_1')
= link_to t('links.footer.link_1_label'), t('links.footer.link_1_url'), target: '_blank'
= link_to(t('links.footer.link_1_label'), t('links.footer.link_1_url'), title: new_tab_suffix(t('links.footer.link_1_label')), target: '_blank') + "."
%p.fr-footer__content-desc
= link_to t('links.footer.link_2_label'), t("links.footer.code.url"), target: '_blank'
= link_to t('links.footer.link_2_label'), t("links.footer.code.url"), title: new_tab_suffix(t('links.footer.link_2_label')), target: '_blank'
= 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'), class: 'fr-footer__content-link', target: '_blank'
= 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', 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'
= 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', 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'
= 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', 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'
= 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', target: '_blank'
.fr-footer__bottom
= render partial: 'users/general_footer_row'

View file

@ -1,4 +1,4 @@
.fr-footer__bottom-copy
%p
Sauf mention contraire, tous les contenus de ce site sont sous
%a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", rel: "noopener", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0
%a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", rel: "noopener", title: new_tab_suffix("licence etalab-2.0") } licence etalab-2.0

View file

@ -50,6 +50,7 @@ en:
message: Message
send_mail: Send message
procedure: Procedures
new_tab: New tab
helpers:
procedure:
testing_procedure: testing procedure

View file

@ -40,6 +40,7 @@ fr:
message: Message
send_mail: Envoyer le message
procedure: Démarches
new_tab: "Nouvel onglet"
helpers:
procedure:
testing_procedure: démarche en test

View file

@ -12,7 +12,7 @@ fr:
resources: Ressources
diagnostic: Diagnostic
description_1: Démarches simplifiées est un service propulsé par
link_1_label: la direction interministérielle du numérique (DINUM).
link_1_label: la direction interministérielle du numérique (DINUM)
link_1_url: "https://www.numerique.gouv.fr/dinum/"
link_2_label: Le code source
description_2: est disponible en licence libre.