Преглед на файлове

Traduction toggle / boolean

develop
Guillaume преди 3 години
родител
ревизия
694a23d402
променени са 3 файла, в които са добавени 11 реда и са изтрити 8 реда
  1. +2
    -2
      Controller/Dashboard/DashboardAdminController.php
  2. +1
    -1
      Resources/views/adminlte/crud/field/toggle.html.twig
  3. +8
    -5
      Resources/views/adminlte/crud/form_theme.html.twig

+ 2
- 2
Controller/Dashboard/DashboardAdminController.php Целия файл

@@ -83,8 +83,8 @@ class DashboardAdminController extends AbstractDashboardController
'main_menu' => '@LcSov/adminlte/block/menu.html.twig',
'crud/index' => '@LcSov/adminlte/crud/index.html.twig',
'crud/paginator' => '@LcSov/adminlte/crud/paginator.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/edit.html.twig',
'crud/new' => '@LcSov/adminlte/crud/new.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/form.html.twig',
'crud/new' => '@LcSov/adminlte/crud/form.html.twig',
'flash_messages' => '@LcSov/adminlte/block/flash_messages.html.twig',
]
)

+ 1
- 1
Resources/views/adminlte/crud/field/toggle.html.twig Целия файл

@@ -6,5 +6,5 @@
data-url="{{ ea_url({crudAction: 'edit', entityId: item.id, fieldName: property_name }) }}">
<input type="checkbox" class="custom-control-input" id="{{ id_toggle }}" {{ field.value ? 'checked' }}>
<label class="custom-control-label" for="{{ id_toggle }}">
{{ field.getCustomOption('toggle_label') ?? field.label }}</label>
{{ field.getCustomOption('toggle_label') ? field.label : field.property|sov_trans_admin_field(entity.instance) }}</label>
</div>

+ 8
- 5
Resources/views/adminlte/crud/form_theme.html.twig Целия файл

@@ -283,12 +283,15 @@
{{ widget|raw }}
<span class="checkmark"></span>

{# {% if translation_domain == 'lcshop' %}
{{ name|lc_trad(easyadmin['entity']['name'], 'field') }}
{% else %} #}
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain))|raw -}}
{# {{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain))|raw -}} #}

{% set entityNameOrObject = form.parent.vars.data %}
{% if not entityNameOrObject and form.parent.vars.errors.form.config.dataClass is defined %}
{% set entityNameOrObject = form.parent.vars.errors.form.config.dataClass %}
{% endif %}

{{- (label is not empty and '.' in label) ? label|trans({}, 'admin') : name|sov_trans_admin_field(entityNameOrObject) -}}

{# {% endif %} #}
{{- form_errors(form) -}}
</label>
{%- endif -%}

Loading…
Отказ
Запис