{% macro renderPager(pager, surveyId, orderedBy, order, max) %} {{ pagerfanta( pager, 'twitter_bootstrap_translated', { 'proximity' : 1, 'routeName': 'claro_survey_questions_list', 'routeParams': { 'survey': surveyId, 'orderedBy': orderedBy, 'order': order, 'max': max } } ) }} {% endmacro %} {% macro sortUrl(surveyId, orderedBy, order) %} {% if order == 'ASC' %} {% set newOrder = 'DESC' %} {% else %} {% set newOrder = 'ASC' %} {% endif %} {{ path('claro_survey_questions_list', {'survey': surveyId, 'orderedBy': orderedBy, 'order': newOrder }) }} {% endmacro %} {% from _self import renderPager %} {% from _self import sortUrl %} {% set surveyId = survey.getId() %} {% if questions|length == 0 %} {% else %}
{% for question in questions %} {% endfor %}
{{ 'title'|trans({}, 'survey') }} {{ 'type'|trans({}, 'survey') }}
{{ question.getTitle() }} {{ question.getType()|trans({}, 'survey') }} {{ 'add'|trans({}, 'platform') }}
{% if questions.getNbPages() > 1 %} {{ renderPager(questions, surveyId, orderedBy, order, max) }} {% endif %} {% endif %}