|
@@ -12,39 +12,41 @@ file that was distributed with this source code.
|
|
|
{# Labels #}
|
|
|
{% block form_label %}
|
|
|
{% spaceless %}
|
|
|
- {% set label_attr = label_attr|merge({'class': label_attr.class|default('') ~ " control-label" }) %}
|
|
|
+ {% if label is not sameas(false) %}
|
|
|
+ {% set label_attr = label_attr|merge({'class': label_attr.class|default('') ~ " control-label" }) %}
|
|
|
|
|
|
- {% if not compound %}
|
|
|
- {% set label_attr = label_attr|merge({'for': id}) %}
|
|
|
- {% endif %}
|
|
|
- {% if required %}
|
|
|
- {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
|
|
|
- {% endif %}
|
|
|
+ {% if not compound %}
|
|
|
+ {% set label_attr = label_attr|merge({'for': id}) %}
|
|
|
+ {% endif %}
|
|
|
+ {% if required %}
|
|
|
+ {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
|
|
|
+ {% endif %}
|
|
|
|
|
|
- {% if label is empty %}
|
|
|
- {% set label = name|humanize %}
|
|
|
- {% endif %}
|
|
|
+ {% if label is empty %}
|
|
|
+ {% set label = name|humanize %}
|
|
|
+ {% 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>
|
|
|
- {% if not sonata_admin.admin %}
|
|
|
+ {% 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>
|
|
|
+ {% if not sonata_admin.admin %}
|
|
|
+ {{- label|trans({}, translation_domain) -}}
|
|
|
+ {% else %}
|
|
|
+ {{- label|trans({}, sonata_admin.admin.translationDomain) -}}
|
|
|
+ {% endif%}
|
|
|
+ </span>
|
|
|
+ </label>
|
|
|
+ {% else %}
|
|
|
+ <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
|
|
|
+ {% if not sonata_admin.admin%}
|
|
|
{{- label|trans({}, translation_domain) -}}
|
|
|
{% else %}
|
|
|
- {{- label|trans({}, sonata_admin.admin.translationDomain) -}}
|
|
|
- {% endif%}
|
|
|
- </span>
|
|
|
- </label>
|
|
|
- {% else %}
|
|
|
- <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
|
|
|
- {% if not sonata_admin.admin%}
|
|
|
- {{- label|trans({}, translation_domain) -}}
|
|
|
- {% else %}
|
|
|
- {{ sonata_admin.admin.trans(label) }}
|
|
|
- {% endif %}
|
|
|
- {{ required ? '*' : '' }}
|
|
|
- </label>
|
|
|
+ {{ sonata_admin.admin.trans(label) }}
|
|
|
+ {% endif %}
|
|
|
+ {{ required ? '*' : '' }}
|
|
|
+ </label>
|
|
|
+ {% endif %}
|
|
|
{% endif %}
|
|
|
{% endspaceless %}
|
|
|
{% endblock form_label %}
|