{% macro dataValue(dValue, data) %}
{% if dValue | is_object %}
{% for dValueKey, dValueValue in dValue %}
{{ dValueKey }} |
{{ dataValue(dValueValue, data) }} |
{% endfor %}
{% elif dValue | is_array %}
{% for arrayValue in dValue %}
- {{ dataValue(arrayValue, data) }}
{% endfor %}
{% else %}
{{ renderValue(dValue, data) }}
{% endif %}
{% endmacro %}
{% macro dataTable(components, submissionData, title) %}
{% for component in components %}
{% if component.type == 'well' %}
{{ dataTable(component.components, submissionData) }}
{% elif component.type == 'columns' %}
{% for column in component.columns %}
{{ dataTable(column.components, submissionData) }}
{% endfor %}
{% endif %}
{% endfor %}
{% if title %}
{{ title }} |
{% endif %}
{% for component in components %}
{% if component.type == 'panel' %}
{% elif component.type == 'well' %}
{% elif component.type == 'fieldset' %}
{% elif component.type == 'columns' %}
{% elif not submissionData[component.key] %}
{% else %}
{{ component.label }} |
{% if component.type == 'password' %}
--- PASSWORD ---
{% elif component.type == 'address' %}
{{ submissionData[component.key].formatted_address }}
{% else %}
{{ dataValue(submissionData[component.key], submissionData) }}
{% endif %}
|
{% endif %}
{% endfor %}
{% for component in components %}
{% if component.type == 'panel' %}
{{ dataTable(component.components, submissionData, component.title) }}
{% elif component.type == 'fieldset' %}
{{ dataTable(component.components, submissionData, component.legend) }}
{% endif %}
{% endfor %}
{% endmacro %}
{% macro table(components, title) %}
{{ dataTable(components, data, title) }}
{% endmacro %}