<% content_for "title" do %>Tug of Vote<% end %>
<% content_for "og_desc" do %>Tug of Vote, a poll service.<% end %>

<section>
  <h2>Create new Ballot</h2>
  <%- if list_cap -%>
    <p>The vote link to this Ballot will be automatically added to the list <a href="/cap/<%= list_cap.cap_slug %>"><%= list.not_nil!.title %></a>.
  <%- end -%>
  <form action="/new_ballot" method="POST">
    <%- if list_cap -%>
      <input type="hidden" name="listcap" value="<%= list_cap.cap_slug %>">
    <%- end -%>
    <label for="title">Title</label>
    <input name="title" id="title" required maxlength="200">
    <label for="text-description">Detailed description</label>
    <textarea name="description" id="text-description" maxlength="20000"></textarea>
    <label for="text-candidates">Candidates, one per line</label>
    <textarea name="candidates" id="text-candidates" required maxlength="2000"></textarea>
    <label for="duration">Ballot duration</label>
    <select id="duration" name="duration">
      <option value="nil">Indefinite</option>
      <option value="1">1 hour</option>
      <option value="6">6 hours</option>
      <option value="24">24 hours</option>
      <option value="48">48 hours</option>
      <option value="168">168 hours/one week</option>
      <option value="672">672 hours/four weeks</option>
    </select>
    <label for="hide-names" class="checkbox-label">Hide names of voters</label>
    <input name="hide-names" id="hide-names" type="checkbox" checked>
    <br>
    <button>Go!</button>
  </form>
</section>
