{% 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 %}
{{ 'The structure and values of this version.' if version_state and selected_view == 'tree' else 'Maintain names, parent/child relationships and values.' if selected_view == 'tree' else 'One row per node with its parent, level and field values.' }}
Build the hierarchy first. Add optional fields and values when you are ready.
{% if may_edit %}Add root{% endif %}| Node | {% 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' %}{{ label }}{% if active %}{% endif %} | {% endfor %}Level | {% endif %} {% for field in fields %}{% 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 %} | {% endfor %} {% if may_edit %}Actions | {% endif %}||
|---|---|---|---|---|---|---|
| {{ record_name(row, indented=true) }} | {% else %}{{ record_name(row) }} | {{ row.parent_name or '' }} | {{ row.depth + 1 }} | {% endif %} {% for field in fields %}{{ node_value(row, field) }} | {% endfor %} {% if may_edit %}{% if selected_view == 'tree' %}{{ node_actions(row) }} | {% else %}{{ record_name(row, action_only=true) }} | {% endif %}{% endif %}
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 %}