{% block pipe_diagram_pages %}
{% for page in diagram_pages %}
{% if loop.index > 1 %}
<div style="page-break-before: always;">
  <div class="wrapper">
    {% set title = "Inspection Report" %}
    {% set border_bottom = true %}
    {% include "nassco/pacp/page_title.html" %}
    <div class="container {% if loop.last and diagram_pages|length > 1 %}border-bottom-0{% endif %}" style="height: 8.6in;">
      {% include "nassco/pacp/inspection_report_header.html" %}
      <div class="mt-1">
        {% with page=page %}
          {% set extra_space_before_diagram = true %}
          {% include "nassco/pacp/pipe_diagram.html" %}
        {% endwith %}
      </div>

      <!-- Additional content for the last page (only when there are multiple pages) -->
      {% if loop.last and diagram_pages|length > 1 %}
        {% set extra_space_after_diagram = true %}
        {% include "nassco/pacp/pipe_ratings.html" %}
      {% endif %}
    </div>
  </div>
</div>
{% endif %}
{% endfor %}
{% endblock %}