2026-03-06 16:08:19 +03:00
|
|
|
{% extends "base.html" %}
|
2026-03-06 18:40:11 +03:00
|
|
|
{% block title %}Группы — {{ store.name }} — ЭВОСИНК{% endblock %}
|
2026-03-06 16:08:19 +03:00
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
<nav aria-label="breadcrumb" class="mb-3">
|
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
|
<li class="breadcrumb-item"><a href="/catalog">Каталог</a></li>
|
|
|
|
|
<li class="breadcrumb-item active">{{ store.name }}</li>
|
|
|
|
|
</ol>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
|
|
|
|
<h1 class="h4 mb-0">Группы товаров</h1>
|
|
|
|
|
<a href="/catalog/export?type=groups&store_id={{ store.evotor_id }}" class="btn btn-outline-secondary btn-sm">
|
|
|
|
|
<i class="bi bi-download me-1"></i>Экспорт CSV
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{% if not groups %}
|
|
|
|
|
<div class="text-center py-5 text-muted">
|
|
|
|
|
<i class="bi bi-folder fs-1 mb-3 d-block"></i>
|
|
|
|
|
<p>Группы не найдены в этом магазине.</p>
|
|
|
|
|
<a href="/catalog/products?store_id={{ store.evotor_id }}" class="btn btn-outline-primary btn-sm">
|
|
|
|
|
Посмотреть все товары магазина
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
{% else %}
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table class="table table-striped table-hover align-middle">
|
|
|
|
|
<thead class="table-light">
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Название</th>
|
|
|
|
|
<th>Кол-во товаров</th>
|
|
|
|
|
<th>Фильтр</th>
|
|
|
|
|
<th></th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% for group in groups %}
|
|
|
|
|
{% set mode = filter_map.get(group.evotor_id) %}
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{{ group.name }}</td>
|
|
|
|
|
<td class="text-muted">{{ product_counts.get(group.evotor_id, 0) }}</td>
|
|
|
|
|
<td>
|
|
|
|
|
{% if mode == "include" %}
|
|
|
|
|
<span class="badge bg-success">✓ Включено</span>
|
|
|
|
|
{% elif mode == "exclude" %}
|
|
|
|
|
<span class="badge bg-danger">✗ Исключено</span>
|
|
|
|
|
{% else %}
|
|
|
|
|
<span class="badge bg-light text-muted border">— Нет правила</span>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-end">
|
|
|
|
|
<div class="d-flex gap-1 justify-content-end">
|
|
|
|
|
<a href="/catalog/products?store_id={{ store.evotor_id }}&group_id={{ group.evotor_id }}"
|
|
|
|
|
class="btn btn-outline-secondary btn-sm" title="Товары">
|
|
|
|
|
<i class="bi bi-arrow-right"></i>
|
|
|
|
|
</a>
|
|
|
|
|
<div class="dropdown">
|
|
|
|
|
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" data-bs-toggle="dropdown">
|
|
|
|
|
<i class="bi bi-funnel"></i>
|
|
|
|
|
</button>
|
|
|
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
|
|
|
<li>
|
|
|
|
|
<form method="post" action="/catalog/filter">
|
|
|
|
|
<input type="hidden" name="entity_type" value="group">
|
|
|
|
|
<input type="hidden" name="entity_id" value="{{ group.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="entity_name" value="{{ group.name }}">
|
|
|
|
|
<input type="hidden" name="filter_mode" value="include">
|
|
|
|
|
<input type="hidden" name="parent_entity_id" value="{{ store.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="redirect_to" value="/catalog/groups?store_id={{ store.evotor_id }}">
|
|
|
|
|
<button type="submit" class="dropdown-item">✓ Включить в синхронизацию</button>
|
|
|
|
|
</form>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<form method="post" action="/catalog/filter">
|
|
|
|
|
<input type="hidden" name="entity_type" value="group">
|
|
|
|
|
<input type="hidden" name="entity_id" value="{{ group.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="entity_name" value="{{ group.name }}">
|
|
|
|
|
<input type="hidden" name="filter_mode" value="exclude">
|
|
|
|
|
<input type="hidden" name="parent_entity_id" value="{{ store.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="redirect_to" value="/catalog/groups?store_id={{ store.evotor_id }}">
|
|
|
|
|
<button type="submit" class="dropdown-item">✗ Исключить из синхронизации</button>
|
|
|
|
|
</form>
|
|
|
|
|
</li>
|
|
|
|
|
<li><hr class="dropdown-divider"></li>
|
|
|
|
|
<li>
|
|
|
|
|
<form method="post" action="/catalog/filter">
|
|
|
|
|
<input type="hidden" name="entity_type" value="group">
|
|
|
|
|
<input type="hidden" name="entity_id" value="{{ group.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="entity_name" value="{{ group.name }}">
|
|
|
|
|
<input type="hidden" name="filter_mode" value="none">
|
|
|
|
|
<input type="hidden" name="parent_entity_id" value="{{ store.evotor_id }}">
|
|
|
|
|
<input type="hidden" name="redirect_to" value="/catalog/groups?store_id={{ store.evotor_id }}">
|
|
|
|
|
<button type="submit" class="dropdown-item text-muted">— Убрать правило</button>
|
|
|
|
|
</form>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endblock %}
|