{% extends "core/base.jinja" %} {% block additional_js %} {% endblock %} {% macro action_form(form) %}
{{ form.non_field_errors() }}
{{ form.task.errors }} {{ form.task.label_tag() }} {{ form.task|add_attr("x-model=action") }}
{{ form.trigger_at.as_field_group() }}
{{ form.counters.as_field_group() }}
{%- if form.DELETE -%}
{{ form.DELETE.as_field_group() }}
{%- else -%} {%- endif -%} {%- for field in form.hidden_fields() -%} {{ field }} {%- endfor -%}
{% endmacro %} {% macro price_form(form) %}
{{ form.non_field_errors() }}
{{ form.amount.as_field_group() }}
{{ form.label.errors }} {{ form.label }} {{ form.label.help_text }}
{{ form.groups.as_field_group() }}
{{ form.is_always_shown.errors }}
{{ form.is_always_shown }}
{{ form.is_always_shown.help_text }}
{%- if form.DELETE -%}
{{ form.DELETE.as_field_group() }}
{%- else -%}
{%- endif -%} {%- for field in form.hidden_fields() -%} {{ field }} {%- endfor -%}

{% endmacro %} {% block content %} {% if object %}

{% trans name=object %}Edit product {{ name }}{% endtrans %}

{% trans %}Creation date{% endtrans %} : {{ object.created_at|date }}

{% trans %}Last update{% endtrans %} : {{ object.updated_at|date }}

{% else %}

{% trans %}Product creation{% endtrans %}

{% endif %}
{% csrf_token %} {{ form.non_field_errors() }}
{{ form.name.as_field_group() }}
{{ form.code.as_field_group() }}
{{ form.description.as_field_group() }}
{{ form.club.as_field_group() }}
{{ form.product_type.as_field_group() }}
{{ form.icon.as_field_group() }}
{{ form.purchase_price.as_field_group() }}
{{ form.limit_age.as_field_group() }}
{{ form.tray }}
{{ form.tray.label_tag() }} {{ form.tray.help_text }}
{{ form.clic_limit.as_field_group() }}
{{ form.counters.as_field_group() }}

{% trans %}Prices{% endtrans %}

{{ form.price_formset.management_form }}
{%- for form in form.price_formset.forms -%}
{{ price_form(form) }}
{%- endfor -%}

{% trans %}Automatic actions{% endtrans %}

{%- trans trimmed -%} Automatic actions allows to schedule product changes ahead of time. {%- endtrans -%}

{{ form.action_formset.management_form }}
{%- for f in form.action_formset.forms -%} {{ action_form(f) }} {%- endfor -%}
{{ form.archived.as_field_group() }}

{% endblock %}