mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 17:25:05 +02:00
Improved image and attachment viewing on part info page
This commit is contained in:
parent
1de1eebc59
commit
fc7e436ca9
3 changed files with 12 additions and 3 deletions
|
@ -19,14 +19,15 @@
|
|||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x hoverpic", link = true) %}
|
||||
{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-2x hoverpic", link = true) %}
|
||||
{# @var App\Entity\Attachments\Attachment attachment #}
|
||||
{% set disabled = attachment.secure and not is_granted("show_private", attachment) %}
|
||||
{% if not attachment_helper or attachment_helper.fileExisting(attachment) %}
|
||||
{% if link and not disabled %}
|
||||
<a target="_blank" data-turbo="false" rel="noopener" href="{{ entity_url(attachment, 'file_view') }}">
|
||||
{% endif %}
|
||||
{% if attachment.picture %}
|
||||
<img class="hoverpic" {{ stimulus_controller('elements/hoverpic') }} data-thumbnail="{{ entity_url(attachment, 'file_view') }}" src="{{ entity_url(attachment, 'file_view') }}">
|
||||
<img class="hoverpic" {{ stimulus_controller('elements/hoverpic') }} data-title="{{ attachment.name }}" data-thumbnail="{{ entity_url(attachment, 'file_view') }}" src="{{ entity_url(attachment, 'file_view') }}">
|
||||
{% else %}
|
||||
<i class="text-dark {{ class }} {{ ext_to_fa_icon(attachment.extension) }}"></i>
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue