Confirmation step: Improve display of long boolean contact form questions

This commit is contained in:
Raphael Michel
2021-05-03 10:21:45 +02:00
parent 79b113ef57
commit ecd97fc6ce
2 changed files with 15 additions and 8 deletions

View File

@@ -870,10 +870,6 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep):
for key, value in response.items():
v = self.cart_session.get('contact_form_data', {}).get(key)
v = value.bound_data(v, initial='')
if v is True:
v = _('Yes')
elif v is False:
v = _('No')
ctx['contact_info'].append((rich_text_snippet(value.label), v))
return ctx

View File

@@ -146,10 +146,21 @@
</dl>
{% endif %}
{% for l, v in contact_info %}
<dl class="dl-horizontal">
<dt>{{ l }}</dt>
<dd>{{ v }}</dd>
</dl>
{% if v is False %}
{# do not show #}
{% elif v is True %}
<div class="checkbox">
<label>
<input type="checkbox" class="checkbox" checked disabled>
{{ l }}
</label>
</div>
{% else %}
<dl class="dl-horizontal">
<dt>{{ l }}</dt>
<dd>{{ v }}</dd>
</dl>
{% endif %}
{% endfor %}
</div>
</div>