From bc6506da5a91f11c1ca56ecc07795bcd0724a738 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 17 Sep 2025 15:40:58 +0200 Subject: [PATCH] Unify Officing and Admin results views Unify the code from app/views/officing/results/index.html.erb with app/views/admin/poll/results/_result.html.erb. This prepares the ground to extract a component in the next commit and avoid duplication. --- app/views/officing/results/index.html.erb | 8 ++++---- config/locales/en/officing.yml | 2 -- config/locales/es/officing.yml | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/views/officing/results/index.html.erb b/app/views/officing/results/index.html.erb index 2b2d8ef15..c6e181551 100644 --- a/app/views/officing/results/index.html.erb +++ b/app/views/officing/results/index.html.erb @@ -31,11 +31,11 @@ <% @poll.questions.each do |question| %>

<%= question.title %>

- +
- - + + @@ -43,7 +43,7 @@ <% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %> - + <% end %> diff --git a/config/locales/en/officing.yml b/config/locales/en/officing.yml index c72ef0b7b..b31d11c0f 100644 --- a/config/locales/en/officing.yml +++ b/config/locales/en/officing.yml @@ -57,8 +57,6 @@ en: index: no_results: "No results" results: Results - table_answer: Answer - table_votes: Votes table_whites: "Totally blank ballots" table_nulls: "Invalid ballots" table_total: "Valid ballots" diff --git a/config/locales/es/officing.yml b/config/locales/es/officing.yml index 7887f6f19..f3cfbc89e 100644 --- a/config/locales/es/officing.yml +++ b/config/locales/es/officing.yml @@ -57,8 +57,6 @@ es: index: no_results: "No hay resultados" results: Resultados - table_answer: Respuesta - table_votes: Votos table_whites: "Papeletas totalmente en blanco" table_nulls: "Papeletas nulas" table_total: "Papeletas vĂ¡lidas"
<%= t("officing.results.index.table_answer") %><%= t("officing.results.index.table_votes") %><%= t("admin.results.result.table_answer") %><%= t("admin.results.result.table_votes") %>
<%= option.title %><%= by_answer[option.title].present? ? by_answer[option.title].first.amount : 0 %><%= by_answer[option.title].present? ? by_answer[option.title].sum(&:amount) : 0 %>