{% if self.show_results and results %}
  {% if self.display_survey_directly %}

    {# include template "patterns/basics/headings/sp_variations/heading.html" #}
      {% trans 'Your '|add:surveytype|add:' has been completed successfully. See results' as headingtext %}
      {% with type="subheading" htmltag="h4" title=headingtext %}
        <div class="heading heading__{{type}} {{extraclass}}">
          <{{htmltag}}>{{title}}</{{htmltag}}>
        </div>
      {% endwith %}
    {# end include template #}

      <ul class="polls-results-list">
      {% for question, answers in results.items %}
      <label class="{{surveytypeClass}}__question">{{ question|capfirst }}</label>
        {% for answer, count in answers.items %}
        <li class="{{surveytypeClass}}-results-list__item">
          {% if self.show_results_as_percentage %}
            {{answer}}
            <div class="{{surveytypeClass}}-results-list__percent">
              <div class="{{surveytypeClass}}-results-list__percent-bar" style="width:{{ count }}%">
                <span class="choice-percentage">{{ count }}%</span>
              </div>
            </div>
          {% else %}
            <h4 class="{{surveytypeClass}}__answers-counter">
              {{answer}} -
              {{ count }} vote{{ count|pluralize }}</h4>
          {% endif %}
        </li>
        {% endfor %}
      {% endfor %}
      </ul>
  {% else %}

        {# include template "patterns/basics/headings/sp_variations/heading.html" #}
          {% trans 'Your '|add:surveytype|add:' has been completed successfully!' as headingtext %}
          {% with type="subheading" htmltag="h4" title=headingtext %}
            <div class="heading heading__{{type}} {{extraclass}}">
              <{{htmltag}}>{{title}}</{{htmltag}}>
            </div>
          {% endwith %}
        {# end include template #}

  {% endif %}
{% endif %}

