Переименование URL configurablekit-* → configurableproduct-*
- URL paths: configurable-kits/ → configurable/ - URL names: configurablekit-list → configurableproduct-list и т.д. - Обновлены все ссылки в шаблонах и views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<div class="container-fluid px-4 py-3">
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<ol class="breadcrumb breadcrumb-sm mb-0">
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurablekit-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurablekit-detail' object.pk %}">{{ object.name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurableproduct-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurableproduct-detail' object.pk %}">{{ object.name }}</a></li>
|
||||
<li class="breadcrumb-item active">Удаление</li>
|
||||
</ol>
|
||||
</nav>
|
||||
@@ -37,7 +37,7 @@
|
||||
<button type="submit" class="btn btn-danger">
|
||||
<i class="bi bi-trash me-1"></i>Да, удалить
|
||||
</button>
|
||||
<a href="{% url 'products:configurablekit-detail' object.pk %}" class="btn btn-secondary">
|
||||
<a href="{% url 'products:configurableproduct-detail' object.pk %}" class="btn btn-secondary">
|
||||
<i class="bi bi-x-circle me-1"></i>Отмена
|
||||
</a>
|
||||
</form>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="container-fluid px-4 py-3">
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<ol class="breadcrumb breadcrumb-sm mb-0">
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurablekit-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurableproduct-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item active">{{ configurable_kit.name }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
@@ -17,10 +17,10 @@
|
||||
<div class="mb-3 d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">{{ configurable_kit.name }}</h4>
|
||||
<div>
|
||||
<a href="{% url 'products:configurablekit-update' configurable_kit.pk %}" class="btn btn-warning btn-sm">
|
||||
<a href="{% url 'products:configurableproduct-update' configurable_kit.pk %}" class="btn btn-warning btn-sm">
|
||||
<i class="bi bi-pencil me-1"></i>Редактировать
|
||||
</a>
|
||||
<a href="{% url 'products:configurablekit-delete' configurable_kit.pk %}" class="btn btn-danger btn-sm">
|
||||
<a href="{% url 'products:configurableproduct-delete' configurable_kit.pk %}" class="btn btn-danger btn-sm">
|
||||
<i class="bi bi-trash me-1"></i>Удалить
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@ input[name*="DELETE"] {
|
||||
<div class="container-fluid px-4 py-3">
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<ol class="breadcrumb breadcrumb-sm mb-0">
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurablekit-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'products:configurableproduct-list' %}">Вариативные товары</a></li>
|
||||
<li class="breadcrumb-item active">{% if object %}Редактирование{% else %}Создание{% endif %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
@@ -196,7 +196,7 @@ input[name*="DELETE"] {
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle me-1"></i>Сохранить
|
||||
</button>
|
||||
<a href="{% if object %}{% url 'products:configurablekit-detail' object.pk %}{% else %}{% url 'products:configurablekit-list' %}{% endif %}"
|
||||
<a href="{% if object %}{% url 'products:configurableproduct-detail' object.pk %}{% else %}{% url 'products:configurableproduct-list' %}{% endif %}"
|
||||
class="btn btn-secondary">
|
||||
<i class="bi bi-x-circle me-1"></i>Отмена
|
||||
</a>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
{% for item in configurable_kits %}
|
||||
<tr>
|
||||
<td class="fw-semibold">
|
||||
<a href="{% url 'products:configurablekit-detail' item.pk %}" class="text-decoration-none">
|
||||
<a href="{% url 'products:configurableproduct-detail' item.pk %}" class="text-decoration-none">
|
||||
{{ item.name }}
|
||||
</a>
|
||||
</td>
|
||||
@@ -92,15 +92,15 @@
|
||||
</td>
|
||||
<td><small class="text-muted">{{ item.created_at|date:"d.m.Y H:i" }}</small></td>
|
||||
<td>
|
||||
<a href="{% url 'products:configurablekit-detail' item.pk %}"
|
||||
<a href="{% url 'products:configurableproduct-detail' item.pk %}"
|
||||
class="btn btn-sm btn-outline-primary" title="Просмотр">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a href="{% url 'products:configurablekit-update' item.pk %}"
|
||||
<a href="{% url 'products:configurableproduct-update' item.pk %}"
|
||||
class="btn btn-sm btn-outline-warning" title="Редактировать">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<a href="{% url 'products:configurablekit-delete' item.pk %}"
|
||||
<a href="{% url 'products:configurableproduct-delete' item.pk %}"
|
||||
class="btn btn-sm btn-outline-danger" title="Удалить">
|
||||
<i class="bi bi-trash"></i>
|
||||
</a>
|
||||
@@ -109,7 +109,7 @@
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="7" class="text-center text-muted py-4">
|
||||
Нет вариативных товаров. <a href="{% url 'products:configurablekit-create' %}">Создать первый</a>
|
||||
Нет вариативных товаров. <a href="{% url 'products:configurableproduct-create' %}">Создать первый</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -99,14 +99,14 @@ urlpatterns = [
|
||||
path('api/attributes/<int:pk>/values/<int:value_id>/delete/', views.delete_attribute_value_api, name='attribute-delete-value'),
|
||||
|
||||
# CRUD URLs for ConfigurableProduct
|
||||
path('configurable-kits/', views.ConfigurableProductListView.as_view(), name='configurablekit-list'),
|
||||
path('configurable-kits/create/', views.ConfigurableProductCreateView.as_view(), name='configurablekit-create'),
|
||||
path('configurable-kits/<int:pk>/', views.ConfigurableProductDetailView.as_view(), name='configurablekit-detail'),
|
||||
path('configurable-kits/<int:pk>/update/', views.ConfigurableProductUpdateView.as_view(), name='configurablekit-update'),
|
||||
path('configurable-kits/<int:pk>/delete/', views.ConfigurableProductDeleteView.as_view(), name='configurablekit-delete'),
|
||||
|
||||
path('configurable/', views.ConfigurableProductListView.as_view(), name='configurableproduct-list'),
|
||||
path('configurable/create/', views.ConfigurableProductCreateView.as_view(), name='configurableproduct-create'),
|
||||
path('configurable/<int:pk>/', views.ConfigurableProductDetailView.as_view(), name='configurableproduct-detail'),
|
||||
path('configurable/<int:pk>/update/', views.ConfigurableProductUpdateView.as_view(), name='configurableproduct-update'),
|
||||
path('configurable/<int:pk>/delete/', views.ConfigurableProductDeleteView.as_view(), name='configurableproduct-delete'),
|
||||
|
||||
# API для управления вариантами ConfigurableProduct
|
||||
path('configurable-kits/<int:pk>/options/add/', views.add_option_to_configurable, name='configurablekit-add-option'),
|
||||
path('configurable-kits/<int:pk>/options/<int:option_id>/remove/', views.remove_option_from_configurable, name='configurablekit-remove-option'),
|
||||
path('configurable-kits/<int:pk>/options/<int:option_id>/set-default/', views.set_option_as_default, name='configurablekit-set-default-option'),
|
||||
path('configurable/<int:pk>/options/add/', views.add_option_to_configurable, name='configurableproduct-add-option'),
|
||||
path('configurable/<int:pk>/options/<int:option_id>/remove/', views.remove_option_from_configurable, name='configurableproduct-remove-option'),
|
||||
path('configurable/<int:pk>/options/<int:option_id>/set-default/', views.set_option_as_default, name='configurableproduct-set-default-option'),
|
||||
]
|
||||
@@ -69,7 +69,7 @@ class ConfigurableProductListView(LoginRequiredMixin, ManagerOwnerRequiredMixin,
|
||||
|
||||
if self.request.user.has_perm('products.add_configurablekitproduct'):
|
||||
action_buttons.append({
|
||||
'url': reverse_lazy('products:configurablekit-create'),
|
||||
'url': reverse_lazy('products:configurableproduct-create'),
|
||||
'text': 'Создать вариативный товар',
|
||||
'class': 'btn-primary',
|
||||
'icon': 'plus-circle'
|
||||
@@ -373,7 +373,7 @@ class ConfigurableProductCreateView(LoginRequiredMixin, ManagerOwnerRequiredMixi
|
||||
return form.cleaned_data.get(deletion_field_name, False)
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy('products:configurablekit-detail', kwargs={'pk': self.object.pk})
|
||||
return reverse_lazy('products:configurableproduct-detail', kwargs={'pk': self.object.pk})
|
||||
|
||||
|
||||
class ConfigurableProductUpdateView(LoginRequiredMixin, ManagerOwnerRequiredMixin, UpdateView):
|
||||
@@ -650,13 +650,13 @@ class ConfigurableProductUpdateView(LoginRequiredMixin, ManagerOwnerRequiredMixi
|
||||
return form.cleaned_data.get(deletion_field_name, False)
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy('products:configurablekit-detail', kwargs={'pk': self.object.pk})
|
||||
return reverse_lazy('products:configurableproduct-detail', kwargs={'pk': self.object.pk})
|
||||
|
||||
|
||||
class ConfigurableProductDeleteView(LoginRequiredMixin, ManagerOwnerRequiredMixin, DeleteView):
|
||||
model = ConfigurableProduct
|
||||
template_name = 'products/configurableproduct_confirm_delete.html'
|
||||
success_url = reverse_lazy('products:configurablekit-list')
|
||||
success_url = reverse_lazy('products:configurableproduct-list')
|
||||
|
||||
def form_valid(self, form):
|
||||
messages.success(self.request, f'Вариативный товар "{self.object.name}" успешно удалён!')
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<ul class="dropdown-menu" aria-labelledby="productsDropdown">
|
||||
<li><a class="dropdown-item" href="{% url 'products:all-products' %}">Все товары</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'products:catalog' %}"><i class="bi bi-grid-3x3-gap"></i> Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'products:configurablekit-list' %}">Вариативные товары</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'products:configurableproduct-list' %}">Вариативные товары</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="{% url 'products:category-list' %}">Категории</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'products:tag-list' %}">Теги</a></li>
|
||||
|
||||
Reference in New Issue
Block a user