diff --git a/app/helpers/poll_recounts_helper.rb b/app/helpers/poll_recounts_helper.rb index 95ea813e3..716b71d85 100644 --- a/app/helpers/poll_recounts_helper.rb +++ b/app/helpers/poll_recounts_helper.rb @@ -1,7 +1,7 @@ module PollRecountsHelper - def booth_assignment_sum_final_recounts(ba) - ba.final_recounts.any? ? ba.final_recounts.to_a.sum(&:count) : nil + def total_recounts_by_booth(booth_assignment) + booth_assignment.total_results.any? ? booth_assignment.total_results.to_a.sum(&:amount) : nil end end diff --git a/app/views/admin/poll/recounts/index.html.erb b/app/views/admin/poll/recounts/index.html.erb index 159b4b120..ff4e7bceb 100644 --- a/app/views/admin/poll/recounts/index.html.erb +++ b/app/views/admin/poll/recounts/index.html.erb @@ -12,12 +12,12 @@
| <%= t("admin.recounts.index.table_booth_name") %> | -<%= t("admin.recounts.index.table_final_recount") %> | +<%= t("admin.recounts.index.table_total_recount") %> | <%= t("admin.recounts.index.table_system_count") %> | <% @booth_assignments.each do |booth_assignment| %> - <% final_recount = booth_assignment_sum_final_recounts(booth_assignment) %> + <% total_recounts = total_recounts_by_booth(booth_assignment) %> <% system_count = booth_assignment.voters.size %>
|---|---|---|
| @@ -25,9 +25,9 @@ <%= link_to booth_assignment.booth.name, admin_poll_booth_assignment_path(@poll, booth_assignment, anchor: 'tab-recounts') %> | -- <% if final_recount.present? %> - <%= final_recount %> + | + <% if total_recounts.present? %> + <%= total_recounts %> <% else %> - <% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 6e01fdccf..63fb7c70c 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -604,7 +604,7 @@ en: title: "Recounts" no_recounts: "There is nothing to be recounted" table_booth_name: "Booth" - table_final_recount: "Final recount (by officer)" + table_total_recount: "Total recount (by officer)" table_system_count: "Votes (automatic)" results: index: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 6bf881d30..0e1f0db65 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -604,7 +604,7 @@ es: title: "Recuentos" no_recounts: "No hay nada de lo que hacer recuento" table_booth_name: "Urna" - table_final_recount: "Recuento final (presidente de mesa)" + table_total_recount: "Recuento total (presidente de mesa)" table_system_count: "Votos (automático)" results: index: diff --git a/config/locales/fr/admin.yml b/config/locales/fr/admin.yml index a34862475..966563b7c 100644 --- a/config/locales/fr/admin.yml +++ b/config/locales/fr/admin.yml @@ -391,7 +391,7 @@ fr: no_recounts: "Il n'y a rien à dépouiller" table_booth_name: "Bureau de vote" table_recounts: "Accumulation des dépouillements journaliers (par président)" - table_final_recount: "Dépouillement final (par président)" + table_total_recount: "Dépouillement final (par président)" table_system_count: "Votes (automatique)" results: index: diff --git a/config/locales/nl/admin.yml b/config/locales/nl/admin.yml index 2949f70f4..c7d77cda9 100644 --- a/config/locales/nl/admin.yml +++ b/config/locales/nl/admin.yml @@ -391,7 +391,7 @@ nl: no_recounts: "There is nothing to be recounted" table_booth_name: "Booth" table_recounts: "Accumulated daily recounts (by officer)" - table_final_recount: "Final recount (by officer)" + table_total_recount: "Final recount (by officer)" table_system_count: "Votes (automatic)" results: index: diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index ee90d2ada..e5997fa33 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -249,18 +249,18 @@ feature 'Admin polls' do booth_assignment_final_recounted = create(:poll_booth_assignment, poll: poll) 3.times do |i| - create(:poll_final_recount, + create(:poll_total_result, booth_assignment: booth_assignment, date: poll.starts_at + i.days, - count: 21) + amount: 21) end 2.times { create(:poll_voter, booth_assignment: booth_assignment_final_recounted) } - create(:poll_final_recount, + create(:poll_total_result, booth_assignment: booth_assignment_final_recounted, date: poll.ends_at, - count: 55555) + amount: 55555) visit admin_poll_path(poll) |