Feature: компактные формы заказов, колонки Товар/Количество

Made-with: Cursor
This commit is contained in:
2026-02-26 05:17:21 +00:00
parent 90ae4bdc1b
commit 8af8e0b1f4
7 changed files with 221 additions and 26 deletions

View File

@@ -3,20 +3,64 @@
{% block content %}
<div class="ws-card">
<h2 class="ws-page-title">{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
<form method="post" class="ws-form-card">
<form method="post" class="ws-form-card ws-form-compact">
{% csrf_token %}
{% for field in form %}
<div class="ws-form-group">
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% if field.errors %}<small class="ws-text-danger">{{ field.errors.0 }}</small>{% endif %}
<div class="ws-form-row ws-form-row-date-number">
<div class="ws-form-group ws-field-date">
<label for="{{ form.date.id_for_label }}">{{ form.date.label }}</label>
{{ form.date }}
{% if form.date.errors %}<small class="ws-text-danger">{{ form.date.errors.0 }}</small>{% endif %}
</div>
<div class="ws-form-group ws-field-number">
<label for="{{ form.number.id_for_label }}">{{ form.number.label }}</label>
{{ form.number }}
{% if form.number.errors %}<small class="ws-text-danger">{{ form.number.errors.0 }}</small>{% endif %}
</div>
</div>
<div class="ws-form-row ws-form-row-2">
<div class="ws-form-group">
<label for="{{ form.organization.id_for_label }}">{{ form.organization.label }}</label>
{{ form.organization }}
{% if form.organization.errors %}<small class="ws-text-danger">{{ form.organization.errors.0 }}</small>{% endif %}
</div>
<div class="ws-form-group">
<label for="{{ form.supplier.id_for_label }}">{{ form.supplier.label }}</label>
{{ form.supplier }}
{% if form.supplier.errors %}<small class="ws-text-danger">{{ form.supplier.errors.0 }}</small>{% endif %}
</div>
</div>
<div class="ws-form-row ws-form-row-2">
<div class="ws-form-group">
<label for="{{ form.currency.id_for_label }}">{{ form.currency.label }}</label>
{{ form.currency }}
{% if form.currency.errors %}<small class="ws-text-danger">{{ form.currency.errors.0 }}</small>{% endif %}
</div>
<div class="ws-form-group">
<label for="{{ form.rate.id_for_label }}">{{ form.rate.label }}</label>
{{ form.rate }}
{% if form.rate.errors %}<small class="ws-text-danger">{{ form.rate.errors.0 }}</small>{% endif %}
</div>
</div>
<div class="ws-form-row ws-form-row-2">
<div class="ws-form-group">
<label for="{{ form.author.id_for_label }}">{{ form.author.label }}</label>
{{ form.author }}
{% if form.author.errors %}<small class="ws-text-danger">{{ form.author.errors.0 }}</small>{% endif %}
</div>
</div>
{% endfor %}
<div class="ws-form-section">
<h3 class="ws-form-section-title">Товары</h3>
{{ formset.management_form }}
<div class="ws-table-wrap">
<table class="ws-table" id="supplier-order-items">
<table class="ws-table ws-table-items" id="supplier-order-items">
<colgroup>
<col class="ws-col-product">
<col>
<col>
<col class="ws-col-qty">
<col>
<col class="ws-col-del">
</colgroup>
<thead>
<tr>
<th>Товар</th>
@@ -33,7 +77,7 @@
<td>{{ f.id }}{{ f.product }}</td>
<td>{{ f.price }}</td>
<td>{{ f.currency }}</td>
<td>{{ f.quantity }}</td>
<td class="ws-col-qty">{{ f.quantity }}</td>
<td class="row-amount ws-num"></td>
<td>{% if f.DELETE %}{{ f.DELETE }}{% endif %}</td>
</tr>