{% ckan_extends %}

{% if group_dict is not defined %}{% set group_dict = c.group_dict %}{% endif %}
{% if scheming_fields is not defined %}{% set scheming_fields = c.scheming_fields %}{% endif %}

{% block primary_content_inner %}
    <h1>
        {% block page_heading %}
            {% if group_dict.longname %}
                {{ group_dict.longname }} ({{ group_dict.display_name }})
            {% else %}
                {{ super() }}
            {% endif %}
        {% endblock %}
    </h1>

    <dl>
        {% for f in scheming_fields %}
            {% if f.display_snippet != None %}
                {% if f.field_name == "description" %}
                    {{ h.render_markdown(group_dict[f.field_name]) or ("&nbsp;"|safe) }}
                {% else %}
                    <dt>{{ h.scheming_language_text(f.label) }}:</dt>
                    <dd>{{ group_dict[f.field_name] or ("&nbsp;"|safe) }}</dd>
                {% endif %}
            {% endif %}
        {% endfor %}
    </dl>

    <div id="organization-tree">
        {% snippet 'organization/snippets/organization_tree.html', top_nodes=[h.group_tree_section(id_=group_dict.id, type_=group_dict.type)], use_longnames=True %}
    </div>
{% endblock %}
