{% extends '::base.html.twig' %}

{% block title %}{{ survey.title }} Results{% endblock %}

{% block body -%}
    {% set count = survey.users|length %}
    <h1>{{ survey.title }} <small>{{ count }} {{ (count == 1) ? 'participant' : 'participants' }}</small></h1>
    <hr>

    {% for question in survey.questions %}
        <h3>{{ question.title }}</h3>
        <dl class="dl-horizontal">
            {% for answer in question.answers %}
                {%- set other = [] -%}
                {%- for vote in answer.votes -%}
                    {%- if vote.other -%}
                        {%- set other = other|merge([vote.other]) -%}
                    {%- endif -%}
                {%- endfor -%}

                <dt>{{ answer.title|raw }}</dt>
                <dd>
                    {% set count = answer.votes|length %}
                    {{ count }} {{ (count == 1) ? 'vote' : 'votes' }}
                    {% if other is not empty %}
                        ({{ other|join(', ') }})
                    {% endif %}
                </dd>
            {% endfor %}
        </dl>
        <hr>
    {% endfor %}

    <a class="btn btn-default" href="{{ path('survey') }}">
        Back to the list
    </a>
{% endblock %}

{% extends '::base.html.twig' %}

{% block title %}{{ survey.title }} Results{% endblock %}

{% block body -%}
    {% set count = survey.users|length %}
    <div class="page-header">
        <h1>{{ survey.title }} <small>{{ count }} {{ (count == 1) ? 'participant' : 'participants' }}</small></h1>
    </div>

    {% for question in survey.questions %}
        <h3>{{ question.title }}</h3>
        <dl class="dl-horizontal">
            {% for answer in question.answers %}
                {%- set other = [] -%}
                {%- for vote in answer.votes -%}
                    {%- if vote.other -%}
                        {%- set other = other|merge([vote.other]) -%}
                    {%- endif -%}
                {%- endfor -%}

                <dt>{{ answer.title|raw }}</dt>
                <dd>
                    {%- set count = answer.votes|length -%}
                    {{ count }} {{ (count == 1) ? 'vote' : 'votes' }}
                    {% if other is not empty -%}
                        (
                        {%- for response in other -%}
                            <code>{{ response }}</code>
                            {{- not loop.last ? ', '}}
                        {%- endfor -%}
                        )
                    {%- endif -%}
                </dd>
            {% endfor %}
        </dl>
        <hr>
    {% endfor %}

    <a class="btn btn-default" href="{{ path('survey') }}">
        Back to the list
    </a>
{% endblock %}

Add styles so that different 'Other' responses can be told apart on results
Add styles so that different 'Other' responses can be told apart on results

Closes #2
