{% extends get_form_property_template(schema, container_style) %}

{% set input_languages = [] %}
{% set disabled_language_codes = [] %}
{% set disabled_language_names = [] %}
{% set disabled_input_language_codes = [] %}
{% for language in languages %}
  {% if schema.get('languages') == 'all' or language.lang_code in schema.get('languages', ['en']) %}
    {% if language.enabled_for_input or (data and data.text and data.text.keys and language.lang_code in data.text.keys()) %}
      {% do input_languages.append(language) %}
    {% endif %}
    {% if not language.enabled_for_input %}
      {% do disabled_language_codes.append(language.lang_code) %}
      {% do disabled_language_names.append(language.names | get_translated_text) %}
      {% if language in input_languages %}
        {% do disabled_input_language_codes.append(language.lang_code) %}
      {% endif %}
    {% endif %}
  {% endif %}
{% endfor %}

{% set is_required = is_required and (schema.minLength or schema.choices) %}

{% block property_label %}
  <div class="col-md-3" style="padding-right: 0">
    {% set property_label_class = 'col-md-12' %}
    {% include "objects/forms/property_label.html" %}
    <div class="form-switch">
      {% include "objects/forms/form_text_language_picker.html" %}
    </div>
  </div>
{% endblock %}

{% block property_field %}
  {% include "objects/fields/text_field.html" %}
{% endblock %}
