{% extends 'generic/_base.html' %} {% load i18n %} {% comment %} Blocks: - title: Page title - controls: Control elements displayed between the header and content - tabs: Page tabs - content: Primary page content - form: Content within the
element - buttons: Form submission buttons - modals: Any pre-loaded modals Context: - object: Python instance of the object being edited - form: The edit form - return_url: The URL to which the user is redirected after submitting the form {% endcomment %} {% block title %} {% if object.pk %} {% trans "Editing" %} {{ object|meta:"verbose_name" }} {{ object }} {% else %} {% blocktrans trimmed with object_type=object|meta:"verbose_name" %} Add a new {{ object_type }} {% endblocktrans %} {% endif %} {% endblock title %} {% block controls %}
{# Link to model documentation #} {% if settings.DOCS_ROOT and object.docs_url %} {% trans "Help" %} {% endif %}
{% endblock controls %} {% block tabs %} {% endblock tabs %} {% block content %}
{# Warn about missing prerequisite objects #} {% if prerequisite_model %} {% include 'inc/missing_prerequisites.html' %} {% endif %} {% csrf_token %}
{% block form %} {% include 'htmx/form.html' %} {% endblock form %}
{% block buttons %} {% trans "Cancel" %} {% if object.pk %} {% else %}
{% endif %} {% endblock buttons %}
{% endblock content %} {% block modals %} {% include 'inc/htmx_modal.html' with size='lg' %} {% endblock %}