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(): for key, value in response.items():
v = self.cart_session.get('contact_form_data', {}).get(key) v = self.cart_session.get('contact_form_data', {}).get(key)
v = value.bound_data(v, initial='') 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)) ctx['contact_info'].append((rich_text_snippet(value.label), v))
return ctx return ctx

View File

@@ -146,10 +146,21 @@
</dl> </dl>
{% endif %} {% endif %}
{% for l, v in contact_info %} {% for l, v in contact_info %}
{% 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"> <dl class="dl-horizontal">
<dt>{{ l }}</dt> <dt>{{ l }}</dt>
<dd>{{ v }}</dd> <dd>{{ v }}</dd>
</dl> </dl>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>