{% set conditions = demi_getTradeConditions(type, organisationInfo, cart, standardInformation is defined ? standardInformation : null) %}
{% set modalId = 0 %}
<div class="js-payment-details__conditions-loading" hidden>
<div class="text-center my-3">
{{ include('@ElementsDemiFrontend/Includes/elements/spinner/loading-spinner.html.twig') }}
</div>
</div>
<div class="js-payment-details__conditions-result">
<div>
{% for condition in conditions %}
{% if 'link' not in condition['type'] %}
{{ include('@ElementsDemiFrontend/Includes/modals/modal.html.twig', {
'type': condition['type'],
'modalId': modalId,
'text': condition['text'],
'title': condition['title'],
'item': null,
'occupancyString': null,
'giftItem': null,
'cancelInfoTexts': null,
'showPdfLink': condition['type'] != "pp" and condition['type'] != constant("\\Elements\\Bundle\\DemiFrontendBundle\\Service\\Condition::TYPE_GROUP_REQUEST") and condition['type'] != constant("\\Elements\\Bundle\\DemiFrontendBundle\\Service\\Condition::TYPE_POOL_REQUEST"),
'id': condition['id']
}) }}
<input type="hidden" name="{{ condition['type']}}-text" value="{{ (condition['text']|replace({'"': '\''}))|escape }}" />
{% endif %}
{% endfor %}
</div>
{% set conditionCount = (conditions is iterable and conditions['privacyStatement'] is defined) ? 1 : 0 %}
{% if conditions is iterable and conditions|length > conditionCount %}
<div class="js-form-group">
<div class="custom-checkbox">
<label>
<input id="conditions" class="custom-checkbox__input" type="checkbox" name="conditions"
required> <span class="custom-checkbox__box mr-2 demi-icon demi-icon-check"></span>
</label>
<div class="custom-checkbox__text">
<label for="conditions" class="font-medium d-inline">{{ 'demi.booking.checkout.condition-check'|trans }}</label>
<ul class="list-default mt-2">
{% for key, condition in conditions %}
{% if key != 'privacyStatement' and key != 'insuranceCondition' %}
<li>
{% if 'link' in condition['type'] %}
<a href="{{ condition['text'] }}" target="_blank" class="text-primary text-underline py-1">
{{ condition['translation'] }}
</a>
<input type="hidden" name="{{ condition['type'] }}-text" value="{{ (condition['translation']|escape)|replace({'"': '\''}) }}" />
{% else %}
<button type="button" class="btn-no-styling text-primary text-underline py-1" data-toggle="modal" data-target="#{{ condition['type'] }}-{{ modalId }}">
{{ condition['translation'] }}
</button>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
<div class="form-errors mt-1"></div>
</div>
{% endif %}
{% if conditions is iterable and conditions['privacyStatement'] is defined %}
<div class="form-group mb-0{{ conditions|length > 1 ? ' mt-3' : ''}}">
<div class="custom-checkbox">
<div class="custom-checkbox__text">
<label class="font-medium d-inline wysiwyg">
{% set button = '<button type="button" class="font-default btn-no-styling text-primary text-underline" data-toggle="modal" data-target="#' ~ conditions['privacyStatement']['type'] ~ '-' ~ modalId ~ '">' ~ conditions['privacyStatement']['translation'] ~ '</button>' %}
{{ demi_fillTranslation({"[PRIVACY_POLICY]": button}, "demi.booking.checkout.title-privacy-statement-text") }}
</label>
</div>
</div>
<div class="form-errors mt-1"></div>
</div>
{% endif %}
{% if conditions is iterable and conditions['insuranceCondition'] is defined %}
<div class="form-group mb-0{{ conditions|length > 1 ? ' mt-3' : ''}}">
<div class="custom-checkbox">
<label>
<input id="{{ conditions['insuranceCondition']['type'] }}"
class="custom-checkbox__input" type="checkbox" name="{{ conditions['insuranceCondition']['type'] }}"
data-parsley-required-message="{{ 'demi.booking.checkout.insurance-conditions-error'|trans }}"
required> <span class="custom-checkbox__box mr-2 demi-icon demi-icon-check"></span>
</label>
<div class="custom-checkbox__text">
<label for="{{ conditions['insuranceCondition']['type'] }}" class="font-medium d-inline wysiwyg">
{% set href = '<a href="' ~ conditions['insuranceCondition']['text'] ~ '" target="_blank" class="text-primary font-default text-underline">' ~ conditions['insuranceCondition']['translation'] ~ '</a>' %}
{{ demi_fillTranslation({"[INSURANCE_CONDITIONS]": href}, "demi.booking.checkout.insurance-conditions-text") }}
</label>
<input type="hidden" name="{{ conditions['insuranceCondition']['type'] }}-text" value="{{ (demi_fillTranslation({"[INSURANCE_CONDITIONS]": href}, "demi.booking.checkout.insurance-conditions-text")|escape)|replace({'"': '\''}) }}" />
</div>
</div>
<div class="form-errors mt-1"></div>
</div>
{% endif %}
</div>