Replace FinalResult with TotalResult at admin BoothAssignment show
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
module PollFinalRecountsHelper
|
|
||||||
|
|
||||||
def final_recount_for_date(final_recounts, date)
|
|
||||||
final_recounts.select {|f| f.date == date}.first
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -49,18 +49,18 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.poll_booth_assignments.show.date") %></th>
|
<th><%= t("admin.poll_booth_assignments.show.date") %></th>
|
||||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_final") %></th>
|
<th class="text-center"><%= t("admin.poll_booth_assignments.show.total_recount") %></th>
|
||||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_by_system") %></th>
|
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_by_system") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% (@poll.starts_at.to_date..@poll.ends_at.to_date).each do |voting_date| %>
|
<% (@poll.starts_at.to_date..@poll.ends_at.to_date).each do |voting_date| %>
|
||||||
<% final_recount = final_recount_for_date(@booth_assignment.final_recounts, voting_date) %>
|
<% total_recount = @booth_assignment.total_results.where(date: voting_date).first %>
|
||||||
<% system_count = @voters_by_date[voting_date].present? ? @voters_by_date[voting_date].size : 0 %>
|
<% system_count = @voters_by_date[voting_date].present? ? @voters_by_date[voting_date].size : 0 %>
|
||||||
<tr id="recounting_<%= voting_date.strftime('%Y%m%d') %>">
|
<tr id="recounting_<%= voting_date.strftime('%Y%m%d') %>">
|
||||||
<td><%= l voting_date %></td>
|
<td><%= l voting_date %></td>
|
||||||
<% if final_recount.present? %>
|
<% if total_recount.present? %>
|
||||||
<td class="text-center <%= 'count-error' if final_recount.count != system_count %>" title="<%= final_recount.officer_assignment.officer.name %>"><%= final_recount.count %></td>
|
<td class="text-center <%= 'count-error' if total_recount.amount != system_count %>" title="<%= total_recount.officer_assignment.officer.name %>"><%= total_recount.amount %></td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td class="text-center" title=""> - </td>
|
<td class="text-center" title=""> - </td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ en:
|
|||||||
recounts: "Recounts"
|
recounts: "Recounts"
|
||||||
recounts_list: "Recount list for this booth"
|
recounts_list: "Recount list for this booth"
|
||||||
date: "Date"
|
date: "Date"
|
||||||
count_final: "Final recount (by officer)"
|
total_recount: "Total recount (by officer)"
|
||||||
count_by_system: "Votes (automatic)"
|
count_by_system: "Votes (automatic)"
|
||||||
index:
|
index:
|
||||||
booths_title: "List of booths"
|
booths_title: "List of booths"
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ es:
|
|||||||
recounts: "Recuentos"
|
recounts: "Recuentos"
|
||||||
recounts_list: "Lista de recuentos de esta urna"
|
recounts_list: "Lista de recuentos de esta urna"
|
||||||
date: "Fecha"
|
date: "Fecha"
|
||||||
count_final: "Recuento final (presidente de mesa)"
|
total_recount: "Recuento total (presidente de mesa)"
|
||||||
count_by_system: "Votos (automático)"
|
count_by_system: "Votos (automático)"
|
||||||
index:
|
index:
|
||||||
booths_title: "Listado de urnas asignadas"
|
booths_title: "Listado de urnas asignadas"
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ fr:
|
|||||||
no_recounts: "Il n'y a pas encore de dépouillements journaliers pour ce bureau de vote."
|
no_recounts: "Il n'y a pas encore de dépouillements journaliers pour ce bureau de vote."
|
||||||
date: "Date"
|
date: "Date"
|
||||||
count_by_officer: "Dépouillement journalier (par président)"
|
count_by_officer: "Dépouillement journalier (par président)"
|
||||||
count_final: "Dépouillement final (par président)"
|
total_count: "Dépouillement final (par président)"
|
||||||
count_by_system: "Votes (automatique)"
|
count_by_system: "Votes (automatique)"
|
||||||
index:
|
index:
|
||||||
booths_title: "Liste des bureaux de vote"
|
booths_title: "Liste des bureaux de vote"
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ nl:
|
|||||||
no_recounts: "There are not daily recounts of this booth yet"
|
no_recounts: "There are not daily recounts of this booth yet"
|
||||||
date: "Date"
|
date: "Date"
|
||||||
count_by_officer: "Daily recount (by officer)"
|
count_by_officer: "Daily recount (by officer)"
|
||||||
count_final: "Final recount (by officer)"
|
total_count: "Final recount (by officer)"
|
||||||
count_by_system: "Votes (automatic)"
|
count_by_system: "Votes (automatic)"
|
||||||
index:
|
index:
|
||||||
booths_title: "List of booths"
|
booths_title: "List of booths"
|
||||||
|
|||||||
@@ -97,11 +97,11 @@ feature 'Admin booths assignments' do
|
|||||||
officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment, date: poll.ends_at)
|
officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment, date: poll.ends_at)
|
||||||
final_officer_assignment = create(:poll_officer_assignment, :final, booth_assignment: booth_assignment, date: poll.ends_at)
|
final_officer_assignment = create(:poll_officer_assignment, :final, booth_assignment: booth_assignment, date: poll.ends_at)
|
||||||
|
|
||||||
final_recount = create(:poll_final_recount,
|
total_recount = create(:poll_total_result,
|
||||||
booth_assignment: booth_assignment,
|
booth_assignment: booth_assignment,
|
||||||
officer_assignment: final_officer_assignment,
|
officer_assignment: final_officer_assignment,
|
||||||
date: final_officer_assignment.date,
|
date: final_officer_assignment.date,
|
||||||
count: 5678)
|
amount: 5678)
|
||||||
|
|
||||||
booth_assignment_2 = create(:poll_booth_assignment, poll: poll)
|
booth_assignment_2 = create(:poll_booth_assignment, poll: poll)
|
||||||
|
|
||||||
@@ -112,8 +112,8 @@ feature 'Admin booths assignments' do
|
|||||||
|
|
||||||
click_link 'Recounts'
|
click_link 'Recounts'
|
||||||
within('#recounts_list') do
|
within('#recounts_list') do
|
||||||
within("#recounting_#{final_recount.date.strftime('%Y%m%d')}") do
|
within("#recounting_#{total_recount.date.strftime('%Y%m%d')}") do
|
||||||
expect(page).to have_content final_recount.count
|
expect(page).to have_content total_recount.amount
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user