feat: /sync settings page with price multiplier and description postfix

Adds price_multiplier and description_postfix to SyncConfig. The sync
page at /sync lets users configure them. vk_sync reads these per-user
settings and applies the multiplier to price and appends the postfix
as "(postfix)" to the VK product description.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-05-12 23:04:23 +03:00
parent fb3b6e2327
commit e169a91146
6 changed files with 142 additions and 6 deletions

35
web/templates/sync.html Normal file
View File

@@ -0,0 +1,35 @@
{% 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-arrow-repeat me-2"></i>Синхронизация</h1>
</div>
{% if saved %}
<div role="alert" class="alert alert-success"><p>Настройки сохранены.</p></div>
{% endif %}
<article class="card">
<h2 style="font-size:1.1rem; margin-bottom:1.25rem;">Настройки цены и описания</h2>
<form method="post" action="/sync/settings">
<div class="grid" style="grid-template-columns: 1fr 1fr; gap:1.5rem;">
<label>
Множитель цены
<input type="number" name="price_multiplier" step="0.0001" min="0.0001"
value="{{ config.price_multiplier if config else '1' }}"
placeholder="1">
<small class="text-muted">Цена из Эвотор умножается на это значение перед отправкой в ВК. По умолчанию: 1.</small>
</label>
<label>
Постфикс описания
<input type="text" name="description_postfix"
value="{{ config.description_postfix if config and config.description_postfix else '' }}"
placeholder="цена за 10г.">
<small class="text-muted">Если заполнено, добавляется к описанию: «Название (постфикс)». Оставьте пустым, чтобы не добавлять.</small>
</label>
</div>
<button type="submit" style="margin-top:1rem;">Сохранить</button>
</form>
</article>
{% endblock %}