Add link to SDG help page to Other information of interest section at main help

This commit is contained in:
Senén Rodero Rodríguez
2021-02-20 11:38:22 +01:00
committed by taitus
parent 90f014f639
commit aa6195abc5
4 changed files with 29 additions and 0 deletions

View File

@@ -3,6 +3,10 @@
<ul class="features">
<li><%= link_to t("pages.help.other.how_to_use", org_name: setting["org_name"]), how_to_use_path %></li>
<% if feature?(:sdg) %>
<li><%= link_to t("pages.help.other.sdg"), sdg_help_path %></li>
<% end %>
<% SiteCustomization::Page.with_more_info_flag.with_same_locale.each do |custom_page| %>
<li><%= link_to custom_page.title, page_path(custom_page.slug) %></li>
<% end %>

View File

@@ -56,6 +56,7 @@ en:
other:
title: "Other information of interest"
how_to_use: "Use %{org_name} in your city"
sdg: "Sustainable Development Goals help"
how_to_use:
text: |-
Use it in your local government or help us to improve it, it is free software.

View File

@@ -56,6 +56,7 @@ es:
other:
title: "Otra información de interés"
how_to_use: "Utiliza %{org_name} en tu municipio"
sdg: "Ayuda Objetivos de Desarrollo Sostenible"
how_to_use:
text: |-
Utilízalo en tu municipio libremente o ayúdanos a mejorarlo, es software libre.

View File

@@ -25,4 +25,27 @@ describe "Help page" do
expect(page).not_to have_link "Help"
end
end
scenario "renders the SDG help page link when the feature is enabled" do
Setting["feature.help_page"] = true
Setting["feature.sdg"] = true
visit root_path
within("#navigation_bar") do
click_link "Help"
end
expect(page).to have_link "Sustainable Development Goals help", href: sdg_help_path
end
scenario "does not render the SDG help page link when the feature is disabled" do
Setting["feature.sdg"] = nil
visit root_path
within("#navigation_bar") do
click_link "Help"
end
expect(page).not_to have_link "Sustainable Development Goals help"
end
end