templates/admin/Button/delete_button.html.twig line 1

Open in your IDE?
  1. <!-- START admin/Button/delete_button.html.twig -->
  2. {% if not app.request.get('nav_prometeo') %}
  3.     {% set disabled = false %}
  4.     {% set show = true %}
  5.     {% if instanceof(object, "\\App\\Entity\\Valoracion") and
  6.         (object.estado.key|default('') == constant('App\\Enum\\EstadoValoracionEnum::ESTADO_EN_TRAMITACION') or
  7.         object.estado.key|default('') == constant('App\\Enum\\EstadoValoracionEnum::ESTADO_TRAMITADA')
  8.         )
  9.     %}
  10.         {% set disabled = true %}
  11.     {% endif %}
  12. {#    {% if instanceof(object, "\\App\\Entity\\Operacion") and not(#}
  13. {#        object.estado.key|default('') != constant('App\\Enum\\EstadoOperacionEnum::ESTADO_ASENTADA') and#}
  14. {#        object.estado.key|default('') != constant('App\\Enum\\EstadoOperacionEnum::ESTADO_FINALIZADA') and#}
  15. {#        object.valoracion and#}
  16. {#        object.canDeleted)#}
  17. {#    %}#}
  18.     {% if
  19.         instanceof(object, '\\App\\Entity\\Operacion') and not (
  20.         object.estado.key|default('') == constant('App\\Enum\\EstadoOperacionEnum::ESTADO_EN_TRAMITACION') and
  21.         object.valoracion and
  22.         object.canDeleted)
  23.     %}
  24.         {% set show = false %}
  25.     {% endif %}
  26.     {% if object.id and show %}
  27.         {% if admin.getEntitySubClass is defined %}
  28.             <li id="action-delete" class="action" style="grid-area: delete_button">
  29.                 <a class="sonata-action-element {% if not is_granted('ROLE_SUPER_ADMIN') or disabled %} disabled {% endif %}" href="{{ admin.generateUrl('delete', {'id': object.id, 'subclass': admin.getEntitySubClass}) }}"
  30.                    title="{{ 'link_action_delete'|trans({}, 'SonataAdminBundle') }}">
  31.                     <i class="fa fa-trash fa-2x"></i>
  32.                 </a>
  33.             </li>
  34.         {% else %}
  35.             <li id="action-delete" class="action" style="grid-area: delete_button">
  36.                 <a class="sonata-action-element {% if not is_granted('ROLE_SUPER_ADMIN') or disabled %} disabled {% endif %}" href="{{ admin.generateUrl('delete', {'id': object.id }) }}"
  37.                    title="{{ 'link_action_delete'|trans({}, 'SonataAdminBundle') }}">
  38.                     <i class="fa fa-trash fa-2x"></i>
  39.                 </a>
  40.             </li>
  41.         {% endif %}
  42.     {% endif %}
  43. {% endif %}
  44. <!-- END admin/Button/delete_button.html.twig -->