feat(integrations): добавлен фундамент для интеграций с внешними сервисами
- Создано приложение integrations с базовой архитектурой - BaseIntegration (абстрактная модель) для всех интеграций - BaseIntegrationService (абстрактный сервисный класс) - IntegrationConfig модель для тумблеров в system_settings - Добавлена вкладка "Интеграции" в системные настройки - Заготовка UI с тумблерами для включения интеграций Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,12 @@
|
||||
<i class="bi bi-tag"></i> Скидки
|
||||
</a>
|
||||
</li>
|
||||
<!-- Здесь в будущем добавятся: Категории, Статусы заказов, Часовой пояс, Интеграции и т.д. -->
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {% if 'integrations' in request.resolver_match.namespaces %}active{% endif %}"
|
||||
href="{% url 'system_settings:integrations:list' %}">
|
||||
Интеграции
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Контент конкретной страницы настроек -->
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
{% extends "system_settings/base_settings.html" %}
|
||||
|
||||
{% block title %}Интеграции{% endblock %}
|
||||
|
||||
{% block settings_content %}
|
||||
<div class="row">
|
||||
<!-- Левая колонка: список интеграций с тумблерами -->
|
||||
<div class="col-md-5">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Доступные интеграции</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for value, label in integration_choices %}
|
||||
<div class="d-flex align-items-center justify-content-between py-2 border-bottom">
|
||||
<div>
|
||||
<span class="fw-medium">{{ label }}</span>
|
||||
<small class="text-muted d-block">Маркетплейс</small>
|
||||
</div>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input integration-toggle"
|
||||
type="checkbox"
|
||||
data-integration="{{ value }}"
|
||||
id="integration-{{ value }}">
|
||||
<label class="form-check-label" for="integration-{{ value }}"></label>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Правая колонка: placeholder для настроек -->
|
||||
<div class="col-md-7">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Настройки интеграции</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-center text-muted py-5">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="currentColor" class="bi bi-plug mb-3" viewBox="0 0 16 16">
|
||||
<path d="M6 0a.5.5 0 0 1 .5.5V3h3V.5a.5.5 0 0 1 1 0V3h1v2.5a1.5 1.5 0 0 1-1 1.25v4.5a.5.5 0 0 1-1 0v-4.25c-.286.14-.6.25-1 .25a2.5 2.5 0 0 1-1-.25v4.25a.5.5 0 0 1-1 0v-4.5a1.5 1.5 0 0 1-1-1.25V3h1V.5A.5.5 0 0 1 6 0Zm0 3a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 6 3Zm3.5-.5a.5.5 0 0 1 1 0v2a.5.5 0 0 1-1 0v-2Z"/>
|
||||
</svg>
|
||||
<p class="mb-0">Выберите интеграцию слева для настройки</p>
|
||||
<small class="text-muted">Здесь появится форма с настройками выбранной интеграции</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript для переключения интеграций (placeholder) -->
|
||||
<script>
|
||||
document.querySelectorAll('.integration-toggle').forEach(toggle => {
|
||||
toggle.addEventListener('change', function() {
|
||||
const integration = this.dataset.integration;
|
||||
const isEnabled = this.checked;
|
||||
|
||||
// TODO: отправить состояние на сервер
|
||||
console.log(`Интеграция ${integration}: ${isEnabled ? 'включена' : 'выключена'}`);
|
||||
|
||||
// TODO: показать/скрыть блок настроек справа
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user