From 1d151b7b6fa3aaae30dc1a66b0b1b479c7b7285c Mon Sep 17 00:00:00 2001 From: taitus Date: Thu, 28 Jan 2021 17:13:03 +0100 Subject: [PATCH] Add empty message when there are not local targets --- .../sdg/goals/targets_component.html.erb | 18 ++++++++++++------ config/locales/en/sdg.yml | 2 ++ config/locales/es/sdg.yml | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/components/sdg/goals/targets_component.html.erb b/app/components/sdg/goals/targets_component.html.erb index c4f272d08..d6030e8c6 100644 --- a/app/components/sdg/goals/targets_component.html.erb +++ b/app/components/sdg/goals/targets_component.html.erb @@ -10,12 +10,18 @@
<% [global_targets, local_targets].each do |targets| %>
-
- <% targets.sort.each do |target| %> -
<%= target.code %>
-
<%= target.title %>
- <% end %> -
+ <% if targets.blank? %> +
+ <%= t("sdg.goals.show.targets.no_local_targets") %> +
+ <% else %> +
+ <% targets.sort.each do |target| %> +
<%= target.code %>
+
<%= target.title %>
+ <% end %> +
+ <% end %>
<% end %>
diff --git a/config/locales/en/sdg.yml b/config/locales/en/sdg.yml index ba5861cb0..9ce18e282 100644 --- a/config/locales/en/sdg.yml +++ b/config/locales/en/sdg.yml @@ -444,6 +444,8 @@ en: show: read_more: "Read more about %{goal}" read_less: "Read less about %{goal}" + targets: + no_local_targets: This goal has no local targets title: "Sustainable Development Goals" filter: heading: "Filters by SDG" diff --git a/config/locales/es/sdg.yml b/config/locales/es/sdg.yml index 2dcf27e08..7c864ce93 100644 --- a/config/locales/es/sdg.yml +++ b/config/locales/es/sdg.yml @@ -444,6 +444,8 @@ es: show: read_more: "Leer más sobre %{goal}" read_less: "Leer menos sobre %{goal}" + targets: + no_local_targets: Este objetivo no tiene metas localizadas title: "Objetivos de Desarrollo Sostenible" filter: heading: "Filtros por ODS"