Add link to management modal in footer

This commit is contained in:
taitus
2024-12-09 16:36:52 +01:00
parent 119c4202fe
commit df34853792
4 changed files with 29 additions and 0 deletions

View File

@@ -28,6 +28,13 @@
<li><%= link_to t("layouts.footer.privacy"), page_path("privacy") %></li> <li><%= link_to t("layouts.footer.privacy"), page_path("privacy") %></li>
<li><%= link_to t("layouts.footer.conditions"), page_path("conditions") %></li> <li><%= link_to t("layouts.footer.conditions"), page_path("conditions") %></li>
<li><%= link_to t("layouts.footer.accessibility"), page_path("accessibility") %></li> <li><%= link_to t("layouts.footer.accessibility"), page_path("accessibility") %></li>
<% if feature?(:cookies_consent) %>
<li>
<a href="#cookies_consent_management" data-open="cookies_consent_management">
<%= t("layouts.footer.cookies_consent_management") %>
</a>
</li>
<% end %>
<%= raw footer_legal_content_block %> <%= raw footer_legal_content_block %>
</ul> </ul>
</div> </div>

View File

@@ -198,6 +198,7 @@ en:
consul: CONSUL DEMOCRACY application consul: CONSUL DEMOCRACY application
consul_url: https://github.com/consuldemocracy/consuldemocracy consul_url: https://github.com/consuldemocracy/consuldemocracy
copyright: CONSUL DEMOCRACY, %{year} copyright: CONSUL DEMOCRACY, %{year}
cookies_consent_management: Manage cookies
description: This portal uses the %{consul} which is %{open_source}. description: This portal uses the %{consul} which is %{open_source}.
open_source: open-source software open_source: open-source software
open_source_url: http://www.gnu.org/licenses/agpl-3.0.html open_source_url: http://www.gnu.org/licenses/agpl-3.0.html

View File

@@ -197,6 +197,7 @@ es:
conditions: Condiciones de uso conditions: Condiciones de uso
consul: aplicación CONSUL DEMOCRACY consul: aplicación CONSUL DEMOCRACY
consul_url: https://github.com/consuldemocracy/consuldemocracy consul_url: https://github.com/consuldemocracy/consuldemocracy
cookies_consent_management: Configuración de cookies
copyright: CONSUL DEMOCRACY, %{year} copyright: CONSUL DEMOCRACY, %{year}
description: Este portal usa la %{consul} que es %{open_source}. description: Este portal usa la %{consul} que es %{open_source}.
open_source: software de código abierto open_source: software de código abierto

View File

@@ -20,4 +20,24 @@ describe Layout::FooterComponent do
expect(page).not_to be_rendered expect(page).not_to be_rendered
end 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 end