{% macro digitalmarketplaceQuestionListMultiquestion(params) %} {%- from "govuk_frontend_jinja/components/fieldset/macro.html" import govukFieldset -%} {%- from "govuk_frontend_jinja/components/button/macro.html" import govukButton -%} {%- from "digitalmarketplace_frontend_jinja/components/question/macro.html" import digitalmarketplaceQuestion -%} {% if params.question.questions -%} {% call govukFieldset({ "legend": { "text": params.question.question, "classes": 'govuk-fieldset__legend--m' }, "attributes": { 'data-module': "dm-question-list-multiquestion", 'data-max-number-of-items': params.max_number_of_items } }) %} {% if params.question.question_advice %}
{{ params.question.question_advice | safe }}
{% endif %}
{% for multi_question in params.question.questions %} {% if multi_question.questions -%}
{% call govukFieldset({ "legend": { "text": multi_question.question, "classes": 'govuk-fieldset__legend--m' } }) %} {% if multi_question.question_advice %}
{{ multi_question.question_advice | safe }}
{% endif %}
{% for question in multi_question.questions %}
{{ digitalmarketplaceQuestion({ "type": question.type, "question": question, "data": params.data, "errors": params.errors, "frameworkReusedFrom": params.frameworkReusedFrom }) }}
{% endfor %}
{% endcall %}
{%- endif %} {% endfor %}
{{ govukButton({ "html": 'Remove item 0', "classes": 'govuk-button--secondary dm-list-multiquestion__item-remove govuk-visually-hidden', "type": 'button' })}}
{{ govukButton({ "html": 'Add item (0 remaining)', "classes": 'govuk-button--secondary dm-list-multiquestion__item-add govuk-visually-hidden', "type": 'button' })}}
{% endcall %} {%- endif %} {% endmacro %}