{% from 'forms/_form.html' import form_row %} {% macro render_questionnaire_preview(survey, preview_form, field_types) %} {% for section in survey.sections %}
{% if section.display_as_section %} {{ section.title }} {% else %} {%- trans %}Standalone section{% endtrans -%} {% endif %}
{% trans %}Add text item{% endtrans %} {% trans %}Add question{% endtrans %}
{% if section.description %}
{{ section.description }}
{% endif %}
{% if not section.children %}
{% trans -%} No items have been added yet so this section will not be displayed. {%- endtrans %}
{% else %}
{% endif %}
{% endfor %} {% endmacro %} {% macro _render_item() %}
{{ caller() }}
{% endmacro %} {% macro _render_question(question, preview_form) %} {% call _render_item() %}
{{ form_row(preview_form['question_{}'.format(question.id)], disabled=true, orientation='vertical') }}
{% endcall %} {% endmacro %} {% macro _render_text(text) %} {% call _render_item() %}
{{- text.description|replace('\n', '
'|safe) -}}
{% endcall %} {% endmacro %}