From 53ad9d361180e538af2d7a46b9d86819da755a60 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 13 Mar 2018 11:24:12 +0100 Subject: [PATCH] [Fix #1591] Add rel attribute to target blank links --- app/controllers/root_controller.rb | 2 +- app/views/layouts/_new_footer.html.haml | 10 +++++----- app/views/root/landing.html.haml | 25 ++++++++++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 84f085b21..6888a1770 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -13,7 +13,7 @@ class RootController < ApplicationController end if Date.today < Date.new(2018, 03, 31) - flash.now.notice = ["Téléprocédures Simplifiées change de nom et devient demarches-simplifiees.fr, en savoir plus."] + flash.now.notice = ["Téléprocédures Simplifiées change de nom et devient demarches-simplifiees.fr, en savoir plus."] end render 'landing' diff --git a/app/views/layouts/_new_footer.html.haml b/app/views/layouts/_new_footer.html.haml index 0698b05db..da94e6f41 100644 --- a/app/views/layouts/_new_footer.html.haml +++ b/app/views/layouts/_new_footer.html.haml @@ -22,9 +22,9 @@ %li.footer-link = link_to "Statistiques", stats_path, :class => "footer-link" %li.footer-link - = link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank" + = link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" %li.footer-link - = link_to "Mentions légales", "https://demarches-simplifiees.gitbooks.io/demarches-simplifiees/content/conditions-generales-dutilisation.html#4-mentions-l%C3%A9gales", :class => "footer-link", :target => "_blank" + = link_to "Mentions légales", "https://demarches-simplifiees.gitbooks.io/demarches-simplifiees/content/conditions-generales-dutilisation.html#4-mentions-l%C3%A9gales", :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" %li.footer-column %ul.footer-links @@ -33,10 +33,10 @@ "mailto:#{t('dynamics.contact_email')}", :class => "footer-link" %li.footer-link - = link_to "Documentation", "https://demarches-simplifiees.gitbooks.io/demarches-simplifiees/content/", :class => "footer-link", :target => "_blank" + = link_to "Documentation", "https://demarches-simplifiees.gitbooks.io/demarches-simplifiees/content/", :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" %li.footer-link - = link_to "Documentation de l'API", "/docs", :class => "footer-link", :target => "_blank" + = link_to "Documentation de l'API", "/docs", :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" %li.footer-link - = link_to "FAQ", "http://demarches-simplifiees.helpscoutdocs.com/", :class => "footer-link", :target => "_blank" + = link_to "FAQ", "http://demarches-simplifiees.helpscoutdocs.com/", :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" %li.footer-link = link_to "Accessibilité", accessibilite_index_path, :class => "footer-link" diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 67e7c867e..28420a47d 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -50,11 +50,13 @@ "mailto:#{t("dynamics.contact_email")}?subject=Demande%20de%20compte%20administrateur%20demarches-simplifiees.fr", class: "role-panel-button-primary", target: "_blank", + rel: "noopener noreferrer", onclick: "javascript: ga('send', 'pageview', '/demander-une-demo')" = link_to "Voir la documentation", "https://demarches-simplifiees.gitbooks.io/demarches-simplifiees/content/", target: "_blank", + rel: "noopener noreferrer", class: "role-panel-button-secondary" .landing-panel.admins-panel @@ -156,36 +158,36 @@ %ul.users %li.user - = link_to "https://www.ecologique-solidaire.gouv.fr/", target: :blank do + = link_to "https://www.ecologique-solidaire.gouv.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/mtes.jpg"), alt: "Ministère de la Transition Écologique et Solidaire" } %li.user - = link_to "https://www.iledefrance.fr/", target: :blank do + = link_to "https://www.iledefrance.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/region-idf.jpg"), alt: "Région Île-de-France" } %li.user - = link_to "http://www.artisanat.fr/", target: :blank do + = link_to "http://www.artisanat.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/chambres-de-metiers.jpg"), alt: "Chambres des Métiers et de l'Artisanat" } %li.user - = link_to "http://www.cci.fr/", target: :blank do + = link_to "http://www.cci.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/cci.jpg"), alt: "CCI de France" } %li.user - = link_to "http://www.driea.ile-de-france.developpement-durable.gouv.fr/", target: :blank do + = link_to "http://www.driea.ile-de-france.developpement-durable.gouv.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/driea-idf.jpg"), alt: "Direction Régionale et Interdépartementale de l'Équipement et de l'Aménagement" } %ul.users %li.user - = link_to "https://www.debatpublic.fr/", target: :blank do + = link_to "https://www.debatpublic.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/cndp.jpg"), alt: "Commission Nationale du Débat Public" } %li.user - = link_to "https://www.iledefrance.ars.sante.fr/", target: :blank do + = link_to "https://www.iledefrance.ars.sante.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/ars-idf.jpg"), alt: "Agence Régionale de Santé d'Île-de-France" } %li.user - = link_to "http://www.franceagrimer.fr/", target: :blank do + = link_to "http://www.franceagrimer.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/france-agrimer.jpg"), alt: "FranceAgrimer" } %li.user - = link_to "http://www.rhone.gouv.fr/", target: :blank do + = link_to "http://www.rhone.gouv.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/prefecture-rhone.jpg"), alt: "Préfecture de la région Rhône-Alpes" } %li.user - = link_to "http://www.lillemetropole.fr/", target: :blank do + = link_to "http://www.lillemetropole.fr/", target: :blank, rel: "noopener noreferrer" do %img.user-image{ :src => image_url("landing/users/mel.jpg"), alt: "Métropole Européenne de Lille" } .landing-panel.cta-panel @@ -198,4 +200,5 @@ = link_to "Contactez-nous", "mailto:#{t("dynamics.contact_email")}?subject=Question%20à%20propos%20de%20demarches-simplifiees.fr", class: "cta-panel-button-white", - target: "_blank" + target: "_blank", + rel: "noopener noreferrer"