|
|
@@ -0,0 +1,39 @@ |
|
|
|
{% use '@LcSov/adminlte/crud/form_theme.html.twig' %} |
|
|
|
|
|
|
|
{% block form_label %} |
|
|
|
{# <div class="some-custom-class"> #} |
|
|
|
{# {{ parent() }} #} |
|
|
|
{# </div> #} |
|
|
|
|
|
|
|
{% if label is same as(false) -%} |
|
|
|
<label>{# the empty <label> is needed to not break the form design #}</label> |
|
|
|
{%- else -%} |
|
|
|
{%- if compound is defined and compound -%} |
|
|
|
{%- set element = 'legend' -%} |
|
|
|
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%} |
|
|
|
{%- else -%} |
|
|
|
{%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%} |
|
|
|
{%- endif -%} |
|
|
|
{% if required -%} |
|
|
|
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} |
|
|
|
{%- endif -%} |
|
|
|
{% if label is empty -%} |
|
|
|
{%- if label_format is not empty -%} |
|
|
|
{% set label = label_format|replace({ |
|
|
|
'%name%': name, |
|
|
|
'%id%': id, |
|
|
|
}) %} |
|
|
|
{%- else -%} |
|
|
|
{# {% set label = name|humanize %} #} |
|
|
|
{%- endif -%} |
|
|
|
{%- endif -%} |
|
|
|
|
|
|
|
{% 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 %} |
|
|
|
{#{{ dump() }}#} |
|
|
|
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ (label is not empty and '.' in label) ? label|trans({}, 'admin') : name|lc_trans_admin_field(entityNameOrObject) }}</{{ element|default('label') }}> |
|
|
|
|
|
|
|
{%- endif -%} |
|
|
|
{% endblock %} |