{% extends "base.html" %} {% from "components/concept.html" import new_concept, versions_action, current_version_action, banner with context %} {% from "components/dataset_navigation.html" import dataset_navigation with context %} {% from "components/side_panel.html" import form_side_panel %} {% from "components.html" import content_metadata %} {% from "components/export_action.html" import export_action %} {% from "components/icons.html" import lock_icon %} {% from "components/search_field.html" import search_field %} {% from "layouts/page.html" import page_context %} {% from "pages/datasets/hierarchy/_tree.html" import node_actions, node_name, record_name, node_value with context %} {% block title %}{{ dataset.name|dataset_title }} · REFRNCR{% endblock %} {% block content %} {% include 'pages/datasets/_version_status.html' %} {% if not version_state %} {% call banner(dataset.key, concept_ui, publication_panel=false, show_current=false, include_discard_panel=true) %} {% endcall %} {% endif %} {{ dataset_navigation(dataset, 'records', concept=not version_state, version_id=version_state.version.id if version_state else none, may_view_access=may_view_access) }} {% if hierarchy_errors %}

Resolve before publication

{% endif %} {% if not hierarchy_rows %}

Start with the root

Build the hierarchy first. Add optional fields and values when you are ready.

{% if may_edit %}Add root{% endif %}
{% else %} {% if hierarchy_search and not display_rows %}

No matching nodes

Try another search term or clear the current search.

Clear search
{% else %}
{% if selected_view == 'tree' %} {% else %} {% for key, label in [('name', 'Name'), ('parent', 'Parent')] %} {% set active = sort_key == key %}{% set next = 'desc' if active and sort_direction == 'asc' else 'asc' %} {% endfor %} {% endif %} {% for field in fields %}{% endfor %} {% if may_edit %}{% endif %} {% for row in display_rows %} {% if selected_view == 'tree' %} {% else %}{% endif %} {% for field in fields %}{% endfor %} {% if may_edit %}{% if selected_view == 'tree' %}{% else %}{% endif %}{% endif %} {% endfor %}
{{ 'Hierarchy tree' if selected_view == 'tree' else 'Hierarchy table' }}
Node{{ label }}{% if active %}{% endif %}Level{% if selected_view == 'table' and field.key == key_field_key %}{% set active = sort_key == 'key' %}{% set next = 'desc' if active and sort_direction == 'asc' else 'asc' %}{{ field.name }}{% if active %}{% endif %}{% else %}{{ field.name }}{% endif %}{% if field.hierarchy_scope != 'all_nodes' %}Leaves only{% endif %}Actions
{{ record_name(row, indented=true) }}{{ record_name(row) }}{{ row.parent_name or '' }}{{ row.depth + 1 }}{{ node_value(row, field) }}{{ node_actions(row) }}{{ record_name(row, action_only=true) }}
{% endif %} {% if selected_view == 'tree' and not fields and may_edit %}

The structure can be published without custom fields. Define fields to add values.

{% endif %} {% endif %} {% if selected_view == 'tree' or selected_view == 'table' %} {% if may_edit %}{{ form_side_panel('hierarchy-panel') }}{% else %}{% include 'pages/datasets/hierarchy/_view_panels.html' %}{% endif %} {% endif %} {% endblock %} {% block scripts %}{% endblock %}