Browse Source

Fix error admin

develop
Fab 3 years ago
parent
commit
0b200e7b7f
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      Resources/views/crud/field/gallery.html.twig
  2. +1
    -1
      Resources/views/crud/field/image.html.twig

+ 1
- 0
Resources/views/crud/field/gallery.html.twig View File

{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #} {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{# this is a bit ugly, but Twig doesn't have a 'is numeric' test #} {# this is a bit ugly, but Twig doesn't have a 'is numeric' test #}

{% if field.formattedValue matches '/^\\d+$/' %} {% if field.formattedValue matches '/^\\d+$/' %}
<span class="badge badge-secondary">{{ field.formattedValue }}</span> <span class="badge badge-secondary">{{ field.formattedValue }}</span>
{% else %} {% else %}

+ 1
- 1
Resources/views/crud/field/image.html.twig View File

{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #} {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{% set html_id = 'ea-lightbox-' ~ field.uniqueId %} {% set html_id = 'ea-lightbox-' ~ field.uniqueId %}
{% if field.value is not null %}
{% if field.value is not null and field.value.path is not null %}
<a href="#" class="ea-lightbox-thumbnail" title="{{ field.value.legend }}" data-featherlight="#{{ html_id }}" data-featherlight-close-on-click="anywhere"> <a href="#" class="ea-lightbox-thumbnail" title="{{ field.value.legend }}" data-featherlight="#{{ html_id }}" data-featherlight-close-on-click="anywhere">
<img src="{{ asset(field.value.path) }}" class="img-fluid"> <img src="{{ asset(field.value.path) }}" class="img-fluid">
</a> </a>

Loading…
Cancel
Save