{% if data is not none and "object_id" in data %} {% if ("component_uuid" in data and data.component_uuid is not none and data.component_uuid != config['FEDERATION_UUID']) %} {% set component = get_component_by_uuid(data.component_uuid) %} {% if component is none %} {% set component_name = _('Unknown database (%(uuid)s)', uuid=data.component_uuid[:8]) %} {% else %} {% set component_name = component.get_name() %} {% endif %} {% set current_value_text = _('Object') + ' #' + (data.object_id | string) + ' @ ' + component_name %} {% set current_value_data_icon = 'fa fa-share-alt' %} {% set current_value_is_fed = true %} {% elif "eln_source_url" in data and data.eln_source_url is not none %} {% set current_value_text = _('Object') + ' #' + (data.object_id | string) + ' @ ' + (data.eln_source_url | string) %} {% set current_value_is_fed = false %} {% else %} {% set current_value_text = none %} {% set current_value_is_fed = false %} {% endif %} {% else %} {% set current_value_text = none %} {% set current_value_is_fed = false %} {% endif %} {% if form_data.get(id_prefix+'_oid') %} {% set selected_id = form_data[id_prefix+'_oid'] %} {% elif data is not none and "object_id" in data %} {% if current_value_text is not none %} {% set selected_id = "-1" %} {% else %} {% set selected_id = data.object_id | string %} {% endif %} {% else %} {% set selected_id = none %} {% endif %} {% if schema_action_ids is none and schema_action_type_ids is none %} {% set valid_action_ids = none %} {% else %} {% set valid_action_ids = [] %} {% for action_id in action_type_id_by_action_id %} {% if schema_action_ids is none or action_id in schema_action_ids %} {% if schema_action_type_ids is none or action_type_id_by_action_id[action_id] in schema_action_type_ids %} {% do valid_action_ids.append(action_id) %} {% endif %} {% endif %} {% endfor %} {% if valid_action_ids | length == 0 %} {% do valid_action_ids.append(-100) %} {% endif %} {% endif %} {% if config['USE_TYPEAHEAD_FOR_OBJECTS'] %}