Add Task selection on Poll Shift creation, and on shifts table
This commit is contained in:
@@ -54,7 +54,7 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController
|
||||
end
|
||||
|
||||
def shift_params
|
||||
params.require(:shift).permit(:booth_id, :officer_id, :date)
|
||||
params.require(:shift).permit(:booth_id, :officer_id, :date, :task)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -6,13 +6,21 @@
|
||||
<%= t("admin.poll_shifts.new.new_shift") %>
|
||||
</legend>
|
||||
|
||||
<div class="small-12 medium-4 column highlight padding">
|
||||
<div class="small-12 medium-3 column highlight padding">
|
||||
<strong><%= t("admin.poll_shifts.new.officer") %></strong>
|
||||
<br><%= @officer.name %>
|
||||
<%= f.hidden_field :officer_id, value: @officer.id %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<div class="small-12 medium-3 column">
|
||||
<label><%= t("admin.poll_shifts.new.task") %></label>
|
||||
<%= f.select :task,
|
||||
Poll::Shift.tasks.map {|k,v| [t("admin.poll_shifts.#{k}"), k]},
|
||||
prompt: t("admin.poll_shifts.new.select_task"),
|
||||
label: false %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<label><%= t("admin.poll_shifts.new.date") %></label>
|
||||
<%= f.select :date,
|
||||
shift_dates_select_options(@polls),
|
||||
@@ -22,7 +30,7 @@
|
||||
|
||||
<%= f.hidden_field :booth_id, value: @booth.id %>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.submit t("admin.poll_shifts.new.add_shift"),
|
||||
class: "button expanded margin-top" %>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<tr>
|
||||
<th><%= t("admin.poll_shifts.new.date") %></th>
|
||||
<th><%= t("admin.poll_shifts.new.officer") %></th>
|
||||
<th><%= t("admin.poll_shifts.new.task") %></th>
|
||||
<th class="text-right"><%= t("admin.poll_shifts.new.shift") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -12,6 +13,7 @@
|
||||
<tr id="shift_<%= shift.id %>" class="shift">
|
||||
<td><%= l(shift.date.to_date, format: :long) %></td>
|
||||
<td><%= shift.officer_name %></td>
|
||||
<td><%= t("admin.poll_shifts.#{shift.task}") %></td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.poll_shifts.new.remove_shift"),
|
||||
admin_booth_shift_path(@booth, shift),
|
||||
|
||||
@@ -503,6 +503,7 @@ en:
|
||||
shift: "Assignment"
|
||||
shifts: "Shifts in this booth"
|
||||
date: "Date"
|
||||
task: "Task"
|
||||
edit_shifts: Edit shifts
|
||||
new_shift: "New shift"
|
||||
no_shifts: "This booth has no shifts"
|
||||
@@ -512,12 +513,15 @@ en:
|
||||
search_officer_placeholder: Search officer
|
||||
search_officer_text: Search for an officer to assign a new shift
|
||||
select_date: "Select day"
|
||||
select_task: "Select task"
|
||||
table_shift: "Shift"
|
||||
table_email: "Email"
|
||||
table_name: "Name"
|
||||
flash:
|
||||
create: "Shift added"
|
||||
destroy: "Shift removed"
|
||||
vote_collection: Collect Votes
|
||||
recount_scrutiny: Recount & Scrutiny
|
||||
poll_booth_assignments:
|
||||
flash:
|
||||
destroy: "Booth not assigned anymore"
|
||||
|
||||
@@ -503,6 +503,7 @@ es:
|
||||
shift: "Asignación"
|
||||
shifts: "Turnos en esta urna"
|
||||
date: "Fecha"
|
||||
task: "Tarea"
|
||||
edit_shifts: Asignar turno
|
||||
new_shift: "Nuevo turno"
|
||||
no_shifts: "Esta urna no tiene turnos asignados"
|
||||
@@ -512,12 +513,15 @@ es:
|
||||
search_officer_placeholder: Buscar presidentes de mesa
|
||||
search_officer_text: Busca al presidente de mesa para asignar un turno
|
||||
select_date: "Seleccionar día"
|
||||
select_task: "Seleccionar tarea"
|
||||
table_shift: "Turno"
|
||||
table_email: "Email"
|
||||
table_name: "Nombre"
|
||||
flash:
|
||||
create: "Añadido turno de presidente de mesa"
|
||||
destroy: "Eliminado turno de presidente de mesa"
|
||||
vote_collection: Recoger Votos
|
||||
recount_scrutiny: Recuento & Escrutinio
|
||||
poll_booth_assignments:
|
||||
flash:
|
||||
destroy: "Urna desasignada"
|
||||
|
||||
Reference in New Issue
Block a user