Complete booth assignment view list without actions yet
This commit is contained in:
@@ -47,6 +47,7 @@ class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
|
|||||||
|
|
||||||
def manage
|
def manage
|
||||||
@booths = ::Poll::Booth.all
|
@booths = ::Poll::Booth.all
|
||||||
|
@poll = Poll.find(params[:poll_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<tr id="booth_<%= booth.id %>" class="booth">
|
||||||
|
<td>
|
||||||
|
<%= link_to booth.name, admin_booth_path(booth) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= t("admin.booth_assignments.status.assigned") %>
|
||||||
|
<%= t("admin.booth_assignments.status.unassigned") %>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<%= link_to t("admin.booth_assignments.manage.assign"),
|
||||||
|
new_admin_booth_shift_path(booth),
|
||||||
|
class: "button" %>
|
||||||
|
<%= link_to t("admin.booth_assignments.manage.unassign"),
|
||||||
|
new_admin_booth_shift_path(booth),
|
||||||
|
class: "button hollow" %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
<h2 class="inline-block"><%= t("admin.booths.index.title") %></h2>
|
<%= link_to booth_assignments_admin_polls_path do %>
|
||||||
|
<span class="icon-angle-left"></span> <%= t("shared.back") %>
|
||||||
<% if controller_name == "booths" && action_name != "available" %>
|
|
||||||
<%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button success float-right" %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2 class="inline-block"><%= t("admin.booth_assignments.manage.assignments_list", poll: @poll.name) %></h2>
|
||||||
|
|
||||||
<% if @booths.empty? %>
|
<% if @booths.empty? %>
|
||||||
<div class="callout primary">
|
<div class="callout primary">
|
||||||
<%= t("admin.booths.index.no_booths") %>
|
<%= t("admin.booths.index.no_booths") %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% else %>
|
||||||
|
|
||||||
<% if @booths.any? %>
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<th><%= t("admin.booths.index.name") %></th>
|
<th><%= t("admin.booths.index.name") %></th>
|
||||||
|
<th><%= t("admin.booth_assignments.status.assign_status") %></th>
|
||||||
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @booths.each do |booth| %>
|
<% @booths.each do |booth| %>
|
||||||
|
<%= render partial: "booth_assignment", locals: { booth: booth } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -527,6 +527,15 @@ en:
|
|||||||
recount_scrutiny: Recount & Scrutiny
|
recount_scrutiny: Recount & Scrutiny
|
||||||
booth_assignments:
|
booth_assignments:
|
||||||
manage_assignments: Manage assignments
|
manage_assignments: Manage assignments
|
||||||
|
manage:
|
||||||
|
assignments_list: "Assignments for poll '%{poll}'"
|
||||||
|
status:
|
||||||
|
assign_status: Assignment
|
||||||
|
assigned: Assigned
|
||||||
|
unassigned: Unassigned
|
||||||
|
actions:
|
||||||
|
assign: Assign booth
|
||||||
|
unassign: Unassign booth
|
||||||
poll_booth_assignments:
|
poll_booth_assignments:
|
||||||
flash:
|
flash:
|
||||||
destroy: "Booth not assigned anymore"
|
destroy: "Booth not assigned anymore"
|
||||||
|
|||||||
@@ -527,6 +527,15 @@ es:
|
|||||||
recount_scrutiny: Recuento & Escrutinio
|
recount_scrutiny: Recuento & Escrutinio
|
||||||
booth_assignments:
|
booth_assignments:
|
||||||
manage_assignments: Gestionar asignaciones
|
manage_assignments: Gestionar asignaciones
|
||||||
|
manage:
|
||||||
|
assignments_list: "Asignaciones para la votación '%{poll}'"
|
||||||
|
status:
|
||||||
|
assign_status: Asignación
|
||||||
|
assigned: Asignada
|
||||||
|
unassigned: No asignada
|
||||||
|
actions:
|
||||||
|
assign: Assign booth
|
||||||
|
unassign: Unassign booth
|
||||||
poll_booth_assignments:
|
poll_booth_assignments:
|
||||||
flash:
|
flash:
|
||||||
destroy: "Urna desasignada"
|
destroy: "Urna desasignada"
|
||||||
|
|||||||
Reference in New Issue
Block a user