{% comment %}
    Display an appendix section.
{% endcomment %}

{% if c.node_type == "appendix" %}
    <section
              id="{{c.markup_id}}"
              class="appendix-section"
              data-base-version="{{version}}"
              data-page-type="appendix"
              data-label="{{c.human_label}}"
              {% if newer_version %}data-newer-version="{{newer_version}}"{% endif %}>
        <h2 class="appendix-title" tabindex="0"> {{c.header|safe}} </h2>
        {%if c.TOC %}
            {% with nav_class='appendix-nav' toc_items=c.TOC %}
                {% include "regulations/toc.html" %}
            {% endwith %}
        {%endif%}

{{ c.marked_up|safe|linebreaksbr }}

    {% if c.children %}
        {% for level_one in c.children %}
            <section id="{{level_one.markup_id}}" class="appendix-section" data-label="{{level_one.human_label}}">
            <h3 class="appendix-heading{% if not level_one.text and not level_one.children %} empty-header{% endif %}" tabindex="0"> {{level_one.header|safe}} </h3>

            {% if level_one.marked_up %}
            <p>
                {{level_one.marked_up|safe|linebreaksbr}}
            </p>
            {% endif %}

            {% if level_one.children %}
                <ol class="level-{{level_one.list_level|add:1}}">
                {% for node in level_one.children  %}
                    {% include node.template_name %}
                {% endfor %}
                </ol>
            {% endif %}

            {% if level_one.interp %}
                {% with interp=level_one.interp %}
                    {% include "regulations/slide-down-interp.html" %}
                {% endwith %}
            {% endif %}
            </section>
        {% endfor %}
    {% endif %}

    {% if c.interp %}
        {% with interp=c.interp %}
            {% include "regulations/slide-down-interp.html" %}
        {% endwith %}
    {% endif %}
    </section>
{% endif %}
