{% set control_type = None %} {% if control.__class__.__name__ == 'dict' %} {% set control_type = control['type'] %} {% else %} {% set control_type = control.instance.type.name %} {% endif %} {% if control_type == 'EditCtrl' %} {% if control.attributes['source'] == 'view' %} {% if control.attributes['target'] == 'name' %} {% else %} {{control}} {% endif %} {% else %} {% if item %} {% if control.attributes['target'] == 'name' %} {% else %} {% endif %} {% else %} {% endif %} {% endif %} {% elif control_type == 'HiddenCtrl' %} {% if control.attributes['source'] == 'control' %} {% elif control.attributes['source'] == 'form' %} {% elif control.attributes['source'] == 'view' %} {% if control.attributes['target'] == 'name' %} {% elif control.attributes['target'] == 'type' %} {% else %} {{control}} {% endif %} {% else %} {% if control.attributes['target'] == 'id' %} {% elif control.attributes['target'] == 'parent_id' %} {% elif control.attributes['target'] == 'name' %} {% elif control.attributes['value'] %} {% else %} {% endif %} {% endif %} {% elif control_type == 'MultiSelectCtrl' %} {% elif control_type == 'TypeSelectCtrl' %} {% elif control_type == 'ButtonCtrl' %} {% if control.attributes['is_cancel_button'] == 'true' %} {% else %} {% endif %} {% elif control_type == 'StepsCtrl' %}
{% for step_control in control.attributes['controls'] %} {% if step_control.type != 'StepCtrl' %} {% with item=item, control=step_control %} {% include "control.html" %} {% endwith %} {% endif %} {% endfor %}
{% set target_controls = [] %} {% for step_control in control.attributes['controls'] %} {% if step_control.type == 'StepCtrl' %} {% set target_controls = target_controls + [step_control] %}
{% endif %} {% endfor %} {% for step_control in target_controls %} {% if step_control.type == 'StepCtrl' %} {% set target_controls = target_controls + [step_control] %}
{% endif %} {% endfor %}
{% for step_control in control.attributes['controls'] %} {% if step_control.type == 'StepCtrl' %}
{% with item=item, control=step_control %} {% include "control.html" %} {% endwith %}
{% endif %} {% endfor %}
{% elif control_type == 'StepCtrl' %} {% for control in control.attributes['controls'] %}
{% with item=item, control=control %} {% include "control.html" %} {% endwith %}
{% endfor %} {% else %} {{control.type}} {% endif %}