diff --git a/app/components/layout/footer_component.html.erb b/app/components/layout/footer_component.html.erb index 3aeb2a9ca..f7d0cfd89 100644 --- a/app/components/layout/footer_component.html.erb +++ b/app/components/layout/footer_component.html.erb @@ -28,6 +28,13 @@
  • <%= link_to t("layouts.footer.privacy"), page_path("privacy") %>
  • <%= link_to t("layouts.footer.conditions"), page_path("conditions") %>
  • <%= link_to t("layouts.footer.accessibility"), page_path("accessibility") %>
  • + <% if feature?(:cookies_consent) %> +
  • + + <%= t("layouts.footer.cookies_consent_management") %> + +
  • + <% end %> <%= raw footer_legal_content_block %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 67dc81ae0..0c21007b3 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -198,6 +198,7 @@ en: consul: CONSUL DEMOCRACY application consul_url: https://github.com/consuldemocracy/consuldemocracy copyright: CONSUL DEMOCRACY, %{year} + cookies_consent_management: Manage cookies description: This portal uses the %{consul} which is %{open_source}. open_source: open-source software open_source_url: http://www.gnu.org/licenses/agpl-3.0.html diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index e1a7969e9..c7eaf34b6 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -197,6 +197,7 @@ es: conditions: Condiciones de uso consul: aplicación CONSUL DEMOCRACY consul_url: https://github.com/consuldemocracy/consuldemocracy + cookies_consent_management: Configuración de cookies copyright: CONSUL DEMOCRACY, %{year} description: Este portal usa la %{consul} que es %{open_source}. open_source: software de código abierto diff --git a/spec/components/layout/footer_component_spec.rb b/spec/components/layout/footer_component_spec.rb index 9a078fc23..a82aace55 100644 --- a/spec/components/layout/footer_component_spec.rb +++ b/spec/components/layout/footer_component_spec.rb @@ -20,4 +20,24 @@ describe Layout::FooterComponent do expect(page).not_to be_rendered end + + describe "link to manage cookies" do + it "shows a link to the cookies management modal when the cookies consent is enabled" do + Setting["feature.cookies_consent"] = true + + render_inline Layout::FooterComponent.new + + page.find(".subfooter") do |footer| + expect(footer).to have_css "a[data-open=cookies_consent_management]", text: "Manage cookies" + end + end + + it "does not show a link to the cookies management modal when the cookies consent is disabled" do + Setting["feature.cookies_consent"] = false + + render_inline Layout::FooterComponent.new + + expect(page).not_to have_content "Manage cookies" + end + end end