diff --git a/myproject/orders/templates/orders/status_list.html b/myproject/orders/templates/orders/status_list.html index f38668a..9392178 100644 --- a/myproject/orders/templates/orders/status_list.html +++ b/myproject/orders/templates/orders/status_list.html @@ -4,152 +4,226 @@ {% block title %}Статусы заказов{% endblock %} {% block content %} -
-
-
-

Статусы заказов

-

Управление статусами для заказов вашего магазина

+ + +
+
+
+

Статусы

+

{{ statuses|length }} статусов в системе

- {% if messages %} -
-
- {% for message in messages %} - - {% endfor %} + {% for message in messages %} + -
+ {% endfor %} {% endif %} -
-
-
-
- - - - - - - - - - - - - - - {% for status in statuses %} - - - - - - - - - - - {% empty %} - - - - {% endfor %} - -
НазваниеКодТипИсход сделкиЦветЗаказовДействия
- {{ status.order }} - - {{ status.name }} - {% if status.description %} -
- {{ status.description|truncatewords:10 }} - {% endif %} -
- {{ status.code }} - - {% if status.is_system %} - Системный - {% else %} - Пользовательский - {% endif %} - - {% if status.is_positive_end %} - ✓ Успешный - {% elif status.is_negative_end %} - ✗ Отрицательный - {% else %} - - {% endif %} - -
-
- {{ status.orders_count }} - -
- - Редактировать - - {% if not status.is_system and status.orders_count == 0 %} - - Удалить - - {% else %} - - {% endif %} -
-
- Статусы не найдены -
+
+ {% for status in statuses %} +
+
+
+
+

{{ status.name }}

+
+ {{ status.code }} + {% if status.is_system %} + sys + {% endif %} + {% if status.is_positive_end %} + + {% elif status.is_negative_end %} + + {% endif %} + {% if status.orders_count > 0 %} + {{ status.orders_count }} заказ{{ status.orders_count|pluralize:",а,ов" }} + {% endif %} +
- - {% if is_paginated %} - - {% endif %} +
+ + Редактировать + + {% if not status.is_system and status.orders_count == 0 %} + + Удалить + + {% else %} + + {% endif %} +
+ {% empty %} +
+ +

Статусы не найдены

+
+ {% endfor %}
{% endblock %} diff --git a/myproject/products/forms.py b/myproject/products/forms.py index 43de98b..9f842e5 100644 --- a/myproject/products/forms.py +++ b/myproject/products/forms.py @@ -764,7 +764,7 @@ ConfigurableKitOptionFormSetCreate = inlineformset_factory( form=ConfigurableKitOptionForm, formset=BaseConfigurableKitOptionFormSet, fields=['kit', 'is_default'], # Убрали 'attributes' - заполняется через ConfigurableKitOptionAttribute - extra=1, # Показать 1 пустую форму + extra=0, # Не требуем пустые формы (варианты скрыты в UI) can_delete=True, min_num=0, validate_min=False, diff --git a/myproject/products/templates/products/configurablekit_form.html b/myproject/products/templates/products/configurablekit_form.html index 2391fb3..63e78be 100644 --- a/myproject/products/templates/products/configurablekit_form.html +++ b/myproject/products/templates/products/configurablekit_form.html @@ -189,80 +189,8 @@ input[name*="DELETE"] {
- -
-
-
Варианты (комплекты)
-
-
- {{ option_formset.management_form }} - - {% if option_formset.non_form_errors %} -
- {{ option_formset.non_form_errors }} -
- {% endif %} - -
- {% for form in option_formset %} -
- {{ form.id }} - {% if form.instance.pk %} - - {% endif %} -
-
- - {{ form.kit }} - {% if form.kit.errors %} -
{{ form.kit.errors.0 }}
- {% endif %} -
- - - {% for field in form %} - {% if "attribute_" in field.name %} -
- - {{ field }} - {% if field.errors %} -
{{ field.errors.0 }}
- {% endif %} -
- {% endif %} - {% endfor %} - -
- -
- {{ form.is_default }} - -
- {% if form.is_default.errors %} -
{{ form.is_default.errors.0 }}
- {% endif %} -
-
- {% if option_formset.can_delete %} - - {{ form.DELETE }} - - {% endif %} -
-
-
- {% endfor %} -
- - -
-
+ + {{ option_formset.management_form }}