{% extends "base.html" %} {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} {% load crispy_forms_tags %} {% load i18n %} {% block content %}

{{ title }}

{% csrf_token %} {{ form|crispy }} {# The next part concerns the option formset #} {# Generate some hidden fields that manage the number of options, and make easier the parsing #} {{ formset.management_form }} {# Fill initial data #} {% for form in formset %} {% if forloop.first %} {% endif %} {# These fields are hidden but handled by the formset to link the id and the invoice id #} {{ form.food }} {{ form.id }} {% endfor %}
{{ form.name.label }}* {{ form.extra_cost.label }}* {{ form.available.label }}*
{{ form.name }} {{ form.extra_cost }} {{ form.available }}
{# Display buttons to add and remove options #}
{# Hidden div that store an empty product form, to be copied into new forms #} {% endblock %} {% block extrajavascript %} {% endblock %}