{% extends "core/base.jinja" %} {% block additional_css %} {% endblock %} {% macro field_row(field) %}
{{ field.label_tag() }} {{ field }} {{ field.errors }} {% if field.name == "item" %}
{% trans %}Current quantity:{% endtrans %}
{% endif %}
{% endmacro %} {% macro action_row(f, removable=true) %}
{% for h in f.hidden_fields() %}{{ h }}{% endfor %} {{ f.non_field_errors() }} {% for field in f.visible_fields() %} {{ field_row(field) }} {% endfor %} {% for b in f.blocks %}
{{ b.form.non_field_errors() }} {% for h in b.form.hidden_fields() %}{{ h }}{% endfor %} {% for field in b.form.visible_fields() %} {{ field_row(field) }} {% endfor %}
{% endfor %} {% if removable %} {% endif %}

{% endmacro %} {% block script %} {% endblock %} {% block title %} {% trans %}New stock action{% endtrans %} {% endblock %} {% block content %}

{% trans %}New stock action in {% endtrans %}{{ stock.name }}

{% set action_value = form["action"].value() %}
{% csrf_token %} {{ form.non_field_errors() }}
{% for field in form.visible_fields() %} {{ field_row(field) }} {% endfor %}
{{ formset.management_form["INITIAL_FORMS"] }} {{ formset.management_form["MIN_NUM_FORMS"] }} {{ formset.management_form["MAX_NUM_FORMS"] }} {{ formset.non_form_errors() }}

{% trans %}Items{% endtrans %}

{% for f in formset %} {{ action_row(f, not loop.first) }} {% endfor %}
{% endblock %}