70 lines
2.6 KiB
Plaintext
70 lines
2.6 KiB
Plaintext
<%= link_to admin_poll_path(@poll, anchor: 'tab-officers') do %>
|
|
<span class="icon-angle-left"></span>
|
|
<%= @poll.name %>
|
|
<% end %>
|
|
|
|
<h2><%= @officer.name %> - <%= @officer.email %></h2>
|
|
|
|
<%= form_tag(admin_officer_assignments_path, {id: "officer_assignment_form"}) do %>
|
|
<fieldset class="fieldset">
|
|
<legend><%= t("admin.poll_officer_assignments.index.new_assignment") %></legend>
|
|
<div class="small-12 medium-4 column">
|
|
<label><%= t("admin.poll_officer_assignments.index.date") %></label>
|
|
<%= select_tag :date,
|
|
poll_dates_select_options(@poll) + poll_final_recount_option(@poll),
|
|
{ prompt: t("admin.poll_officer_assignments.index.select_date"),
|
|
label: false } %>
|
|
</div>
|
|
|
|
<div class="small-12 medium-4 column">
|
|
<label><%= t("admin.poll_officer_assignments.index.booth") %></label>
|
|
<%= select_tag :booth_id,
|
|
poll_booths_select_options(@poll),
|
|
{ prompt: t("admin.poll_officer_assignments.index.select_booth"),
|
|
label: false } %>
|
|
</div>
|
|
|
|
<div class="small-12 medium-4 column">
|
|
<%= hidden_field_tag :officer_id, @officer.id %>
|
|
<%= hidden_field_tag :poll_id, @poll.id %>
|
|
<%= submit_tag t("admin.poll_officer_assignments.index.add_assignment"),
|
|
class: "button expanded hollow margin-top" %>
|
|
</div>
|
|
</fieldset>
|
|
<% end %>
|
|
|
|
|
|
<% if @officer_assignments.empty? %>
|
|
<div class="callout primary margin-top">
|
|
<%= t("admin.poll_officer_assignments.index.no_assignments") %>
|
|
</div>
|
|
<% else %>
|
|
<h3><%= t("admin.poll_officer_assignments.index.assignments") %></h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.poll_officer_assignments.index.date") %></th>
|
|
<th><%= t("admin.poll_officer_assignments.index.booth") %></th>
|
|
<th class="text-center"><%= t("admin.poll_officer_assignments.index.assignment") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @officer_assignments.each do |officer_assignment| %>
|
|
<tr id="<%= dom_id officer_assignment %>">
|
|
<td><%= officer_assignment.final? ? t('polls.final_date') : l(officer_assignment.date.to_date) %></td>
|
|
<td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
|
|
<td class="text-center">
|
|
<%= link_to t("admin.poll_officer_assignments.index.remove_assignment"),
|
|
admin_officer_assignment_path(officer_assignment),
|
|
method: :delete,
|
|
class: "button hollow alert" %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %>
|
|
|
|
|
|
|