Skip to content

Commit

Permalink
bug #2380 Improved the vich_image_widget template (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.x branch.

Discussion
----------

Improved the vich_image_widget template

This fixes #2240.

Commits
-------

7ef2cb1 Improved the vich_image_widget template
  • Loading branch information
javiereguiluz committed Oct 9, 2018
2 parents 39c97cd + 7ef2cb1 commit f4a47d7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/Resources/views/form/bootstrap_3_layout.html.twig
Expand Up @@ -436,16 +436,22 @@
{{ form_row(form.delete, { label: 'form.label.delete' }) }}
{% endif %}

{% if download_uri|default('') is not empty %}
{% set _lightbox_id = 'easyadmin-lightbox-' ~ id %}
{% if image_uri|default('') is not empty %}
{% if download_uri|default('') is empty %}
<div class="easyadmin-thumbnail">
<img style="cursor: initial" src="{{ asset(image_uri) }}">
</div>
{% else %}
{% set _lightbox_id = 'easyadmin-lightbox-' ~ id %}

<a href="#" class="easyadmin-thumbnail" data-featherlight="#{{ _lightbox_id }}" data-featherlight-close-on-click="anywhere">
<img src="{{ asset(download_uri) }}">
</a>
<a href="#" class="easyadmin-thumbnail" data-featherlight="#{{ _lightbox_id }}" data-featherlight-close-on-click="anywhere">
<img src="{{ asset(download_uri) }}">
</a>

<div id="{{ _lightbox_id }}" class="easyadmin-lightbox">
<img src="{{ asset(download_uri) }}">
</div>
<div id="{{ _lightbox_id }}" class="easyadmin-lightbox">
<img src="{{ asset(download_uri) }}">
</div>
{% endif %}
{% endif %}
</div>
{% endspaceless %}
Expand Down

0 comments on commit f4a47d7

Please sign in to comment.