Fix admin poll officers assignments by officer view

This commit is contained in:
Bertocq
2017-09-19 01:38:02 +02:00
parent 2e3b5aad49
commit 630a3252b7

View File

@@ -27,10 +27,7 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %>
<% final_officer_assignments = @officer_assignments.select{|oa| oa.final == true} %>
<% if final_officer_assignments.any? %>
<h3><%= t("admin.poll_officer_assignments.by_officer.total_recounts") %></h3> <h3><%= t("admin.poll_officer_assignments.by_officer.total_recounts") %></h3>
<table id="total_recount_list" class="fixed"> <table id="total_recount_list" class="fixed">
<thead> <thead>
@@ -41,13 +38,13 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% final_officer_assignments.each do |officer_assignment| %> <% @officer_assignments.each do |officer_assignment| %>
<tr id="total_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>"> <tr id="total_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>">
<td><%= l(officer_assignment.date.to_date) %></td> <td><%= l(officer_assignment.date.to_date) %></td>
<td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td> <td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
<td class="text-right"> <td class="text-right">
<% if officer_assignment.total_recounts.any? %> <% if officer_assignment.total_results.any? %>
<%= officer_assignment.total_recounts.to_a.sum(&:amount) %> <%= officer_assignment.total_results.to_a.sum(&:amount) %>
<% else %> <% else %>
<span>-</span> <span>-</span>
<% end %> <% end %>