{% load i18n admin_urls placeholder_admin_tags %}{% comment %} This is the admin template to render the PlaceholderEditorInline. It renders tab buttons for each inline, and registers them as "placeholder panes" for the editor. inline_admin_formset = generated InlineAdminFormSet of the PlaceholderEditorInline. Each form holds a placeholder. inline_admin_formset.opts = PlaceholderEditorInline object inline_admin_formset.form.instance = Placeholder object inline_admin_formset.form.'field'.value = value! inline_admin_formset.__iter__ gives all forms + a template form inline_admin_formset.formset.__iter__ gives the raw forms only inline_admin_formsets = all InlineAdminFormSet objects of the parent {% endcomment %}
{{ inline_admin_formset.formset.management_form }} {{ inline_admin_formset.formset.non_form_errors }} {# looping in `inline_admin_formset.formset.forms` excludes empty form #} {# looping in `_admin_formset` includes the empty placeholder as last item #} {# tab navigation #} {# each inline object is a placeholders #}
{# all the region tabs #} {% for inline_admin_form in inline_admin_formset %} {% with placeholder_form=inline_admin_form.form %} {% if placeholder_form.DELETE.value %} {# preserve deletion markers after form was resubmitted. The cp_tabs.js adds them in the same way. #} {% else %} {% getfirstof inline_admin_form.form.instance.get_allowed_plugins inline_admin_formset.opts.get_all_allowed_plugins as cp_plugin_list %} {% getfirstof inline_admin_form.form.instance.id '' as placeholder_id %}{# used by pane.html / controls.html #} {% getfirstof placeholder_form.slot.value '__EMPTY__' as placeholder_slot %}
{% include "admin/fluent_contents/placeholderfield/pane_tabbar.html" with other_instance_languages=inline_admin_form.formset.other_instance_languages %} {% if placeholder_form.errors %}{# Should never happen, but when it does, this aids debugging #}
  • {{ placeholder_form.errors.as_text|linebreaksbr }}
{% endif %} {% if inline_admin_form.has_auto_field or inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %} {% for fieldset in inline_admin_form %}{% for line in fieldset %}{% for adminfield in line %}{{ adminfield.field.as_hidden }} {% endfor %}{% endfor %}{% endfor %}
{% endif %} {% endwith %} {% endfor %}

{% trans "There are no placeholders in this template." %}

{# this is a "lost+found" bucket for layout switching #}
{# all remaining fieldsets #} {% block tabmain_end %}{% endblock %}