Files
grecia/app/views/officing/final_recounts/new.html.erb
Juanjo Bazán 70d00a9768 adds all recounts to offering final recounts list
so poll officers can compare
2017-01-30 20:16:02 +01:00

80 lines
2.7 KiB
Plaintext

<% if @officer_assignments.any? %>
<h2><%= t("officing.final_recounts.new.title", poll: @poll.name) %></h2>
<%= form_tag(officing_poll_final_recounts_path(@poll), {id: "officer_assignment_form"}) do %>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("officing.final_recounts.new.booth") %></label>
<%= select_tag :officer_assignment_id,
booths_for_officer_select_options(@officer_assignments),
{ prompt: t("officing.final_recounts.new.select_booth"),
label: false } %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("officing.final_recounts.new.date") %></label>
<%= select_tag :date,
poll_dates_select_options(@poll),
{ prompt: t("officing.final_recounts.new.select_date"),
label: false } %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 large-4 column">
<label><%= t("officing.final_recounts.new.count") %></label>
<%= text_field_tag :count, nil, placeholder: t("officing.final_recounts.new.count_placeholder") %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 large-4 column">
<%= submit_tag t("officing.final_recounts.new.submit"), class: "button expanded" %>
</div>
</div>
<% end %>
<% else %>
<h2><%= @poll.name %></h2>
<div class="callout alert">
<%= t("officing.final_recounts.new.not_allowed") %>
</div>
<% end %>
<% if @final_recounts.any? %>
<hr>
<h3><%= t("officing.final_recounts.new.final_recount_list") %></h3>
<table>
<thead>
<th><%= t("officing.final_recounts.new.date") %></th>
<th><%= t("officing.final_recounts.new.booth") %></th>
<th><%= t("officing.final_recounts.new.count") %></th>
<th><%= "Recuento diario anterior" %></th>
<th><%= "Recuento del sistema" %></th>
</thead>
<tbody>
<% @final_recounts.each do |final_recount| %>
<tr id="<%= dom_id(final_recount) %>">
<td>
<%= l(final_recount.date.to_date, format: :long) %>
</td>
<td>
<%= final_recount.booth_assignment.booth.name %>
</td>
<td>
<strong><%= final_recount.count %></strong>
</td>
<td>
<strong><%= recount_to_compare_with_final_recount final_recount %></strong>
</td>
<td>
<strong><%= system_recount_to_compare_with_final_recount final_recount %></strong>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>