{% extends 'base.html' %} {% from 'components/side_panel.html' import panel_form_actions %} {% from 'pages/datasets/_record_form_fields.html' import record_form_fields %} {% from 'components.html' import status_badge %} {% set panel_title = ('Edit node' if node else ('Add child' if parent_id else 'Add root')) %} {% block title %}{{ panel_title }} · REFRNCR{% endblock %} {% block content %} {% include 'pages/datasets/_breadcrumbs.html' %}

{{ panel_title }}

{{ status_badge('Draft') }} Saved to the draft. Consumers see it after you publish.

{% if node_row %}

{{ node_row.path }}

{% endif %} {% if error %}

{{ error }}

{% endif %}
{% if mode != 'values' %} {% if (node and node.parent_id) or (not node and parent_options) %}

Moving a node also moves its descendants. Their identities and values are preserved.

{% else %}

This is the hierarchy’s single root.

{% endif %}

Names must be unique across the whole hierarchy. A node with children retains its leaves-only values as inactive.

{% if node %} {% if fields %}{{ record_form_fields(fields, 'hierarchy-' ~ node.id, values, errors, raw_values=raw_values, name_prefix='field:') }}{% endif %} {% if not fields and not inactive_fields %}

No fields are configured.

{% endif %} {% if inactive_fields %}

Leaves-only fields

{% for field in inactive_fields %}

{{ node.name }} has children, so this field does not apply.

{% endfor %}
{% endif %} {% endif %} {% else %} {{ record_form_fields(fields, 'hierarchy-' ~ node.id, values, errors, raw_values=raw_values, name_prefix='field:') }} {% if inactive_fields %}

Inactive values

Leaves-only values stay on this node and become active if it is a leaf again or the field scope changes to All nodes.

{% for field in inactive_fields %}{% if node_row['values'].get(field.key) is not none %}
{{ field.name }}
{{ node_row['values'].get(field.key)|record_value_text(field.data_type) }}
{% endif %}{% endfor %}
{% endif %} {% endif %}
{% call panel_form_actions() %} Cancel {% endcall %}
{% endblock %}