<%= render "/admin/poll/polls/poll_header" %>

<div id="poll-resources">
  <%= render "/admin/poll/polls/subnav" %>
  <%= render "search_booths" %>

  <h3><%= t("admin.poll_booth_assignments.index.booths_title") %></h3>

  <%= link_to t("admin.booth_assignments.manage_assignments"),
              manage_admin_poll_booth_assignments_path(@poll),
              class: "button hollow float-right" %>

  <% if @booth_assignments.empty? %>
    <div class="callout primary margin-top">
      <%= t("admin.poll_booth_assignments.index.no_booths") %>
    </div>
  <% else %>
    <table id="assigned_booths_list" class="fixed margin">
      <thead>
        <th><%= t("admin.poll_booth_assignments.index.table_name") %></th>
        <th><%= t("admin.poll_booth_assignments.index.table_location") %></th>
      </thead>
      <tbody>
        <% @booth_assignments.each do |booth_assignment| %>
          <tr id="<%= dom_id(booth_assignment) %>" class="booth">
            <td>
              <strong>
                <%= link_to booth_assignment.booth.name, admin_poll_booth_assignment_path(@poll, booth_assignment) %>
              </strong>
            </td>
            <td>
              <%= booth_assignment.booth.location || t("admin.booths.index.no_location") %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>

    <%= paginate @booth_assignments %>
  <% end %>
</div>
