adds Recounting tab to Poll's admin show view
This commit is contained in:
36
app/views/admin/poll/polls/_recounting.html.erb
Normal file
36
app/views/admin/poll/polls/_recounting.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<h3><%= t("admin.polls.show.recounting_title") %></h3>
|
||||
|
||||
<% if @poll.booth_assignments.empty? %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t("admin.polls.show.no_recounts") %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table class="margin">
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.table_booth_name") %></th>
|
||||
<th class="text-center"><%= t("admin.polls.show.table_recounts") %></th>
|
||||
<th class="text-center"><%= t("admin.polls.show.table_final_recount") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.booth_assignments.each do |booth_assignment| %>
|
||||
<tr id="<%= dom_id(booth_assignment) %>_recounts" class="booth_recounts">
|
||||
<td>
|
||||
<strong>
|
||||
<%= link_to booth_assignment.booth.name, admin_poll_booth_assignment_path(@poll, booth_assignment, anchor: 'tab-recounts') %>
|
||||
</strong>
|
||||
</td>
|
||||
<% if booth_assignment.recounts.any? %>
|
||||
<td class="text-center"><%= booth_assignment.recounts.to_a.sum(&:count) %></td>
|
||||
<% else %>
|
||||
<td class="text-center"> - </td>
|
||||
<% end %>
|
||||
<% if booth_assignment.final_recounts.any? %>
|
||||
<td class="text-center"><strong><%= booth_assignment.final_recounts.to_a.sum(&:count) %></strong></td>
|
||||
<% else %>
|
||||
<td class="text-center"> - </td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user