{% extends "_base.html" %} {% load i18n %} {% load static %} {% load widget_tweaks %} {% load base_filters %} {% load content_filters %} {% load page_filters %} {% load rules %} {% load render_bundle from webpack_loader %} {% block content %} {% get_current_language as LANGUAGE_CODE %} {% has_perm 'cms.change_page_object' request.user page as can_edit_page %} {% if page_form.instance.id and can_edit_page and not page.archived %}
{% csrf_token %}
{% endif %}
{% csrf_token %}

{% if page %} {% if page_translation_form.instance.id %} {% with page_translation_form.instance.title as page_title %} {% blocktrans %}Edit page "{{ page_title }}"{% endblocktrans %} {% endwith %} {% if LANGUAGE_CODE != language.slug %} {% if page.backend_translation %} ({% trans "Title in" %} {% translated_language_name LANGUAGE_CODE %}: "{{ page.backend_translation.title }}") {% endif %} {% endif %} {% else %} {% trans "Create new translation" %} {% endif %} {% else %} {% trans "Create new page" %} {% endif %}

{% if not page_form.instance.id or not page_form.instance.archived %}
{% has_perm 'cms.publish_page_object' request.user page as can_publish_page %} {% if can_publish_page %} {% elif can_edit_page %} {% endif %}
{% endif %}
{% include "_form_language_tabs.html" with target="edit_page" instance=page_form.instance content_field="page_id" %}
{% if page_translation_form.instance.currently_in_translation %}
{% trans "Translation in progress" %} ({% trans "Cancel translation process" %})
{% endif %}
{% if page_translation_form.instance.id %}
{% trans "Version" %}:
{{ page_translation_form.instance.version }} ({% trans "Show" %})
{% trans "Status" %}:
{% if page.explicitly_archived %} {% trans "Archived" %} {% elif page.implicitly_archived %} {% trans "Archived, because a parent page is archived" %} {% else %} {{ page_translation_form.instance.get_status_display }} {% endif %}
{% endif %}
{% render_field page_translation_form.title|add_error_class:"border-red-500" class+="mb-2" %} {% if page_translation_form.instance.id %} {% if request.region.short_urls_enabled and request.user.expert_mode %} {% endif %} {% endif %} {% render_field page_translation_form.content class+="tinymce_textarea flex-auto" %}
{% if language.slug in TEXTLAB_API_LANGUAGES and request.region.hix_enabled and TEXTLAB_API_ENABLED %} {% include "../hix_widget.html" %} {% endif %} {% if page %}

{% trans "Minor edit" %}

{% render_field page_translation_form.minor_edit %}
{% minor_edit_help_text request.region language page_translation_form %}
{% endif %}

{% trans "Settings of the page" %}

{% render_field page_form.icon label=page_form.icon.label %}
{% render_field page_form|get_private_member:"ref_node_id" %} {% render_field page_form|get_private_member:"position" %} {% render_field page_form.parent id="parent" %}
{% include "pages/_page_order_table.html" %}
{% render_field page_form.mirrored_page_region id="mirrored_page_region" %}
{% include "pages/_mirrored_page_field.html" %}
{% render_field page_form.mirrored_page_first id="mirrored_page_first" %}
{% if request.user.expert_mode %}
{% render_field page_form.enable_api_token %}
{% render_field page_form.api_token|add_error_class:"border-red-500" class+="flex-grow text-ellipsis pointer-events-none !rounded-none !rounded-l" %}
{{ page_form.api_token.help_text }}
{% if perms.cms.grant_page_permissions and request.region.page_permissions_enabled %}

{% trans "This affects only users, who don't have the permission to change arbitrary pages anyway." %}

{% include "pages/_page_permission_table.html" %}
{% endif %} {% endif %} {% if page_form.organization.field.queryset.exists %}
{{ page_form.organization.help_text }}
{% render_field page_form.organization|add_error_class:"border-red-500" %}
{% endif %}
{% if page %}
{% if can_edit_page %}

{% trans "Actions" %}

{% if page_form.instance.id and can_edit_page and not page.archived %} {% endif %} {% if page.explicitly_archived %} {% elif page.implicitly_archived %} {% for ancestor in page.explicitly_archived_ancestors %} {{ ancestor.best_translation.title }} {% endfor %} {% else %} {% endif %} {% if perms.cms.delete_page %} {% if not page.is_leaf %} {% with page.get_descendants.prefetch_translations as descendants %} {% for descendant in descendants %} {{ descendant.best_translation.title }} {% endfor %} {% endwith %} {% elif page.mirroring_pages.exists %} {% with page.mirroring_pages.all.prefetch_translations as mirroring_pages %}

{% blocktrans count counter=mirroring_pages|length trimmed %} To delete this page, you have to remove the embedded live content from this page first: {% plural %} To delete this page, you have to remove the embedded live content from these pages first: {% endblocktrans %}

{% for mirroring_page in mirroring_pages %} {% has_perm 'cms.change_page_object' request.user mirroring_page as can_change_page_object %} {% if can_change_page_object %} {{ mirroring_page.best_translation.title }} {% if mirroring_page.region != request.region %}({{ mirroring_page.region }}){% endif %} {% else %} {{ mirroring_page.best_translation.title }} {% if mirroring_page.region != request.region %}({{ mirroring_page.region }}){% endif %} {% endif %} {% endfor %} {% endwith %} {% else %} {% endif %} {% endif %}
{% endif %}

{% trans "Translator view" %}

{% trans "Show translator view" %}
{% endif %}
{{ media_config_data|json_script:"media_config_data" }} {% if not can_edit_page or page_form.instance.id and page_form.instance.archived %} {% include "../_tinymce_config.html" with readonly=1 %} {% else %} {% include "../_tinymce_config.html" %} {% if page_form.instance.id %} {% include "../_content_edit_lock.html" with lock_key=page.edit_lock_key %} {% endif %} {% endif %} {% include "../generic_confirmation_dialog.html" %} {% include "pages/_page_preview_overlay.html" %} {% endblock content %} {% block javascript %} {% render_bundle "editor" "js" %} {% endblock javascript %}