{% extends "common/index_bootstrap.html.twig" %} {% block stylesheet %} {% endblock %} {% block content %}

{{ "Download of documents" | trans }}

{% if (list['complete'] is not defined or not list['complete']) and list['count'] > 1%}
{{ "Please wait while your files are being gathered for the download, this operation may take a few minutes." | trans }}
{% elseif list['complete'] is defined and list['complete'] %}
{% set url = path('document_download', {'token': token.getValue(), 'type': type, 'anonymous': anonymous}) %} {% set before_link = '' %} {% set after_link = '' %} {% trans with {'%before_link%' : before_link, '%after_link%' : after_link} %}Your documents are ready. If the download does not start, %before_link%click here%after_link%{% endtrans %}
{% endif %}
{% set total_size = 0 %} {% for file in list["files"] %} {% set size = 0 %} {% set total_size = total_size + size %} {% endfor %}

{{ "The file contains the following elements" | trans }}

{{ "Base" | trans }} {{ "Name" | trans }} {{ "Sub definition" | trans }} {{ "Size" | trans }} {{ "Thumbnail" | trans }}
{{ app|sbas_from_bas(file['base_id'])|sbas_labels(app) }} {{ file['base_id']|bas_labels(app) }} {{ file['original_name'] }} {% if file['subdefs'] is iterable and file['subdefs']|length > 0 %}
    {% for subdef in file['subdefs'] %}
  • {{ subdef['label'] }}
  • {% set size = size + subdef['size'] %} {% endfor %}
{% endif %}
{{ size|formatOctets }} {% set record_key = app|sbas_from_bas(file['base_id']) ~'_'~ file['record_id']%} {% if record_key in records|keys %} {% set record = attribute(records, record_key) %} {% set thumbnail = record.get_thumbnail() %} {% if thumbnail.isLandscape() %} {% set w = 140 %} {% if thumbnail.get_height() > 0 and thumbnail.get_width() > 0 %} {% set h = (w / (thumbnail.get_width() / thumbnail.get_height()))|round %} {% else %} {% set h = 140 %} {% endif %} {% else %} {% set h = 105 %} {% if thumbnail.get_height() > 0 %} {% set w = (h * (thumbnail.get_width() / thumbnail.get_height()))|round %} {% else %} {% set w = 105 %} {% endif %} {% endif %} {% endif %}
{# \Alchemy\Phrasea\Controller\Prod\DoDownloadController::downloadDocuments #}
{% if anonymous %} {% endif%}
{% endblock %}