{% load i18n %}

<form method="post" action="{% url 'forum_conversation:topic_poll_vote' poll.pk %}" class="form" novalidate>
  {% csrf_token %}

  {% for option in poll_form.options.field.queryset %}
  {% if forloop.first or not forloop.counter|divisibleby:2 %}
  <div class="row">
  {% endif %}
  <div class="col-md-6">
    <div class="well well-sm">
      {% if poll.max_options == 1 %}
      <div class="radio">
        <label class="peer-checked:text-orange">
          <input type="radio" name="options" value="{{ option.id }}" class="mr-1 rounded-full border cursor-pointer bg-charcoal peer checked:bg-orange hover:bg-orange">
          {{ option.text }}
        </label>
      </div>
      {% else %}
      <div class="checkbox">
        <label class="peer-checked:text-orange">
          <input type="checkbox" name="options" value="{{ option.id }}" class="mr-1 rounded-sm border cursor-pointer bg-charcoal peer checked:bg-orange hover:bg-orange">
          {{ option.text }}
        </label>
      </div>
      {% endif %}
    </div>
  </div>
  {% if forloop.last or forloop.counter|divisibleby:2 %}
  </div>
  {% endif %}
  {% endfor %}

  <div class="my-4 form-actions">
    <input type="submit" class="py-2 px-3 text-sm uppercase rounded rounded-lg border border-orange text-orange" value="{% trans "Submit" %}" />
    <a href="{% if change_vote_action %}.{% else %}?view_results=true{% endif %}" class="py-2 px-3 text-sm uppercase rounded rounded-lg border border-slate text-orange">{% trans "View results" %}</a>
  </div>
</form>
