123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- {#
- This file is part of the Sonata package.
- (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
- #}
- {% extends 'SonataAdminBundle:Form:silex_form_div_layout.html.twig' %}
- {# Labels #}
- {% block generic_label %}
- {% spaceless %}
- {% if required %}
- {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
- {% endif %}
- {% if in_list_checkbox is defined and in_list_checkbox and widget is defined %}
- <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>
- {{ widget|raw }}
- <span>
- {{ label|trans({}, sonata_admin.admin.translationDomain) }}
- </span>
- {{ required ? '*' : '' }}
- </label>
- {% else %}
- <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans({}, sonata_admin.admin.translationDomain) }} {{ required ? '*' : '' }} </label>
- {% endif %}
- {% endspaceless %}
- {% endblock %}
- {% block field_row %}
- {% if sonata_admin is not defined or not sonata_admin_enabled or not sonata_admin.field_description %}
- {{ parent() }}
- {% else %}
- <div class="clearfix{% if errors|length > 0%} error{%endif%}" id="sonata-ba-field-container-{{ id }}">
- {% block label %}
- {% if sonata_admin.field_description.options.name is defined %}
- {{ form_label(form, sonata_admin.field_description.options.name) }}
- {% else %}
- {{ form_label(form) }}
- {% endif %}
- {% endblock %}
- <div class="input sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %}">
- {{ form_widget(form) }}
- {% if sonata_admin.field_description.help %}
- <span class="help-block sonata-ba-field-help">{{ sonata_admin.field_description.help }}</span>
- {% endif %}
- {% if errors|length > 0 %}
- <div class="sonata-ba-field-error-messages">
- {{ form_errors(form) }}
- </div>
- {% endif %}
- </div>
- </div>
- {% endif %}
- {% endblock field_row %}
|