{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2016-2020 CERN. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {%- macro preview_file(preview_endpoint, pid, filename, id='preview-iframe', width='100%', height='400' ) %} {%- endmacro %} {%- macro file_list(files, pid, sort_by='key', with_preview=true, download_endpoint='invenio_records_ui.recid_files', preview_endpoint='invenio_records_ui.recid_previewer') %} {% for file in files|sort(attribute=sort_by) %} {%- set file_url_download = url_for(download_endpoint, pid_value=pid.pid_value, filename=file.key, download=1) %} {%- set file_url_preview = url_for(preview_endpoint, pid_value=pid.pid_value, filename=file.key) %} {%- set file_type = file.key.split('.')[-1] %} {% endfor %}
{{_('Name')}} {{_('Size')}}
{{ file.key }}
{{file.checksum}}
{{ file.size|filesizeformat }} {% if with_preview and file_type is previewable %} {{_("Preview")}} {% endif %} {{_('Download')}}
{%- endmacro %}