{% macro digitalmarketplaceQuestionFormula(params) %} {%- from "govuk_frontend_jinja/components/fieldset/macro.html" import govukFieldset -%} {%- from "govuk_frontend_jinja/components/label/macro.html" import govukLabel -%} {%- from "govuk_frontend_jinja/components/hint/macro.html" import govukHint -%} {%- from "govuk_frontend_jinja/components/error-message/macro.html" import govukErrorMessage -%} {%- from "digitalmarketplace_frontend_jinja/components/question-format-hint/macro.html" import digitalmarketplaceQuestionFormatHint -%} {%- if params.question.questions -%} {% call govukFieldset({ "legend": { "text": params.question.question, "classes": 'govuk-fieldset__legend--m' } }) %} {%- if params.question.question_advice -%}
| Question | Answer |
|---|---|
| {{ question.operation }} | |
| {{ question.question }} | {{ question.value }} |
| {{ govukLabel({ "html": questionText, "classes": "govuk-label--s", "for": id }) | trim | indent(2) }} {% if question.hint or question.question_advice %} {% set hintId = id + '-hint' %} {% set describedBy = describedBy + ' ' + hintId %} {{ govukHint({ "id": hintId, "html": digitalmarketplaceQuestionFormatHint(question) }) | trim | indent(2) }} {% endif %} {% if params.errors and params.errors[name] %} {% set errorId = id + '-error' %} {% set rowQuestionClasses = "dm-question-formula--error "%} {% set describedBy = describedBy + ' ' + errorId %} {% set errorMessage = params.errors[name]["message"] %} {{ govukErrorMessage({ "id": errorId, "text": errorMessage }) | trim | indent(2) }} {% endif %} | {{ govukHint({ "text": 'You can enter up to ' + (question.max_length_in_words | string) + ' words', "id": id + '-info', "classes": 'govuk-character-count__message' }) | trim }} |
| {{ govukLabel({ "html": questionText, "classes": "govuk-label--s", "for": id }) | trim | indent(2) }} {% if question.hint or question.question_advice %} {% set hintId = id + '-hint' %} {% set describedBy = (describedBy + ' ' + hintId) if describedBy else hintId %} {{ govukHint({ "id": hintId, "html": digitalmarketplaceQuestionFormatHint(question) }) | trim | indent(2) }} {% endif %} {% if params.errors and params.errors[name] %} {% set errorId = id + '-error' %} {% set rowQuestionClasses = "dm-question-formula--error "%} {% set describedBy = (describedBy + ' ' + errorId) if describedBy else errorId %} {% set errorMessage = params.errors[name]["message"] %} {{ govukErrorMessage({ "id": errorId, "text": errorMessage }) | trim | indent(2) }} {% endif %} | |
| {{ question.operation }} | |