67 lines
3.1 KiB
HTML
67 lines
3.1 KiB
HTML
|
|
{% extends "base.html" %}
|
|||
|
|
{% block title %}Магазины — ЭВОСИНК{% endblock %}
|
|||
|
|
|
|||
|
|
{% block content %}
|
|||
|
|
<div class="d-flex justify-between align-center mb-3">
|
|||
|
|
<h1 style="font-size:1.3rem; margin:0;"><i class="bi bi-shop me-2"></i>Магазины Эвотор</h1>
|
|||
|
|
<span class="text-muted small">Всего: {{ stores | length }}</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<article class="card">
|
|||
|
|
{% if stores %}
|
|||
|
|
<div class="table-scroll">
|
|||
|
|
<table class="align-middle">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>Синхронизация</th>
|
|||
|
|
<th>Название</th>
|
|||
|
|
<th>Адрес</th>
|
|||
|
|
<th>ID</th>
|
|||
|
|
<th>Обновлено</th>
|
|||
|
|
<th></th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
{% for s in stores %}
|
|||
|
|
{% set is_enabled = (enabled_ids is none) or (s.evotor_id in enabled_ids) %}
|
|||
|
|
<tr class="{% if not is_enabled %}text-muted{% endif %}">
|
|||
|
|
<td>
|
|||
|
|
<form method="post" action="/catalog/stores/{{ s.evotor_id }}/toggle" style="margin:0;">
|
|||
|
|
<button type="submit"
|
|||
|
|
class="outline sm {% if is_enabled %}success{% else %}secondary{% endif %}"
|
|||
|
|
title="{% if is_enabled %}Отключить синхронизацию{% else %}Включить синхронизацию{% endif %}"
|
|||
|
|
style="padding:0.2rem 0.6rem;">
|
|||
|
|
{% if is_enabled %}
|
|||
|
|
<i class="bi bi-toggle-on"></i>
|
|||
|
|
{% else %}
|
|||
|
|
<i class="bi bi-toggle-off"></i>
|
|||
|
|
{% endif %}
|
|||
|
|
</button>
|
|||
|
|
</form>
|
|||
|
|
</td>
|
|||
|
|
<td><strong>{{ s.name }}</strong></td>
|
|||
|
|
<td class="text-muted">{{ s.address or '—' }}</td>
|
|||
|
|
<td class="text-muted small">{{ s.evotor_id }}</td>
|
|||
|
|
<td class="text-muted small">{{ s.fetched_at | datefmt }}</td>
|
|||
|
|
<td>
|
|||
|
|
<a href="/catalog/stores/{{ s.evotor_id }}/products" role="button" class="outline sm" title="Товары">
|
|||
|
|
<i class="bi bi-box-seam"></i> Товары
|
|||
|
|
</a>
|
|||
|
|
<a href="/catalog/stores/{{ s.evotor_id }}/groups" role="button" class="outline secondary sm" title="Группы">
|
|||
|
|
<i class="bi bi-folder"></i> Группы
|
|||
|
|
</a>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
{% endfor %}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
{% else %}
|
|||
|
|
<div class="text-center py-5 text-muted">
|
|||
|
|
<i class="bi bi-shop" style="font-size:2rem;"></i>
|
|||
|
|
<p class="mt-2">Магазины ещё не загружены.<br>Синхронизация выполняется каждые {{ refresh_interval }} сек. автоматически.</p>
|
|||
|
|
</div>
|
|||
|
|
{% endif %}
|
|||
|
|
</article>
|
|||
|
|
{% endblock %}
|