{% extends "../../_collapsible_box.html" %}
{% load i18n %}
{% load static %}
{% load content_filters %}
{% load widget_tweaks %}
{% block collapsible_box_icon %}
    feather
{% endblock collapsible_box_icon %}
{% block collapsible_box_title %}
    {% minor_edit_label request.region language %}
{% endblock collapsible_box_title %}
{% block collapsible_box_content %}
    <div>
        {% render_field poi_translation_form.minor_edit class+="mutually-exclusive-checkbox" data-unsaved-warning-exclude="" %}
        <label for="{{ poi_translation_form.minor_edit.id_for_label }}"
               class="secondary">
            {{ poi_translation_form.minor_edit.label }}
        </label>
        <div class="help-text">
            {% minor_edit_help_text request.region language poi_translation_form %}
        </div>
    </div>
    {% if poi_translation_form.mt_form_is_enabled %}
        <div>
            {% render_field poi_translation_form.automatic_translation class+="mutually-exclusive-checkbox" %}
            <label for="{{ poi_translation_form.automatic_translation.id_for_label }}"
                   class="secondary">
                {{ poi_translation_form.automatic_translation.label }}
            </label>
            <div class="help-text">
                {{ poi_translation_form.automatic_translation.help_text }}
            </div>
            <div id="language-options" class="pl-2 hidden">
                {% if poi_translation_form.mt_translations_to_update.field.queryset.exists %}
                    <label for="{{ poi_translation_form.mt_translations_to_update.id_for_label }}"
                           class="secondary">
                        {{ poi_translation_form.mt_translations_to_update.label }}
                    </label>
                    {% render_field poi_translation_form.mt_translations_to_update %}
                {% endif %}
                {% if poi_translation_form.mt_translations_to_create.field.queryset.exists %}
                    <label for="{{ poi_translation_form.mt_translations_to_create.id_for_label }}"
                           class="secondary">
                        {{ poi_translation_form.mt_translations_to_create.label }}
                    </label>
                    {% render_field poi_translation_form.mt_translations_to_create %}
                {% endif %}
            </div>
        </div>
    {% endif %}
{% endblock collapsible_box_content %}
