feat(shop): компактный UX вкладки Магазин — статы-строка, фильтр, поиск

- 4 крупные карточки статистики → компактная строка stat-пиллов
- тулбар: фильтр по типу + поиск по названию + счётчик (N из M)
- таблица: иконка-чип по типу + название с описанием в одной ячейке,
  цветные бейджи типов, колонка ID убрана (id ушёл в подпись)
- состояния «Нет товаров» / «Ничего не найдено»

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-06-03 14:14:55 +03:00
parent b0e385b2c6
commit 1b78f675f8
2 changed files with 91 additions and 32 deletions
+43 -5
View File
@@ -1318,23 +1318,61 @@
</div>
<div class="perm-grid" id="perm-student"></div>
</div>
<div class="perm-role-block">
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px">
<span style="font-weight:600">История изменений прав ролей</span>
<button onclick="loadPermLog()" style="padding:7px 14px;border:1.5px solid var(--border);border-radius:9px;background:transparent;color:var(--text-3);cursor:pointer;font-family:inherit;font-size:0.85rem">Показать</button>
</div>
<div id="perm-log"></div>
</div>
</div>
<!-- ── Магазин ── -->
<div class="tab-pane" id="tab-shop">
<style>
.shop-stats { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:22px; }
.shop-stat { display:flex; align-items:center; gap:11px; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:12px 16px; flex:1 1 0; min-width:165px; }
.shop-stat-ic { width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.shop-stat-ic svg { width:18px; height:18px; }
.shop-stat-txt { display:flex; flex-direction:column; line-height:1.18; min-width:0; }
.shop-stat-v { font-family:'Unbounded',sans-serif; font-size:1.2rem; font-weight:800; }
.shop-stat-v.sm { font-size:0.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shop-stat-l { font-size:0.73rem; color:var(--text-3); font-weight:600; }
.shop-cell { display:flex; align-items:center; gap:11px; }
.shop-ic { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.shop-ic svg { width:17px; height:17px; }
.shop-cell-txt { display:flex; flex-direction:column; line-height:1.25; min-width:0; }
.shop-cell-sub { font-size:0.76rem; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:300px; }
.shop-type-badge { display:inline-block; padding:3px 11px; border-radius:var(--r-pill); font-size:0.76rem; font-weight:700; white-space:nowrap; }
.shop-price { white-space:nowrap; font-weight:600; }
.shop-ic.t-frame, .shop-type-badge.t-frame { background:rgba(155,93,229,.12); color:var(--violet); }
.shop-ic.t-title, .shop-type-badge.t-title { background:rgba(255,179,71,.16); color:#d98a17; }
.shop-ic.t-background, .shop-type-badge.t-background { background:rgba(6,214,224,.12); color:#0891a3; }
.shop-ic.t-effect, .shop-type-badge.t-effect { background:rgba(6,214,160,.13); color:#089f7a; }
.shop-ic.t-other, .shop-type-badge.t-other { background:rgba(120,130,150,.14); color:var(--text-3); }
</style>
<div class="section-title">Магазин</div>
<div class="stats-grid" id="shop-stats-grid"><div class="spinner"></div></div>
<div class="shop-stats" id="shop-stats-grid"><div class="spinner"></div></div>
<div class="section-title" style="margin-top:32px">Товары</div>
<div style="margin-bottom:14px">
<div class="t-toolbar">
<select class="t-select" id="shop-filter-type" onchange="shopApplyFilters()">
<option value="">Все типы</option>
<option value="frame">Рамки</option>
<option value="title">Титулы</option>
<option value="background">Фоны</option>
<option value="effect">Эффекты</option>
</select>
<input class="t-input" id="shop-search" type="text" placeholder="Поиск по названию…" oninput="shopApplyFilters()" />
<span class="t-count" id="shop-count"></span>
<button class="btn-add" onclick="shopAdminCreateItem()">+ Добавить товар</button>
</div>
<div class="table-wrap">
<table>
<thead><tr>
<th>ID</th><th>Название</th><th>Тип</th><th>Цена</th><th>Продано</th><th>Активен</th><th>Действия</th>
<th>Товар</th><th>Тип</th><th>Цена</th><th>Продано</th><th>Активен</th><th>Действия</th>
</tr></thead>
<tbody id="shop-items-body"><tr><td colspan="7"><div class="spinner"></div></td></tr></tbody>
<tbody id="shop-items-body"><tr><td colspan="6"><div class="spinner"></div></td></tr></tbody>
</table>
</div>
</div>