templates/admin/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. {% if ea.crud.currentAction == 'detail' or not field.customOptions.get('renderAsSwitch') %}
  5.     <span class="badge {{ field.value == true ? 'badge-boolean-true' : 'badge-boolean-false' }}">
  6.         {{ (field.value == true ? 'fmt.admin_page.user.index.boolean.active' : 'fmt.admin_page.user.index.boolean.in_active')|trans }}
  7.     </span>
  8. {% else %}
  9.     <div class="form-check form-switch">
  10.         <input type="checkbox" class="form-check-input" data-name="confirmation" id="{{ field.uniqueId }}" {{ field.value == true ? 'checked' }}
  11.                data-toggle-url="{{ field.customOptions.get('toggleUrl') }}"
  12.                 {{ field.formTypeOption('disabled') == true ? 'disabled' }} autocomplete="off">
  13.         <label class="form-check-label" for="{{ field.uniqueId }}"></label>
  14.     </div>
  15. {% endif %}