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

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

  <h3><%= t("admin.results.index.title") %></h3>

  <% if @partial_results.empty? && @poll.voters.empty? %>
    <div class="callout primary margin-top">
      <%= t("admin.results.index.no_results") %>
    </div>
  <% end %>

  <% if @partial_results.present? %>
    <%= render "recount", resource: @poll %>

    <% @poll.questions.each do |question| %>
      <%= render Admin::Poll::Results::QuestionComponent.new(question, @partial_results) %>
    <% end %>

    <%= render "results_by_booth" %>
  <% end %>

  <% if @poll.voters.any? %>
    <%= render "show_results", resource: @poll %>
  <% end %>
</div>
