{% block pipe_diagram_pages %}
{% for page in diagram_pages %}
{% if loop.index > 1 %}
<div style="page-break-before: always;">
  <div class="wrapper">
    {% set title = t('reports.pacp.inspection_report') ~ " / " ~ t('reports.pacp.inspection') ~ ": " ~ (inspection.header.location.pipe_segment_reference if inspection.header.location.pipe_segment_reference else "") %}
    {% set border_bottom = true %}
    {% include "nassco/pacp/es/page_title.html" %}
    <div class="container" style="height: 8.7in;">
      {% include "nassco/pacp/es/inspection_report_header.html" %}
      <div class="mt-1">
        {% with page=page %}
          {% set extra_space_before_diagram = true %}
          {% include "nassco/pacp/es/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/es/pipe_ratings.html" %}
      {% endif %}
    </div>
  </div>
</div>
{% endif %}
{% endfor %}
{% endblock %}
