{% extends "report_base.html" %}

{% block content %}

<div class="alert alert-secondary">

  {% include "report_buttons.html" %}

  <strong>Report: AIP Contents</strong>
  <br>
  <strong>Storage Service:</strong> {{ storage_service_name }}
  <br>
  {% if storage_location_description %}
    <strong>Location:</strong> {{ storage_location_description }}
    <br>
  {% endif %}
  <strong>Start date:</strong> {{ start_date.strftime('%Y-%m-%d') }}
  <br>
  <strong>End date:</strong> {{ end_date.strftime('%Y-%m-%d') }}
  <br>
  <strong>AIPs:</strong> {{ aips|length }}
</div>

{% if aips %}
  <table id="aip-contents" 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"] }}
            <br>
            <span class="small text-muted">UUID: {{ aip["UUID"] }}</span>
          </td>
          <td>{{ aip["CreatedDate"] }}</td>
          <td>{{ aip["Size"] | filesizeformat }}</td>
          <td>{{ aip["Formats"] | safe }}</td>
      	</tr>
      {% endfor %}
    <tbody>
  </table>
{% else %}
  <p class="h4" style="margin-top:20px;">No AIPs to display.</p>
{% endif %}

{% endblock %}
