Replace FinalResult with TotalResult at admin BoothAssignment show

This commit is contained in:
Bertocq
2017-09-18 20:49:34 +02:00
parent 8cae97d98d
commit f27fcc7f99
7 changed files with 12 additions and 19 deletions

View File

@@ -49,18 +49,18 @@
<thead>
<tr>
<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>
</tr>
</thead>
<tbody>
<% (@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 %>
<tr id="recounting_<%= voting_date.strftime('%Y%m%d') %>">
<td><%= l voting_date %></td>
<% if final_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>
<% if total_recount.present? %>
<td class="text-center <%= 'count-error' if total_recount.amount != system_count %>" title="<%= total_recount.officer_assignment.officer.name %>"><%= total_recount.amount %></td>
<% else %>
<td class="text-center" title=""> - </td>
<% end %>