vendor/easycorp/easyadmin-bundle/src/Resources/views/crud/field/boolean.html.twig line 1

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
  3. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  4. {% trans_default_domain 'EasyAdminBundle' %}
  5. {% if ea.crud.currentAction == 'detail' or not field.customOptions.get('renderAsSwitch') %}
  6. <span class="badge {{ field.value == true ? 'badge-boolean-true' : 'badge-boolean-false' }}">
  7. {{ (field.value == true ? 'label.true' : 'label.false')|trans }}
  8. </span>
  9. {% else %}
  10. <div class="form-check form-switch">
  11. <input type="checkbox" class="form-check-input" id="{{ field.uniqueId }}" {{ field.value == true ? 'checked' }}
  12. data-toggle-url="{{ field.customOptions.get('toggleUrl') }}"
  13. {{ field.formTypeOption('disabled') == true ? 'disabled' }} autocomplete="off">
  14. <label class="form-check-label" for="{{ field.uniqueId }}"></label>
  15. </div>
  16. {% endif %}