Added a link to view external version from attachment edit

This commit is contained in:
Jan Böhmer 2025-02-22 17:15:37 +01:00
parent ae5dfbfc52
commit 41ae9b5f75
3 changed files with 21 additions and 2 deletions

View file

@ -152,9 +152,10 @@
</button>
{% set attach = form.vars.value %}
{# @var \App\Entity\Attachments\Attachment attach #}
{% if attach is not null %}
{% if not attach.hasInternal() %}
{% if not attach.hasInternal() and attach.external %}
<div class="mt-2">
<span class="badge bg-primary">
<i class="fas fa-fw fa-globe"></i> {% trans %}attachment.external_only{% endtrans %}
@ -194,7 +195,13 @@
<i class="fas fa-exclamation-circle fa-fw"></i> {% trans %}attachment.file_not_found{% endtrans %}
</span>
</div>
{% endif %}
{% if attach.external %}
<div>
<a href="{{ attach.externalPath }}" rel="noopener" target="_blank" data-turbo="false" class="link-external"
title="{% trans with {"%host%": attach.host} %}attachment.view_external.view_at{% endtrans %}">{% trans %}attachment.view_external{% endtrans %}</a>
</div>
{% endif %}
{% endif %}