{% if data is not none and "user_id" in data and data.user_id is not none %}
  {% if "eln_source_url" in data and data.eln_source_url %}
    <span data-toggle="tooltip" data-placement="top" title="{{ _('User #%(user_id)s from an ELN at %(eln_source_url)s', user_id=data.user_id, eln_source_url=data.eln_source_url) }}">
    {% if "eln_user_url" in data and data.eln_user_url %}
      <a href="{{ data.eln_user_url }}">
    {% endif %}
    {{ _('User') }} #{{ data.user_id }} @
    {% if not ("eln_user_url" in data and data.eln_user_url) %}
      <a href="{{ data.eln_source_url }}">
    {% endif %}
    {{ data.eln_source_url }}
    </a>
    </span>
  {% else %}
    {% if "component_uuid" in data and data.component_uuid is not none and data.component_uuid != config['FEDERATION_UUID'] %}
      {% set component_uuid = data.component_uuid %}
    {% else %}
      {% set component_uuid = none %}
    {% endif %}
    {% with component_id = get_component_id_by_uuid(component_uuid) %}
      {% with referenced_user = get_user(data.user_id, component_id) %}
        {% if referenced_user is not none %}
          {{ user_reference(referenced_user) }}
        {% elif component_uuid is not none %}
          {% set user_ref = FederationUserRef(fed_id=data.user_id, component_uuid=component_uuid) %}
          #{{ data.user_id }} @ {{ user_ref.component.get_name() }}
          {{ import_information_symbol(user_ref) }}
        {% else %}
          #{{ data.user_id }}
        {% endif %}
      {% endwith %}
    {% endwith %}
  {% endif %}
{% else %}
  &mdash;
{% endif %}
