{# Displays a list of files. files - A list of files to display. owner_type - type of the files owner owner_id - ID of the files owner Example: {% snippet 'files/snippets/file_table.html', files=files %} #} {% set columns = [ {"name": "name", "label": "Name"}, {"name": "ctime", "label": "Created"}, {"name": "storage_data.content_type", "label": "Type"}, {"name": "storage_data.size", "label": "Size"}, ] %} {% set params = request.args or request.params or {} %} {% block file_table %} {% block table_header %} {% for column in columns %} {% endfor %} {% endblock table_header %} {% for file in files %} {% block table_row scoped %} {% endblock table_row %} {% endfor %}
{% if params.sort == column.name and params.reverse == 'false' %} {{ _(column.label) }} {% else %} {{ _(column.label) }} {% endif %} {{ _("Actions") }}
{% if not file.completed %} {% endif %} {{ file.name }}
{{ h.render_datetime(file.ctime, with_hours=true) }}
{% set content_type = file.storage_data.content_type %}
{% set icon_path = h.files_content_type_icon(content_type, "amy-dark", "svg") %} {% if icon_path %} type icon {% endif %} {{ _(h.files_humanize_content_type(file.storage_data.content_type)) }}
{{ h.localised_filesize(file.storage_data.size) }} {% block file_actions %} {% if owner_type == "user" and owner_id and h.check_access("files_file_delete", {"id": file.id})%} {% endif %} {% if not file.completed and h.check_access("files_upload_update", {"id": file.id})%} {% endif %} {% endblock %}
{% endblock %}