{#
 # This file is part of the CRUDlex package.
 #
 # (c) Philip Lehmann-Böhm <philip@philiplb.de>
 #
 # For the full copyright and license information, please view the LICENSE
 # file that was distributed with this source code.
 #}

<label for="{{ field }}" class="control-label">
    {{ definition.getFieldLabel(field) }}
    {% if annotations %}
        {% set markers = [] %}
        {% if definition.getField(field, 'required', false) %}
            {% set markers = markers|merge(['crudlex.field.required'|trans]) %}
        {% endif %}
        {% if definition.getField(field, 'unique', false) %}
            {% set markers = markers|merge(['crudlex.field.unique'|trans]) %}
        {% endif %}
        {{ markers|join('crudlex.field.separator'|trans) }}
    {% endif %}
    {% if definition.getField(field, 'description') %}
        <p><small>{{ definition.getField(field, 'description') }}</small></p>
    {% endif %}
</label>
