mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-20 09:09:33 +00:00
Added a link to view external version from attachment edit
This commit is contained in:
parent
ae5dfbfc52
commit
41ae9b5f75
3 changed files with 21 additions and 2 deletions
|
|
@ -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 %}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
<td><div class="btn-group" role="group" aria-label="">
|
||||
<a {% if attachment.hasExternal() %}href="{{ attachment.externalPath }}"{% endif %} target="_blank"
|
||||
class="btn btn-secondary {% if not attachment.hasExternal() %}disabled{% endif %}"
|
||||
data-turbo="false" title="View at {{ attachment.host }}" rel="noopener"> {# TODO: translate #}
|
||||
data-turbo="false" title="{% trans with {"%host%": attachment.host} %}attachment.view_external.view_at{% endtrans %}" rel="noopener">
|
||||
<i class="fas fa-globe fa-fw"></i>
|
||||
</a>
|
||||
<a {% if attachment_manager.isInternalFileExisting(attachment) %}href="{{ entity_url(attachment, 'file_view') }}"{% endif %} target="_blank"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue