{% if uploadsArr %}

{% trans %}Attached file {% plural uploadsArr|length %} Attached files {% endtrans %}

{% if mode == 'edit' %} {% endif %}
{% for upload in uploadsArr %} {% set ext = upload.real_name|getExt %}
{% if mode == 'edit' %} {% endif %} {% if upload.real_name matches '/\.(jpg|jpeg|png|gif|tif|tiff|pdf|eps|svg)$/i' %} {# don't make the thumbnail clickable if it's a tif #} {% if upload.real_name matches '/\.(jpg|jpeg|png|gif|pdf|eps|svg)$/i' %} {% endif %} {% set thumb_name = upload.long_name ~ '_th.jpg' %} {% if thumb_name is readable %} thumbnail {% else %} {% endif %} {% if upload.real_name matches '/\.(jpg|jpeg|png|gif|pdf|eps|svg)$/i' %} {% endif %} {% elseif ext == 'mol' and App.Users.userData.chem_editor %}
{% elseif ext in constant('Elabftw\\Elabftw\\Extensions::MOLECULE') %}
{% else %} {% endif %}
{{ upload.real_name }} {{ (Entity.Uploads.getUploadsPath ~ upload.long_name)|filesize|formatBytes }} - {{ upload.datetime }}
{# if we are in view mode, we don't show the comment if it's the default text. This is to avoid showing 'Click to add a comment' where in fact you can't click to add a comment because you are in view mode #} {% if mode == 'edit' or upload.comment != 'Click to add a comment' %}

{{ upload.comment}}

{% endif %} {% if ext matches '/(json)$/i' %}

{{ 'Load into JSON Editor'|trans }}

{% endif %} {% if mode == 'edit' and ext matches '/(jpg|jpeg|png|gif|svg)$/i' %}

{{ 'Insert in text at cursor position'|trans }}

{% endif %} {% if mode == 'edit' and ext matches '/(jpg|jpeg|png|gif)$/i' %}

{{ 'Annotate this image'|trans }}

{% endif %} {# SAVE AS IMAGE #} {% if mode == 'edit' and ext matches '/(mol)$/i' %}

{{ 'Save as image'|trans }}

{% endif %}
{% if mode == 'edit' %}

{{ 'Upload a new version of this file'|trans }}

{% endif %}
{% endfor %}
{% endif %}