{% set control_type = None %} {% if control.__class__.__name__ == 'dict' %} {% set control_type = control['type'] %} {% else %} {% set control_type = control.instance.type.name %} {% endif %} {% set attributes = dict() %} {% set namespace = False %} {% if control.__class__.__name__ == 'dict' %} {% set attributes = item.attributes %} {% if 'namespace' in control.attributes %} {% set attributes = attributes.get(control.attributes['namespace'], dict()) %} {% set namespace = True %} {% endif %} {% else %} {% set attributes = item.attributes %} {% if 'namespace' in control.attributes %} {% set attributes = attributes.get(control.attributes['namespace'], dict()) %} {% set namespace = True %} {% endif %} {% endif %} {% if control_type == 'EditCtrl' %} {% if control.attributes['source'] == 'view' %} {% if control.attributes['target'] == 'name' %} {% else %} {{control}} {% endif %} {% else %} {% if item %} {% if control.attributes['password'] == 'true' %} {% elif control.attributes['target'] == 'name' %} {% if namespace and 'name' in attributes %} {% else %} {% endif %} {% else %} {% endif %} {% else %} {% endif %} {% endif %} {% elif control_type == 'HiddenCtrl' %} {% if control.attributes['source'] == 'control' %} {% if namespace %} {% else %} {% endif %} {% elif control.attributes['source'] == 'form' %} {% elif control.attributes['source'] == 'view' %} {% if control.attributes['target'] == 'name' %} {% elif control.attributes['target'] == 'type' %} {% else %} {% 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' %}