You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

field_toggle.html.twig 884B

123456789101112131415161718
  1. {% trans_default_domain 'EasyAdminBundle' %}
  2. <div class="custom-control custom-switch">
  3. <input type="checkbox" class="custom-control-input" id="customSwitch1">
  4. <label class="custom-control-label" for="customSwitch1">Toggle this custom switch element</label>
  5. </div>
  6. {% if view == 'show' or ('edit' in backend_config.disabled_actions) %}
  7. {% if value == true %}
  8. <span class="badge badge-success">{{ 'label.true'|trans }}</span>
  9. {% else %}
  10. <span class="badge badge-danger">{{ 'label.false'|trans }}</span>
  11. {% endif %}
  12. {% else %}
  13. <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success" data-propertyname="{{ field_options.property }}">
  14. <input class="custom-control-input" type="checkbox" {{ value == true ? 'checked' }}>
  15. <label class="custom-control-label" ></label>
  16. </div>
  17. {% endif %}