{% extends "report_base.html" %}

{% block content %}

<div class="alert alert-secondary">
  
  {% include "report_buttons.html" %}

  <strong>Report:</strong> File formats count
  <br>
  <strong>Storage Service:</strong> {{ storage_service_name }}
  <br>
  {% if storage_location_description %}
    <strong>Location:</strong> {{ storage_location_description }}
    <br>
  {% endif %}
  {% if start_date and end_date %}
    {{ total_file_count }} original files ingested between {{ start_date.strftime('%Y-%m-%d') }} and {{ end_date.strftime('%Y-%m-%d') }}
  {% elif start_date %}
    {{ total_file_count }} original files ingested on and since {{ start_date.strftime('%Y-%m-%d') }}
  {% elif end_date %}
    {{ total_file_count }} original files ingested on and before {{ end_date.strftime('%Y-%m-%d') }}
  {% else %}
    {{ total_file_count }} original files
  {% endif %}
  <br>
  {{ formats_count }} different file formats totalling {{ total_size | filesizeformat }}
</div>

{% if formats %}
  <table id="formatversioncounts" class="table table-striped table-bordered">
    <thead>
      <tr>
        {% for column in columns %}
        <th><strong>{{ column }}</strong></th>
        {% endfor %}
      </tr>
    </thead>
    <tbody>
    {% for format in formats %}
      <tr>
        <td>{{ format["Format"] }}</td>
        <td>{{ format["Count"] }}</td>
        <td>{{ format["Size"] | filesizeformat }}</td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
{% else %}
  <p class="h4" style="margin-top:20px;">No file formats to display.</p>
{% endif %}

{% endblock %}
