poll.html 1.66 KB
Newer Older
Jonathan Piacenti committed
1
{{ js_template|safe }}
2
<div class="poll-block" data-private="{% if private_results %}1{% endif %}">
Jonathan Piacenti committed
3
{# If no form is present, the Javascript will load the results instead. #}
4
{% if private_results or not choice %}
5
  <h3 class="poll-header">{{display_name}}</h3>
Jonathan Piacenti committed
6
  <form>
Jonathan Piacenti committed
7 8 9
      <div class="poll-question-container">
          {{question|safe}}
      </div>
10
      <ul class="poll-answers">
11
      {% for key, value in answers %}
Jonathan Piacenti committed
12
          <li class="poll-answer">
13
              <input type="radio" name="choice" id="{{url_name}}-answer-{{key}}" value="{{key}}" {% if choice == key %}checked{% endif %}/>
14 15
              {% if value.img %}
              <div class="poll-image">
16
                  <label for="{{url_name}}-answer-{{key}}" class="poll-image-label">
17 18 19 20 21 22
                      {% if value.img %}
                      <img src="{{value.img}}" />
                      {% endif %}
                  </label>
              </div>
              {% endif %}
23
              <label class="poll-answer" for="{{url_name}}-answer-{{key}}">{{value.label|safe}}</label>
Jonathan Piacenti committed
24 25 26
          </li>
      {% endfor %}
      </ul>
27
      <input class="input-main" type="button" name="poll-submit" value="{% if choice %}Resubmit{% else %}Submit{% endif %}" disabled />
28
  </form>
29 30 31 32 33 34 35 36 37 38
      <div class="poll-voting-thanks{% if not choice %} poll-hidden{% endif %}"><span>Thank you for your submission!</span></div>
      {% if feedback %}
      <div class="poll-feedback-container{% if not choice %} poll-hidden{% endif %}">
          <hr />
          <h3 class="poll-header">Feedback</h3>
          <div class="poll-feedback">
              {{feedback|safe}}
          </div>
      </div>
      {% endif %}
Jonathan Piacenti committed
39
{% endif %}
40
</div>