{% comment %}
    Template for inner paragraphs of a reg section
{% endcomment %}

{% if node.header %}
<div class="node">
  <h{{ node.list_level|add:"+3" }} class="section-header">{{ node.header | safe }}</h{{ node.list_level|add:"+3" }}>
  {% if meta.comment_state.name == 'OPEN' and node.accepts_comments %}
    <div
        class="activate-write"
        data-section="{{ node.full_id }}"
        data-indexes="{{ node.indexes }}"
        data-label="{{ node.human_label }}">
      <a href="#">
        <span class="fa fa-pencil-square-o" aria-hidden="true"></span>
        <div class="paragraph-comment">Write a comment about {{ node.human_label }}</div>
      </a>
    </div>
  {% endif %}
</div>
{% endif %}

<div class="node{% if not node.comments_calledout %} not-called-out{% endif %}">
{% if not node.comments_calledout %}<div class="not-called-out-extend"></div>{% endif %}

  {%if node.marked_up %}
    <p {% if node.is_collapsed %}class="collapsed"{% endif %}>

      {% block paragraph_marker %}
      {% if node.paragraph_marker %}
        <span class="stripped-marker">{{node.paragraph_marker}}.</span>
      {% endif %}
      {% endblock %}

      <span class="paragraph-text">
      {% if node.node_type == "appendix" %}
          {{node.marked_up|safe|linebreaksbr}}
      {% else  %}
          {{node.marked_up|safe}}
      {% endif %}
      </span>

    </p>

    {% if meta.comment_state.name == 'OPEN' and node.accepts_comments and not node.title %}
    <div
        class="activate-write"
        data-section="{{ node.full_id }}"
        data-indexes="{{ node.indexes }}"
        data-label="{{ node.human_label }}">
      <a href="#">
        <span class="fa fa-pencil-square-o" aria-hidden="true"></span>
        <div class="paragraph-comment">Write a comment about {{ node.human_label }}</div>
      </a>
    </div>
    {% endif %}

  {% endif %}

</div>

{% if node.children %}
<ol class="level-{{node.list_level|add:1}}">
    {% for c in node.children %}
        {% with node=c %}
            {% include node.template_name %}
        {% endwith %}
    {% endfor %}
</ol>
{% endif %}
{% if node.interp %}
    {% with interp=node.interp %}
        {% include "regulations/slide-down-interp.html" %}
    {% endwith %}
{% endif %}
