displays results for booth
This commit is contained in:
@@ -18,6 +18,7 @@ class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
|
||||
@booth_assignment = @poll.booth_assignments.includes(:recounts, :voters,
|
||||
officer_assignments: [officer: [:user]]).find(params[:id])
|
||||
@voters_by_date = @booth_assignment.voters.group_by {|v| v.created_at.to_date}
|
||||
@partial_results = @booth_assignment.partial_results
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
11
app/views/admin/poll/booth_assignments/_results.html.erb
Normal file
11
app/views/admin/poll/booth_assignments/_results.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<div id="poll-resources">
|
||||
<h3><%= t("admin.results.index.title") %></h3>
|
||||
|
||||
<% if @partial_results.empty? %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t("admin.results.index.no_results") %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render "admin/poll/results/result" %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -17,9 +17,12 @@
|
||||
<li class="tabs-title">
|
||||
<%= link_to t("admin.poll_booth_assignments.show.officers"), "#tab-officers" %>
|
||||
</li>
|
||||
<li class="tabs-title is-active">
|
||||
<li class="tabs-title">
|
||||
<%= link_to t("admin.poll_booth_assignments.show.recounts"), "#tab-recounts" %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "Results", "#tab-results" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tabs-panel" id="tab-officers">
|
||||
@@ -43,7 +46,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="tabs-panel is-active" id="tab-recounts">
|
||||
<div class="tabs-panel" id="tab-recounts">
|
||||
<h3><%= t("admin.poll_booth_assignments.show.recounts_list") %></h3>
|
||||
|
||||
<table id="totals">
|
||||
@@ -55,8 +58,12 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center" id="total_final"><%= total_recounts_by_booth(@booth_assignment) || '-' %></td>
|
||||
<td class="text-center" id="total_system"><%= @booth_assignment.voters.count %></td>
|
||||
<td class="text-center" id="total_final">
|
||||
<%= total_recounts_by_booth(@booth_assignment) || '-' %>
|
||||
</td>
|
||||
<td class="text-center" id="total_system">
|
||||
<%= @booth_assignment.voters.count %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -79,4 +86,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tabs-panel is-active" id="tab-results">
|
||||
<%= render "results" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user