{{ js_template|safe }}
<div class="poll-block" data-private="{% if private_results %}1{% endif %}">
    {# If no form is present, the Javascript will load the results instead. #}
    {% if not choices or private_results %}
    <h3 class="poll-header">{{block_name}}</h3>
    <form>
        <table class="survey-table">
            <thead>
              <tr>
                  <th></th>
                  {% for answer, label in answers %}
                    <th class="survey-answer">{{label}}</th>
                  {% endfor %}
              </tr>
            </thead>
        {% for key, question in questions %}
            <tr class="survey-row">
                <td class="survey-question">
                    {% if question.img %}
                        <div class="poll-image-td">
                                <img src="{{question.img}}" />
                        </div>
                    {% endif %}
                  {{question.label|safe}}
                </td>
            {% for answer, answer_details in answers %}
                <td class="survey-option">
                    <input type="radio" name="{{key}}" value="{{answer}}"{% if question.choice == answer %} checked{% endif %}/>
                </td>
            {% endfor %}
            </tr>
        {% endfor %}
        </table>
        <input class="input-main" type="button" name="poll-submit" value="{% if choices %}Resubmit{% else %}Submit{% endif %}" disabled />
    </form>
    <div class="poll-voting-thanks{% if not choices %} poll-hidden{% endif %}"><span>Thank you for your submission!</span></div>
    {% if feedback %}
        <div class="poll-feedback-container{% if not choices %} poll-hidden{% endif %}">
            <hr />
            <h3 class="poll-header">Feedback</h3>
            <div class="poll-feedback">
                {{feedback|safe}}
            </div>
        </div>
    {% endif %}
    {% endif %}
</div>
