From 320e1948fc1b4c6e2e774a065d79f19f16333b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 13 Jun 2022 13:00:35 +0200 Subject: [PATCH] Do not render message when there are zero participants without demographic data --- app/views/budgets/stats/show.html.erb | 8 +++++--- app/views/polls/stats.html.erb | 8 +++++--- config/locales/en/stats.yml | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index 60697135d..5ad9e09ba 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -36,9 +36,11 @@
-

- <%= t("stats.no_demographic_data", count: @stats.total_no_demographic_data) %> -

+ <% if @stats.total_no_demographic_data > 0 %> +

+ <%= t("stats.no_demographic_data", count: @stats.total_no_demographic_data) %> +

+ <% end %>

<%= t("stats.budgets.participatory_disclaimer") %>

diff --git a/app/views/polls/stats.html.erb b/app/views/polls/stats.html.erb index 8e43d5b58..28c747bfa 100644 --- a/app/views/polls/stats.html.erb +++ b/app/views/polls/stats.html.erb @@ -16,9 +16,11 @@ <%= render "advanced_stats", stats: @stats if @stats.advanced? %>
-

- <%= t("stats.no_demographic_data", count: @stats.total_no_demographic_data) %> -

+ <% if @stats.total_no_demographic_data > 0 %> +

+ <%= t("stats.no_demographic_data", count: @stats.total_no_demographic_data) %> +

+ <% end %>
diff --git a/config/locales/en/stats.yml b/config/locales/en/stats.yml index 8662fbde5..de4487c0f 100644 --- a/config/locales/en/stats.yml +++ b/config/locales/en/stats.yml @@ -14,7 +14,6 @@ en: total: "Total" geozone: "District" no_demographic_data: - zero: "" one: "* There is no demographic data for 1 participant." other: "* There is no demographic data for %{count} participants." budgets: