{% extends 'creme_core/bricks/base/list.html' %} {% load i18n creme_bricks polls_tags %} {% load mult print_field from creme_core_tags %} {% block brick_extra_class %}{{block.super}} polls-list-brick polls-stats-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('Statistics') %} {% endblock %} {% block brick_content %} {% for node in nodes %}
{% if node.is_section %}
{% poll_node_number style node %}
{% print_field object=node field='name' %} {% print_field object=node field='body' %}
{% else %}
{% if node.number %}
{% poll_node_number style node %}
{% endif %}
{{node.question}}
{{node.poll_line_type.description}}
{% if node.answer_count > 0 %}
{% blocktranslate count total=node.answer_count %}{{total}} reply{% plural %}{{total}} replies{% endblocktranslate %}
{% endif %}
{% for answer, count, ratio in node.answer_stats %}
{{ answer }}
{{ ratio|floatformat:'2' }} %
{{count}}
{% empty %}
{% if node.applicable %}{% translate 'Statistics are not available for the moment' context "polls" %}{% else %}−{% endif %}
{% endfor %} {% resetcycle %} {% if node.answer_zeros %}
{% blocktranslate count total=node.answer_zeros|length %}Not chosen{% plural %}Not chosen{% endblocktranslate %}
{% for answer, count, ratio in node.answer_zeros %}
{{ answer }}
{% endfor %}
{% endif %}
{% endif %}
{% empty %}
{% translate 'No question or section for the moment' %}
{% endfor %} {% endblock %}