{% load macros %}
{% if sxs.label %}
    <div class="sxs-header">
        <a class="sxs-back-button" href="{{ back_url }}"><span class="cf-icon cf-icon-arrow-left-round"></span> {{sxs.header}}</a>
        <h2><span class="sxs-label">Section-by-section analysis - </span>{{ notice.fr_volume }} FR {{ sxs.page }}</h2>
    </div>
    <div class="sxs-content group">
        <div id="{{sxs.label}}" class="sxs-main-content">
{% endif %}

<h{{sxs.depth}}> {{sxs.title}} </h{{sxs.depth}}>

{% for p in sxs.paragraphs %}
    <p> {{p|safe}} </p>
{% endfor %}

{% for c in sxs.children %}
    {% with sxs=c template_name='regulations/paragraph-sxs.html' %}
        {%include template_name  %}
    {% endwith %}
{% endfor %}

{% if sxs.all_footnotes %}
<h4 class="footnote-title">Footnotes</h4>
<ul class="footnotes">
    {% for footnote in sxs.all_footnotes %}
    <li id="footnote-{{footnote.reference}}">
    <div class="footnote-inner group">
        <span class="reference-num">{{footnote.reference}}.</span>
        <p>{{footnote.text|safe}}</p>
        <a href="#footnote-jump-{{footnote.reference}}" class="return-link"><span class="cf-icon cf-icon-up-round"></span> <span class="icon-text">Return to Main Content</span></a>
    </div> <!-- .footnote-inner -->
    </li>
    {% endfor %}
</ul>
{% endif %}

{% if sxs.label %}
      </div>
{% endif %}


{% if sxs.label %}
<div id="metadata-{{sxs.label}}" class="sxs-metadata">

    <h3>ANALYSIS TAKEN FROM:</h3>

        <h4>Document Number:</h4>
        <p>{% external_link url=notice.fr_url text=notice.document_number %}</p>

        <h4>Action:</h4>
        <p>
            {{notice.action}}
        </p>

        <h4>Dates:</h4>
        <ul>
            <li><strong>Publication:</strong> {{notice.publication_date|date:"F j, Y"}}</li>
            <li><strong>Effective:</strong> {{notice.effective_on|date:"F j, Y"}}</li>
        </ul>

        <h4>RIN:</h4>
        <p>
            {{notice.regulation_id_numbers|join:", "}}
        </p>

        {% if further_analyses %}
        <div class="further-analysis">
            <h3>Further Analysis:</h3>
            <ul class="analysis-list">
            {% for analysis in further_analyses %}
                <li><a
                    href="{% url 'chrome_sxs_view' analysis.reference.1 analysis.reference.0 %}?from_version={{version}}&fr_page={{analysis.fr_page}}"
                    data-sxs-pararaph-id="{{analysis.reference.1}}"
                    data-doc-number="{{analysis.reference.0}}"
                    class="internal"
                    >{{ analysis.fr_volume }} FR {{ analysis.fr_page }}</a>
                    <br />Published {{ analysis.publication_date|date:"F j, Y" }}
                </li>
            {% endfor %}
            </ul>
        </div>
        {% endif %}

        {% block sxs_disclaimer %}
        {% endblock %}
</div>
{% endif %}
{% if sxs.label %}
    </div>
{% endif %}
