{% extends "report_base.html" %}

{% block content %}

<div class="alert alert-secondary">
  
  {% include "report_buttons.html" %}
  
  <strong>Report: AIPs by PUID</strong>
  <br>
  <strong>Storage Service:</strong> {{ storage_service_name }}
  <br>
  {% if storage_location_description %}
    <strong>Location:</strong> {{ storage_location_description }}
    <br>
  {% endif %}
  <strong>PUID:</strong> {{ puid }}
  {% if file_format %}
    <br>
    <strong>File format and version:</strong> {{ file_format }}
  {% endif %}
  <br>
  {% if original_files %}
    <strong>File type:</strong> original files
  {% else %}
    <strong>File type:</strong> preservation files
  {% endif %}
</div>

{% if aips %}
  <table class="table table-striped table-bordered">
  	<thead>
      <tr>
      {% for column in columns %}
        <th>{{ column }}</th>
      {% endfor %}
      </tr>
    </thead>
    <tbody>
      {% for aip in aips %}
        <tr>
          <td>{{ aip["AIPName"] }}</td>
          <td>{{ aip["UUID"] }}</td>
          <td>{{ aip["Count"] }}</td>
          <td>{{ aip["Size"] | filesizeformat }} </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% else %}
  <p class="h4" style="margin-top:20px;">No AIPs with PUID "{{ puid }}" to display.</p>
{% endif %}

{% endblock %}
