<%= render "shared/back_link" %>
<div class="clear"></div>

<h2 class="inline-block">
  <%= @poll.name %>
</h2>

<%= link_to t("admin.actions.edit"),
            edit_admin_poll_path(@poll),
            class: "button hollow float-right" %>

<%= link_to t("admin.polls.show.add_booth"),
            new_admin_poll_booth_path(@poll),
            class: "button success" %>

<% if @poll.booths.empty? %>
  <div class="callout primary">
    <%= t("admin.polls.show.no_booths") %>
  </div>
<% else %>
  <h2><%= t("admin.polls.show.booths_title") %></h2>

  <table>
    <thead>
      <th><%= t("admin.polls.show.name") %></th>
      <th><%= t("admin.polls.show.location") %></th>
      <th><%= t("admin.polls.show.officers") %></th>
      <th>&nbsp;</th>
    </thead>
    <tbody>
      <% @poll.booths.each do |booth| %>
        <%= render partial: "admin/poll/booths/booth", locals: { booth: booth } %>
      <% end %>
    </tbody>
  </table>
<% end %>