Store picker in topbar, redesign cabinet, rename to WBfeed.ru

- index.html: store dropdown in topbar (switch without leaving page)
- cabinet.html: store-cards with Активировать/Проверить, edit hidden in <details>
- Removed 'Используется' button, active shown as green card + label
- next=index param to return to main page after store switch
- Brand name changed to WBfeed.ru across all templates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 21:30:03 +03:00
parent 17f898f73f
commit de278227ac
5 changed files with 221 additions and 36 deletions
+30 -3
View File
@@ -12,7 +12,7 @@
<div class="topbar__inner">
<a href="{{ url_for('index') }}" class="topbar__brand">
<img src="{{ url_for('static', filename='wb3.png') }}" class="topbar__logo-img" alt="WB">
<span class="topbar__name">Feedback</span>
<span class="topbar__name">WBfeed.ru</span>
</a>
<div class="topbar__nav">
<a href="{{ url_for('index') }}" class="topbar__link active">Отзывы</a>
@@ -23,8 +23,29 @@
</div>
<div class="topbar__user">
<span class="topbar__username">{{ current_user["username"] }}</span>
{% if active_token_name %}
<span class="badge">{{ active_token_name }}</span>
{% if tokens %}
<div class="store-picker">
<button type="button" class="store-picker__btn" onclick="this.closest('.store-picker').classList.toggle('open')">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
{{ active_token_name or 'Магазин не выбран' }}
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="6 9 12 15 18 9"/></svg>
</button>
<div class="store-picker__dropdown">
{% for t in tokens %}
<form method="post" action="{{ url_for('cabinet') }}">
<input type="hidden" name="cabinet_action" value="select">
<input type="hidden" name="token_id" value="{{ t.id }}">
<input type="hidden" name="next" value="index">
<button type="submit" class="store-picker__item {% if t.id == active_token_id %}store-picker__item--active{% endif %}">
{{ t.name }}
{% if t.id == active_token_id %}<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>{% endif %}
</button>
</form>
{% endfor %}
<div class="store-picker__sep"></div>
<a href="{{ url_for('cabinet') }}" class="store-picker__item">Управление магазинами →</a>
</div>
</div>
{% endif %}
<a href="{{ url_for('logout') }}" class="btn-ghost">Выйти</a>
</div>
@@ -399,6 +420,12 @@ initPools();
poll();
setInterval(poll, 10000);
})();
// ── Store picker close on outside click ───────────────────
document.addEventListener('click', e => {
if (!e.target.closest('.store-picker')) {
document.querySelectorAll('.store-picker.open').forEach(el => el.classList.remove('open'));
}
});
</script>
</body>
</html>