{% extends "base.html" %} {% macro block_open(name, title) %} {% endmacro %} {% macro tagList(name, tags, style) %}
{{name}}
{% endmacro %} {% macro render_metadata(metadata) %}
Metadata
{% endmacro %} {% macro translate(list) %} {% set tt = list.get_with_context(context)%} {% endmacro %} {% macro render_item(item) %}

{{item['key']}}

{% if item['metadata'] %} {{ render_metadata(item['metadata']) }} {% endif %} {% if item['follows'] %} {{ tagList('Follows', item['follows'], 'follows') }}
{% endif %} {# follows #} {% if item['condition'] %}
Condition
{{ render_expression(item['condition']) }}
{% endif %} {# condition #} {% if item.is_group() %}
{% for sub in item.items %} {{ render_item(sub) }} {% endfor %}
Selection method
{{ render_expression(item.selection) }}
{% else %} {% if item.type %}
Type : {{ item.type }}
{% endif %}
Components
{{ render_item_components(item.components) }}
Validations
{{ render_validations(item.validations) }}
{% endif %} {# is_group #} {% endmacro %} {% macro render_item_components(components) %} {% set comp_type= components.get_type() %}
{% if components.key %} {{components.key}} {% endif %} {% if components.is_group() %} {% set rr=components.items_by_roles() %} {% for role, comps in rr.items() %}
{{ role }} {% if components.order %}(order {{ render_expression(components.order) }}){% endif %}
{% for comp in comps %} {{ render_item_components(comp) }} {% endfor %}
{% endfor %} {% endif %} {% if components.is_response() %} {% if components.dtype %}
{{components.dtype}}
{% endif %} {% if components.props %}
{% for name, value in components.props.items() %}
{{name}}
{{value}}
{% endfor %}
{% endif %} {% endif %} {% if components.style %} {
{% for key, value in components.style.items() %}
{{ key }}
{{ value }}
{% endfor %}
} {% endif %} {% if components.content %}
{{ translate(components.content) }}
{% endif %} {% if components.disabled %}
Disabled
{{ render_expression(components.disabled) }}
{% endif %} {% if components.description %}
Description
{{ translate(components.description) }}
{% endif %} {% if components.displayCondition %}
displayCondition
{{ render_expression(components.displayCondition) }}
{% endif %} {% if components.properties %}
Properties
{% endif %}
{% endmacro %} {% macro render_validations(validations) %} {% if validations %}
{% for v in validations %}
{{ v['key'] }} {{ v['type'] }}
{{ render_expression(v['rule']) }}
{% endfor %}
{% endif %} {% endmacro %} {% macro render_expression(expr) %} {% if expr %} {% if expr.is_expression() -%} {{ expr.name }}( {% for p in expr.params -%} {% set np = expr.param_name(loop.index0) %} {% if np %}{{np}}={%endif%} {{ render_expression(p) }} {% if not loop.last %},{% endif %} {% endfor %}) {% else %} {# is_expression #} {% if expr.is_numeric() %} {{ expr }}{% else %}"{{ expr }}"{% endif %} {% endif %} {# is_expression #} {% endif %} {# expr #} {% endmacro %} {% set definition = survey.survey_definition %} {% block survey %}

Survey {{ definition.key }} ({{ survey.version }})

name
{{ translate(survey.props.name) }}
description
{{ translate(survey.props.description)}}
typicalDuration
{{ translate(survey.props.typicalDuration) }}
{% if survey.metadata %} {{ render_metadata(survey.metadata) }} {% endif %}

Survey Definition

{% if survey['published'] %} Published on {{ survey['published'].to_time() }} {% endif %} {% if survey['unpublished'] %} Published on {{ survey['unpublished'].to_time() }} {% endif %} {{ render_item(definition) }} {% if survey['prefillRules'] %}

Prefill Rules

{% endif %} {% if survey['contextRules'] %}

Context Rules

{% if ctx['mode'] %}

Mode : {{ render_expression(ctx['mode']) }}

{% endif %} {% set ctx = survey['contextRules'] %} {% if ctx['previousResponses'] %}

Previous Responses

{% endif %} {% endif %}
{% endblock survey %}