{% block inspection_report %}
{% set title = "Sewer CCTV Inspection Report / Inspection: Sewer ID: " ~ (inspection.header.pipe.pipeline_length_reference if inspection.header.pipe.pipeline_length_reference else "") %}
{% set border_bottom = true %}
{% include "wrc/mainline/page_title.html" %}
<div class="container" style="height: 8.7in;">
  {% include "wrc/mainline/inspection_report_header.html" %}
  <div class="column">
    <div class="row w-full">
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0">
          <p class="m-0">Road: 
            {% if inspection.header.location.location_street_name %}
            <span class="font-semibold">{{inspection.header.location.location_street_name }}</span>
            {% endif %}
          </p>
          <p class="m-0">Place: 
            {% if inspection.header.location.location_town_or_village %}
            <span class="font-semibold">{{inspection.header.location.location_town_or_village }}</span>
            {% endif %}
          </p>
          <p class="m-0">Location Details: 
            {% if inspection.header.location.location_details %}
            <span class="font-semibold">{{inspection.header.location.location_details }}</span>
            {% endif %}
          </p>
          <p class="m-0">Location Code: 
            {% if inspection.header.location.location_type_code %}
            <span class="font-semibold">{{inspection.header.location.location_type_code.label }}</span>
            {% endif %}
          </p>
        </div>
      </div>
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0">
          <p class="m-0">Project Ref No: 
            {% if inspection.header.survey.client_job_reference %}
            <span class="font-semibold">{{ inspection.header.survey.client_job_reference }}</span>
            {% endif %}
          </p>
        </div>
      </div>
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0 border-right-0">
          <p class="m-0">US MH GIS-ID: 
            {% if inspection.header.measurements.start_node_reference %}
            <span class="font-semibold">{{ inspection.header.measurements.start_node_reference }}</span>
            {% endif %}
          </p>
          <p class="m-0">DS MH GIS-ID: 
            {% if inspection.header.measurements.finish_node_reference %}
            <span class="font-semibold">{{ inspection.header.measurements.finish_node_reference }}</span>
            {% endif %}
          </p>
          <p class="m-0">SIP Length: 
            &nbsp;
          </p> 
          <p class="m-0">CCTV Length: 
            {% if inspection.header.pipe.expected_length %}
            <span class="font-semibold">
              {{ inspection.header.pipe.expected_length }}{{ measurement_units }}
            </span>
            {% endif %}
          </p>
        </div>
      </div>
    </div>
    <div class="row w-full">
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0">
          <p class="m-0">Grease Found (N/M/H): 
            {% if inspection.header.pipe.grease_found %}
            <span class="font-semibold">{{inspection.header.pipe.grease_found }}</span>
            {% endif %}
          </p>
          <p class="m-0">Direction of Survey: 
            {% if inspection.header.survey.direction %}
            <span class="font-semibold">{{inspection.header.survey.direction.label }}</span>
            {% endif %}
          </p>
          <p class="m-0">Water Level(US): 
            {% if inspection.header.pipe.upstream_water_level %}
            <span class="font-semibold">{{inspection.header.pipe.upstream_water_level }}%</span>
            {% endif %}
          </p>
          <p class="m-0">Water Level(DS): 
            {% if inspection.header.pipe.downstream_water_level %}
            <span class="font-semibold">{{inspection.header.pipe.downstream_water_level }}%</span>
            {% endif %}
          </p>
        </div>
      </div>
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0">
          <p class="m-0">Purpose: 
            {% if inspection.header.survey.purpose_of_inspection %}
            <span class="font-semibold">{{inspection.header.survey.purpose_of_inspection }}</span>
            {% endif %}
          </p>
          <p class="m-0">Pipe Size:
            {% if inspection.header.pipe.height_or_diameter %}
            <span class="font-semibold">{{ inspection.header.pipe.height_or_diameter }}{{ pipe_size_units }}</span>
            {% endif %}
          </p>
          <p class="m-0">Pipe Material: 
            {% if inspection.header.pipe.material %}
            <span class="font-semibold">{{ inspection.header.pipe.material.label }}</span>
            {% endif %}
          </p>
          <p class="m-0">Lining: 
            {% if inspection.header.pipe.lining_material %}
            <span class="font-semibold">{{ inspection.header.pipe.lining_material.label }}</span>
            {% endif %}
          </p>
        </div>
      </div>
      <div class="row w-33">
        <div class="w-full text-left font-small box h-3 border-top-0 border-left-0 border-right-0"></div>
      </div>
    </div>
    <div class="row w-full">
      <div class="box w-full font-small border-top-0 border-left-0 border-right-0">
        <p class="m-0">Comment: 
          {% if inspection.header.additional_info %}
          <span class="font-semibold">{{inspection.header.additional_info }}</span>
          {% endif %}
        </p>
      </div>
    </div>
  </div>

  {% if diagram_pages %}
  {% set page = diagram_pages[0] %}
  {% set extra_space_before_diagram = false %}
  {% include "wrc/mainline/pipe_diagram.html" %}
  {% endif %}
</div>
{% endblock %}