moc moc mocinky zmen jako macinka
This commit is contained in:
@@ -127,7 +127,7 @@
|
|||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
Logger.LogInformation("User logged in.");
|
Logger.LogInformation("User logged in.");
|
||||||
RedirectManager.RedirectTo(ReturnUrl);
|
RedirectManager.RedirectTo(string.IsNullOrWhiteSpace(ReturnUrl) ? "admin" : ReturnUrl);
|
||||||
}
|
}
|
||||||
else if (result.RequiresTwoFactor)
|
else if (result.RequiresTwoFactor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
@inject NavigationManager Nav
|
@inject NavigationManager Nav
|
||||||
|
|
||||||
<nav class="admin-nav">
|
<nav class="admin-nav">
|
||||||
|
<a href="/" class="admin-nav-link">
|
||||||
|
<span class="admin-nav-ico" aria-hidden="true">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M15 18 9 12l6-6" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span class="admin-nav-label">E-shop</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
<a href="/admin" class="admin-nav-link @(IsCurrent("/admin", true) ? "active" : null)">
|
<a href="/admin" class="admin-nav-link @(IsCurrent("/admin", true) ? "active" : null)">
|
||||||
<span class="admin-nav-ico" aria-hidden="true">
|
<span class="admin-nav-ico" aria-hidden="true">
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
|||||||
@@ -13,41 +13,41 @@
|
|||||||
|
|
||||||
<PageTitle>@(IsNew ? "Nová kategorie" : "Upravit kategorii")</PageTitle>
|
<PageTitle>@(IsNew ? "Nová kategorie" : "Upravit kategorii")</PageTitle>
|
||||||
|
|
||||||
<div class="ap">
|
<div class="ap ao">
|
||||||
<header class="ap-hero ap-hero-left">
|
<header class="ao-hero">
|
||||||
<p class="ap-eyebrow">Kategorie</p>
|
<p class="ao-eyebrow">Kategorie</p>
|
||||||
<h1>@(IsNew ? "Nová kategorie" : "Upravit kategorii")</h1>
|
<h1>@(IsNew ? "Nová kategorie" : "Upravit kategorii")</h1>
|
||||||
<p class="ap-sub">Název a stav kategorie v katalogu.</p>
|
<p class="ao-sub">Název a stav kategorie.</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(error))
|
@if (!string.IsNullOrEmpty(error))
|
||||||
{
|
{
|
||||||
<div class="ap-alert">@error</div>
|
<div class="ao-alert">@error</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (notFound)
|
@if (notFound)
|
||||||
{
|
{
|
||||||
<section class="ap-panel">
|
<div class="ao-empty">Kategorie nebyla nalezena.</div>
|
||||||
<p class="ap-empty">Kategorie nebyla nalezena.</p>
|
<div style="text-align:center;margin-top:12px">
|
||||||
<a class="ap-btn" href="/admin/kategorie">Zpět na seznam</a>
|
<a class="ap-btn" href="/admin/kategorie">Zpět</a>
|
||||||
</section>
|
</div>
|
||||||
}
|
}
|
||||||
else if (loading)
|
else if (loading)
|
||||||
{
|
{
|
||||||
<div class="ap-loading">Načítám…</div>
|
<div class="ao-loading">Načítám…</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<section class="ap-panel ap-form-panel">
|
<section class="ao-panel" style="max-width:560px;margin:0 auto">
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Název</label>
|
<label>Název</label>
|
||||||
<input class="ap-input" @bind="name" />
|
<input class="ao-input" @bind="name" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Slug</label>
|
<label>Slug</label>
|
||||||
<input class="ap-input" @bind="categorySlug" />
|
<input class="ao-input" @bind="categorySlug" />
|
||||||
<small class="ap-help">URL identifikátor, např. domaci-vyrobky</small>
|
<small class="ap-help">Když necháš prázdné, vytvoří se z názvu.</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="ap-switch">
|
<label class="ap-switch">
|
||||||
|
|||||||
@@ -9,80 +9,68 @@
|
|||||||
|
|
||||||
@attribute [Authorize(Roles = "Admin")]
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<AuthorizeView>
|
<PageTitle>Kategorie</PageTitle>
|
||||||
<PageTitle>Kategorie</PageTitle>
|
|
||||||
|
|
||||||
<div class="ap">
|
<div class="ap ao">
|
||||||
<header class="ap-hero ap-hero-left">
|
<header class="ao-hero">
|
||||||
<p class="ap-eyebrow">Administrace</p>
|
<p class="ao-eyebrow">Administrace</p>
|
||||||
<div class="ap-hero-row">
|
<h1>Kategorie</h1>
|
||||||
|
<p class="ao-sub">Správa kategorií sortimentu.</p>
|
||||||
|
<div style="margin-top:16px">
|
||||||
|
<a class="ap-btn ap-btn-primary" href="/admin/kategorie/edit">Nová kategorie</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
@if (!string.IsNullOrEmpty(error))
|
||||||
|
{
|
||||||
|
<div class="ao-alert">@error</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (items is null)
|
||||||
|
{
|
||||||
|
<div class="ao-loading">Načítám kategorie…</div>
|
||||||
|
}
|
||||||
|
else if (items.Count == 0)
|
||||||
|
{
|
||||||
|
<div class="ao-empty">Zatím žádné kategorie.</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<section class="ao-panel">
|
||||||
|
<div class="ao-panel-head">
|
||||||
<div>
|
<div>
|
||||||
<h1>Kategorie</h1>
|
|
||||||
<p class="ap-sub">Správa kategorií sortimentu.</p>
|
|
||||||
</div>
|
|
||||||
<a class="ap-btn ap-btn-primary" href="/admin/kategorie/edit">Nová kategorie</a>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(error))
|
|
||||||
{
|
|
||||||
<div class="ap-alert">@error</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (items is null)
|
|
||||||
{
|
|
||||||
<div class="ap-loading">Načítám kategorie…</div>
|
|
||||||
}
|
|
||||||
else if (items.Count == 0)
|
|
||||||
{
|
|
||||||
<section class="ap-panel">
|
|
||||||
<p class="ap-empty">Zatím nemáte žádné kategorie.</p>
|
|
||||||
<a class="ap-btn ap-btn-primary" href="/admin/kategorie/edit">Vytvořit první kategorii</a>
|
|
||||||
</section>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<section class="ap-panel ap-panel-table">
|
|
||||||
<div class="ap-panel-head">
|
|
||||||
<h2>Seznam kategorií</h2>
|
<h2>Seznam kategorií</h2>
|
||||||
<span class="ap-muted">@items.Count položek</span>
|
<p>@items.Count položek</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="ap-table-wrap">
|
<div class="ao-list">
|
||||||
<table class="ap-table">
|
@foreach (var c in items)
|
||||||
<thead>
|
{
|
||||||
<tr>
|
<article class="ao-card" @key="c.Id">
|
||||||
<th>Název</th>
|
<div class="ao-card-main" style="cursor:default">
|
||||||
<th>Slug</th>
|
<div class="ao-card-left">
|
||||||
<th>Produkty</th>
|
<span class="ao-code">@c.Name</span>
|
||||||
<th>Stav</th>
|
<span class="ao-date">@c.Slug</span>
|
||||||
<th></th>
|
</div>
|
||||||
</tr>
|
<div class="ao-card-mid">
|
||||||
</thead>
|
<span class="ao-pay">@c.ProductCount produktů</span>
|
||||||
<tbody>
|
</div>
|
||||||
@foreach (var c in items)
|
<div class="ao-card-right">
|
||||||
{
|
<span class="ao-badge @(c.IsActive ? "is-paid" : "is-cancel")">
|
||||||
<tr>
|
@(c.IsActive ? "Aktivní" : "Neaktivní")
|
||||||
<td class="ap-name">@c.Name</td>
|
</span>
|
||||||
<td class="ap-muted">@c.CategorySlug</td>
|
</div>
|
||||||
<td>@c.ProductCount</td>
|
</div>
|
||||||
<td>
|
<div class="sklad-row">
|
||||||
<span class="ap-status @(c.IsActive ? "is-on" : "is-off")">
|
<a class="ap-btn ap-btn-ghost" href="@($"/admin/kategorie/edit/{c.Id}")">Upravit</a>
|
||||||
@(c.IsActive ? "Aktivní" : "Neaktivní")
|
</div>
|
||||||
</span>
|
</article>
|
||||||
</td>
|
}
|
||||||
<td class="ap-actions-cell">
|
</div>
|
||||||
<a class="ap-btn ap-btn-ghost" href="@($"/admin/kategorie/edit/{c.Id}")">Upravit</a>
|
</section>
|
||||||
</td>
|
}
|
||||||
</tr>
|
</div>
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</AuthorizeView>
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Row>? items;
|
private List<Row>? items;
|
||||||
@@ -113,7 +101,7 @@
|
|||||||
private sealed record Row(
|
private sealed record Row(
|
||||||
int Id,
|
int Id,
|
||||||
string Name,
|
string Name,
|
||||||
string CategorySlug,
|
string Slug,
|
||||||
bool IsActive,
|
bool IsActive,
|
||||||
int ProductCount);
|
int ProductCount);
|
||||||
}
|
}
|
||||||
@@ -1,71 +1,71 @@
|
|||||||
@page "/admin/objednavky"
|
@page "/admin/objednavky"
|
||||||
|
@layout Web_Jarmark.Components.Layout.Admin.AdminLayout
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using Microsoft.AspNetCore.Authorization
|
||||||
@using Web_Jarmark.Data
|
@using Web_Jarmark.Data
|
||||||
@using Web_Jarmark.Data.Models
|
@using Web_Jarmark.Data.Models
|
||||||
@inject ApplicationDbContext DbContext
|
@inject ApplicationDbContext Db
|
||||||
|
|
||||||
<PageTitle>Objednávky | Web-Jarmark</PageTitle>
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<main class="orders-page">
|
<PageTitle>Objednávky</PageTitle>
|
||||||
<header class="orders-header">
|
|
||||||
<div>
|
|
||||||
<span class="orders-eyebrow">WEB-JARMARK / TESTOVACÍ REŽIM</span>
|
|
||||||
<h1>Objednávky</h1>
|
|
||||||
<p>Přehled všech objednávek a jejich aktuálního stavu.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a href="/admin" class="back-link">← Administrace</a>
|
<div class="ap ao">
|
||||||
|
<header class="ao-hero">
|
||||||
|
<p class="ao-eyebrow">Administrace</p>
|
||||||
|
<h1>Objednávky</h1>
|
||||||
|
<p class="ao-sub">Přehled všech objednávek a jejich aktuálního stavu.</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@if (isLoading)
|
@if (isLoading)
|
||||||
{
|
{
|
||||||
<div class="orders-message">Načítám objednávky...</div>
|
<div class="ao-loading">Načítám objednávky…</div>
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrEmpty(errorMessage))
|
else if (!string.IsNullOrEmpty(errorMessage))
|
||||||
{
|
{
|
||||||
<div class="orders-message error">@errorMessage</div>
|
<div class="ao-alert">@errorMessage</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<section class="orders-stats">
|
<section class="ao-stats">
|
||||||
<article class="stat-card">
|
<article class="ao-stat" style="--i:0">
|
||||||
<span>Celkem objednávek</span>
|
<span>Celkem</span>
|
||||||
<strong>@orders.Count</strong>
|
<strong>@orders.Count</strong>
|
||||||
|
<small>objednávek</small>
|
||||||
</article>
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:1">
|
||||||
<article class="stat-card">
|
|
||||||
<span>Čeká na zaplacení</span>
|
<span>Čeká na zaplacení</span>
|
||||||
<strong>@orders.Count(o => o.Status == OrderStatus.Pending)</strong>
|
<strong>@orders.Count(o => o.Status == OrderStatus.Pending)</strong>
|
||||||
|
<small>k vyřízení</small>
|
||||||
</article>
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:2">
|
||||||
<article class="stat-card">
|
|
||||||
<span>Zaplaceno</span>
|
<span>Zaplaceno</span>
|
||||||
<strong>@orders.Count(o => o.Status == OrderStatus.Paid)</strong>
|
<strong>@orders.Count(o => o.Status == OrderStatus.Paid)</strong>
|
||||||
|
<small>uhrazeno</small>
|
||||||
</article>
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:3">
|
||||||
<article class="stat-card">
|
<span>Hodnota</span>
|
||||||
<span>Celková hodnota</span>
|
<strong>@orders.Sum(o => o.TotalAmount).ToString("N0")</strong>
|
||||||
<strong>@orders.Sum(o => o.TotalAmount).ToString("N0") Kč</strong>
|
<small>Kč celkem</small>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="orders-panel">
|
<section class="ao-panel" style="--i:4">
|
||||||
<div class="orders-panel-header">
|
<div class="ao-panel-head">
|
||||||
<div>
|
<div>
|
||||||
<h2>Seznam objednávek</h2>
|
<h2>Seznam objednávek</h2>
|
||||||
<p>Celkem nalezeno: @FilteredOrders.Count</p>
|
<p>@FilteredOrders.Count zobrazených</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="orders-filters">
|
<div class="ao-filters">
|
||||||
<input type="text"
|
<input class="ao-input"
|
||||||
placeholder="Hledat podle čísla objednávky..."
|
placeholder="Hledat podle kódu…"
|
||||||
@bind="searchText"
|
@bind="searchText"
|
||||||
@bind:event="oninput" />
|
@bind:event="oninput" />
|
||||||
|
|
||||||
<select @bind="statusFilter">
|
<select class="ao-select" @bind="statusFilter">
|
||||||
<option value="Vše">Všechny stavy</option>
|
<option value="Vše">Všechny stavy</option>
|
||||||
<option value="Čeká na zaplacení">Čeká na zaplacení</option>
|
<option value="Čeká na zaplacení">Čeká na zaplacení</option>
|
||||||
<option value="Zaplaceno">Zaplaceno</option>
|
<option value="Zaplaceno">Zaplaceno</option>
|
||||||
@@ -77,443 +77,92 @@
|
|||||||
|
|
||||||
@if (FilteredOrders.Count == 0)
|
@if (FilteredOrders.Count == 0)
|
||||||
{
|
{
|
||||||
<div class="orders-empty">
|
<div class="ao-empty">Žádné objednávky k zobrazení.</div>
|
||||||
<h3>Žádné objednávky</h3>
|
|
||||||
<p>Zatím zde nejsou žádné objednávky odpovídající filtru.</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="orders-table-wrap">
|
<div class="ao-list">
|
||||||
<table class="orders-table">
|
@foreach (var order in FilteredOrders)
|
||||||
<thead>
|
{
|
||||||
<tr>
|
var open = selectedOrderId == order.Id;
|
||||||
<th>Objednávka</th>
|
|
||||||
<th>Datum</th>
|
|
||||||
<th>Platba</th>
|
|
||||||
<th>Produkty</th>
|
|
||||||
<th>Celkem</th>
|
|
||||||
<th>Stav</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<article class="ao-card @(open ? "is-open" : null)" @key="order.Id">
|
||||||
@foreach (var order in FilteredOrders)
|
<button type="button" class="ao-card-main" @onclick="() => ToggleDetail(order.Id)">
|
||||||
|
<div class="ao-card-left">
|
||||||
|
<span class="ao-code">#@order.Code</span>
|
||||||
|
<span class="ao-date">@order.CreatedAt.ToLocalTime().ToString("d. M. yyyy HH:mm")</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-mid">
|
||||||
|
<span class="ao-pay">@GetPaymentText(order.PreferredPayment)</span>
|
||||||
|
<span class="ao-qty">@order.OrderItems.Sum(i => i.Quantity) ks</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-right">
|
||||||
|
<span class="ao-price">@order.TotalAmount.ToString("N0") Kč</span>
|
||||||
|
<span class="ao-badge @GetBadgeClass(order.Status)">@GetStatusText(order.Status)</span>
|
||||||
|
</div>
|
||||||
|
<span class="ao-chevron @(open ? "is-open" : null)">›</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
@if (open)
|
||||||
{
|
{
|
||||||
<tr @key="order.Id">
|
<div class="ao-detail">
|
||||||
<td class="order-code">#@order.Code</td>
|
<div class="ao-detail-grid">
|
||||||
|
<div>
|
||||||
|
<span>Zákazník</span>
|
||||||
|
<strong>@(string.IsNullOrWhiteSpace(order.CustomerName) ? "—" : order.CustomerName)</strong>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>E-mail</span>
|
||||||
|
<strong>@(string.IsNullOrWhiteSpace(order.Email) ? "—" : order.Email)</strong>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>Telefon</span>
|
||||||
|
<strong>@(string.IsNullOrWhiteSpace(order.Phone) ? "—" : order.Phone)</strong>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>Stav</span>
|
||||||
|
<strong>@GetStatusText(order.Status)</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<td>
|
@if (!string.IsNullOrWhiteSpace(order.Note))
|
||||||
@order.CreatedAt.ToLocalTime().ToString("d. M. yyyy HH:mm")
|
{
|
||||||
</td>
|
<p class="ao-note">@order.Note</p>
|
||||||
|
}
|
||||||
|
|
||||||
<td>@GetPaymentText(order.PreferredPayment)</td>
|
<div class="ao-items">
|
||||||
|
@foreach (var item in order.OrderItems)
|
||||||
<td>@order.OrderItems.Sum(i => i.Quantity) ks</td>
|
{
|
||||||
|
<div class="ao-item">
|
||||||
<td class="order-price">
|
<div>
|
||||||
@order.TotalAmount.ToString("N0") Kč
|
<strong>@item.ProductName</strong>
|
||||||
</td>
|
<span>@item.Quantity ks × @item.UnitPrice.ToString("N0") Kč</span>
|
||||||
|
|
||||||
<td>
|
|
||||||
<span class="status-badge @GetStatusClass(order.Status)">
|
|
||||||
@GetStatusText(order.Status)
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<button class="detail-button"
|
|
||||||
@onclick="() => ToggleDetail(order.Id)">
|
|
||||||
@(selectedOrderId == order.Id ? "Zavřít" : "Detail")
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
@if (selectedOrderId == order.Id)
|
|
||||||
{
|
|
||||||
<tr class="detail-row">
|
|
||||||
<td colspan="7">
|
|
||||||
<div class="order-detail">
|
|
||||||
<h3>Objednávka #@order.Code</h3>
|
|
||||||
|
|
||||||
<div class="detail-info">
|
|
||||||
<div>
|
|
||||||
<span>Datum vytvoření</span>
|
|
||||||
<strong>
|
|
||||||
@order.CreatedAt.ToLocalTime().ToString("d. M. yyyy HH:mm")
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<span>Způsob platby</span>
|
|
||||||
<strong>
|
|
||||||
@GetPaymentText(order.PreferredPayment)
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<span>Stav objednávky</span>
|
|
||||||
<strong>
|
|
||||||
@GetStatusText(order.Status)
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>Objednané produkty</h4>
|
|
||||||
|
|
||||||
<div class="detail-products">
|
|
||||||
@foreach (var item in order.OrderItems)
|
|
||||||
{
|
|
||||||
<div class="detail-product" @key="item.Id">
|
|
||||||
<div>
|
|
||||||
<strong>@item.ProductName</strong>
|
|
||||||
<span>
|
|
||||||
@item.Quantity ks ×
|
|
||||||
@item.UnitPrice.ToString("N0") Kč
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
@((item.Quantity * item.UnitPrice).ToString("N0")) Kč
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-total">
|
|
||||||
<span>Celková cena</span>
|
|
||||||
<strong>
|
|
||||||
@order.TotalAmount.ToString("N0") Kč
|
|
||||||
</strong>
|
|
||||||
</div>
|
</div>
|
||||||
|
<strong>@((item.Quantity * item.UnitPrice).ToString("N0")) Kč</strong>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
}
|
||||||
</tr>
|
</div>
|
||||||
}
|
|
||||||
|
<div class="ao-total">
|
||||||
|
<span>Celkem</span>
|
||||||
|
<strong>@order.TotalAmount.ToString("N0") Kč</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
</tbody>
|
</article>
|
||||||
</table>
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
</main>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
.orders-page {
|
|
||||||
max-width: 1400px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 45px 24px 70px;
|
|
||||||
color: var(--bs-body-color, #222);
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-eyebrow {
|
|
||||||
color: #2878ff;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 800;
|
|
||||||
letter-spacing: 1.5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-header h1 {
|
|
||||||
margin: 10px 0;
|
|
||||||
font-size: clamp(28px, 4vw, 40px);
|
|
||||||
font-weight: 850;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-header p,
|
|
||||||
.orders-panel-header p {
|
|
||||||
opacity: .65;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-link {
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 700;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-stats {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
gap: 16px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card,
|
|
||||||
.orders-panel {
|
|
||||||
background: var(--bs-body-bg, white);
|
|
||||||
border: 1px solid rgba(128,128,128,.2);
|
|
||||||
border-radius: 16px;
|
|
||||||
box-shadow: 0 5px 20px rgba(0,0,0,.035);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card {
|
|
||||||
padding: 22px;
|
|
||||||
display: grid;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card span {
|
|
||||||
font-size: 13px;
|
|
||||||
opacity: .65;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card strong {
|
|
||||||
font-size: 27px;
|
|
||||||
font-weight: 850;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-panel {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-panel-header {
|
|
||||||
padding: 23px 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-panel-header h2 {
|
|
||||||
margin: 0 0 6px;
|
|
||||||
font-size: 21px;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters {
|
|
||||||
display: flex;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 0 25px 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters input,
|
|
||||||
.orders-filters select {
|
|
||||||
min-height: 44px;
|
|
||||||
padding: 10px 13px;
|
|
||||||
border: 1px solid rgba(128,128,128,.3);
|
|
||||||
border-radius: 9px;
|
|
||||||
background: var(--bs-body-bg, white);
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters input {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters select {
|
|
||||||
min-width: 210px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-table-wrap {
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-table th {
|
|
||||||
padding: 15px 18px;
|
|
||||||
text-align: left;
|
|
||||||
font-size: 12px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: .5px;
|
|
||||||
opacity: .6;
|
|
||||||
background: rgba(128,128,128,.06);
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-table td {
|
|
||||||
padding: 17px 18px;
|
|
||||||
border-top: 1px solid rgba(128,128,128,.13);
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-code {
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-price {
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-badge {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 6px 10px;
|
|
||||||
border-radius: 20px;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 750;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-pending {
|
|
||||||
background: #fff3d6;
|
|
||||||
color: #996500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-paid {
|
|
||||||
background: #e3f8eb;
|
|
||||||
color: #167b40;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-shipped {
|
|
||||||
background: #e5efff;
|
|
||||||
color: #2863b5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-delivered {
|
|
||||||
background: #e3f8eb;
|
|
||||||
color: #167b40;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-cancelled {
|
|
||||||
background: #ffe8e8;
|
|
||||||
color: #b52d2d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-button {
|
|
||||||
padding: 8px 13px;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 8px;
|
|
||||||
background: #2878ff;
|
|
||||||
color: white;
|
|
||||||
font-weight: 700;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-row td {
|
|
||||||
padding: 0;
|
|
||||||
background: rgba(128,128,128,.045);
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-detail {
|
|
||||||
padding: 25px;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-detail h3 {
|
|
||||||
margin: 0 0 22px;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-info {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 20px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-info div {
|
|
||||||
display: grid;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-info span,
|
|
||||||
.detail-product span {
|
|
||||||
font-size: 13px;
|
|
||||||
opacity: .65;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-detail h4 {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-product,
|
|
||||||
.detail-total {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 15px;
|
|
||||||
padding: 14px 0;
|
|
||||||
border-top: 1px solid rgba(128,128,128,.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-product div {
|
|
||||||
display: grid;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-total {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-total strong {
|
|
||||||
font-size: 23px;
|
|
||||||
font-weight: 850;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-empty,
|
|
||||||
.orders-message {
|
|
||||||
padding: 45px 20px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-empty p {
|
|
||||||
opacity: .65;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
color: #c33;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@media (max-width: 850px) {
|
|
||||||
.orders-stats {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-header {
|
|
||||||
align-items: flex-start;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@media (max-width: 550px) {
|
|
||||||
.orders-page {
|
|
||||||
padding: 25px 12px 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters {
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 0 15px 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orders-filters select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-info {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card {
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card strong {
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Order> orders = new();
|
private List<Order> orders = new();
|
||||||
|
|
||||||
private bool isLoading = true;
|
private bool isLoading = true;
|
||||||
private string? errorMessage;
|
private string? errorMessage;
|
||||||
|
|
||||||
private string searchText = "";
|
private string searchText = "";
|
||||||
private string statusFilter = "Vše";
|
private string statusFilter = "Vše";
|
||||||
|
|
||||||
private int? selectedOrderId;
|
private int? selectedOrderId;
|
||||||
|
|
||||||
private List<Order> FilteredOrders =>
|
private List<Order> FilteredOrders =>
|
||||||
@@ -530,7 +179,7 @@
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
orders = await DbContext.Orders
|
orders = await Db.Orders
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(o => o.OrderItems)
|
.Include(o => o.OrderItems)
|
||||||
.OrderByDescending(o => o.CreatedAt)
|
.OrderByDescending(o => o.CreatedAt)
|
||||||
@@ -548,46 +197,35 @@
|
|||||||
|
|
||||||
private void ToggleDetail(int orderId)
|
private void ToggleDetail(int orderId)
|
||||||
{
|
{
|
||||||
selectedOrderId = selectedOrderId == orderId
|
selectedOrderId = selectedOrderId == orderId ? null : orderId;
|
||||||
? null
|
|
||||||
: orderId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetStatusText(OrderStatus status)
|
private static string GetStatusText(OrderStatus status) => status switch
|
||||||
{
|
{
|
||||||
return status switch
|
OrderStatus.Pending => "Čeká na zaplacení",
|
||||||
{
|
OrderStatus.Paid => "Zaplaceno",
|
||||||
OrderStatus.Pending => "Čeká na zaplacení",
|
OrderStatus.Shipped => "Odesláno",
|
||||||
OrderStatus.Paid => "Zaplaceno",
|
OrderStatus.Delivered => "Dokončeno",
|
||||||
OrderStatus.Shipped => "Odesláno",
|
OrderStatus.Cancelled => "Zrušeno",
|
||||||
OrderStatus.Delivered => "Dokončeno",
|
_ => "Neznámý stav"
|
||||||
OrderStatus.Cancelled => "Zrušeno",
|
};
|
||||||
_ => "Neznámý stav"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetStatusClass(OrderStatus status)
|
private static string GetBadgeClass(OrderStatus status) => status switch
|
||||||
{
|
{
|
||||||
return status switch
|
OrderStatus.Pending => "is-pending",
|
||||||
{
|
OrderStatus.Paid => "is-paid",
|
||||||
OrderStatus.Pending => "status-pending",
|
OrderStatus.Shipped => "is-shipped",
|
||||||
OrderStatus.Paid => "status-paid",
|
OrderStatus.Delivered => "is-done",
|
||||||
OrderStatus.Shipped => "status-shipped",
|
OrderStatus.Cancelled => "is-cancel",
|
||||||
OrderStatus.Delivered => "status-delivered",
|
_ => ""
|
||||||
OrderStatus.Cancelled => "status-cancelled",
|
};
|
||||||
_ => ""
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetPaymentText(PaymentMethod method)
|
private static string GetPaymentText(PaymentMethod method) => method switch
|
||||||
{
|
{
|
||||||
return method switch
|
PaymentMethod.BankTransfer => "Bankovní převod",
|
||||||
{
|
PaymentMethod.Cash => "Hotově",
|
||||||
PaymentMethod.BankTransfer => "Bankovní převod",
|
PaymentMethod.CreditCard => "Karta",
|
||||||
PaymentMethod.Cash => "Hotově",
|
PaymentMethod.PayPal => "PayPal",
|
||||||
PaymentMethod.CreditCard => "Platební karta",
|
_ => "—"
|
||||||
PaymentMethod.PayPal => "PayPal",
|
};
|
||||||
_ => "Neznámý způsob"
|
}
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,426 @@
|
|||||||
|
/* Apple-like objednávky */
|
||||||
|
|
||||||
|
.ao {
|
||||||
|
max-width: 980px;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #1d1d1f;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-hero {
|
||||||
|
text-align: center;
|
||||||
|
padding: 18px 8px 28px;
|
||||||
|
animation: ao-in 0.45s ease both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-eyebrow {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-hero h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-sub {
|
||||||
|
margin: 10px auto 0;
|
||||||
|
max-width: 420px;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-loading,
|
||||||
|
.ao-empty,
|
||||||
|
.ao-alert {
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
|
color: #6e6e73;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-alert {
|
||||||
|
color: #1d1d1f;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stats */
|
||||||
|
.ao-stats {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat {
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.04);
|
||||||
|
border-radius: 22px;
|
||||||
|
padding: 18px 16px;
|
||||||
|
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.04);
|
||||||
|
animation: ao-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||||||
|
animation-delay: calc(var(--i, 0) * 0.06s);
|
||||||
|
transition: transform 0.25s ease, box-shadow 0.25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat:hover {
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat span {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat strong {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 750;
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat small {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #86868b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Panel */
|
||||||
|
.ao-panel {
|
||||||
|
background: rgba(255, 255, 255, 0.92);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.045);
|
||||||
|
border-radius: 26px;
|
||||||
|
padding: 18px 18px 12px;
|
||||||
|
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.04);
|
||||||
|
animation: ao-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||||||
|
animation-delay: calc(var(--i, 0) * 0.06s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 4px 6px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head p {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-filters {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 0 6px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input,
|
||||||
|
.ao-select {
|
||||||
|
border: 1px solid #d2d2d7;
|
||||||
|
border-radius: 14px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
font-size: 14px;
|
||||||
|
background: #fff;
|
||||||
|
color: #1d1d1f;
|
||||||
|
outline: none;
|
||||||
|
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-select {
|
||||||
|
min-width: 190px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input:focus,
|
||||||
|
.ao-select:focus {
|
||||||
|
border-color: #1d1d1f;
|
||||||
|
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cards list */
|
||||||
|
.ao-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card {
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fafafa;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: background 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card:hover {
|
||||||
|
background: #f5f5f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card.is-open {
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-main {
|
||||||
|
width: 100%;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1.2fr 1fr 1fr auto;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px 16px;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-left,
|
||||||
|
.ao-card-mid,
|
||||||
|
.ao-card-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-right {
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-code {
|
||||||
|
font-weight: 750;
|
||||||
|
font-size: 15px;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-date,
|
||||||
|
.ao-pay,
|
||||||
|
.ao-qty {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-price {
|
||||||
|
font-weight: 750;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
background: #f0f0f2;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-pending {
|
||||||
|
background: #f0f0f2;
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-paid {
|
||||||
|
background: #1d1d1f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-shipped {
|
||||||
|
background: #3a3a3c;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-done {
|
||||||
|
background: #1d1d1f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-cancel {
|
||||||
|
background: #e8e8ed;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-chevron {
|
||||||
|
font-size: 22px;
|
||||||
|
color: #aeaeb2;
|
||||||
|
transform: rotate(0deg);
|
||||||
|
transition: transform 0.25s ease;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-chevron.is-open {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Detail */
|
||||||
|
.ao-detail {
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
animation: ao-detail 0.28s ease both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid span {
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #6e6e73;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid strong {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-note {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-items {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-item span {
|
||||||
|
display: block;
|
||||||
|
margin-top: 2px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-total {
|
||||||
|
margin-top: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 4px 4px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-total strong {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 750;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes ao-in {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(8px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes ao-rise {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(14px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes ao-detail {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-6px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.ao-stats {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-main {
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
grid-template-areas:
|
||||||
|
"left chev"
|
||||||
|
"mid chev"
|
||||||
|
"right chev";
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-left {
|
||||||
|
grid-area: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-mid {
|
||||||
|
grid-area: mid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-right {
|
||||||
|
grid-area: right;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-chevron {
|
||||||
|
grid-area: chev;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,40 +13,40 @@
|
|||||||
|
|
||||||
<PageTitle>@(IsNew ? "Nové zboží" : "Upravit zboží")</PageTitle>
|
<PageTitle>@(IsNew ? "Nové zboží" : "Upravit zboží")</PageTitle>
|
||||||
|
|
||||||
<div class="ap">
|
<div class="ap ao">
|
||||||
<header class="ap-hero ap-hero-left">
|
<header class="ao-hero">
|
||||||
<p class="ap-eyebrow">Zboží</p>
|
<p class="ao-eyebrow">Zboží</p>
|
||||||
<h1>@(IsNew ? "Nové zboží" : "Upravit zboží")</h1>
|
<h1>@(IsNew ? "Nové zboží" : "Upravit zboží")</h1>
|
||||||
<p class="ap-sub">Údaje produktu v katalogu.</p>
|
<p class="ao-sub">Údaje produktu v katalogu.</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(error))
|
@if (!string.IsNullOrEmpty(error))
|
||||||
{
|
{
|
||||||
<div class="ap-alert">@error</div>
|
<div class="ao-alert">@error</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (notFound)
|
@if (notFound)
|
||||||
{
|
{
|
||||||
<section class="ap-panel">
|
<div class="ao-empty">Produkt nebyl nalezen.</div>
|
||||||
<p class="ap-empty">Produkt nebyl nalezen.</p>
|
<div style="text-align:center;margin-top:12px">
|
||||||
<a class="ap-btn" href="/admin/zbozi">Zpět na seznam</a>
|
<a class="ap-btn" href="/admin/zbozi">Zpět</a>
|
||||||
</section>
|
</div>
|
||||||
}
|
}
|
||||||
else if (loading)
|
else if (loading)
|
||||||
{
|
{
|
||||||
<div class="ap-loading">Načítám…</div>
|
<div class="ao-loading">Načítám…</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<section class="ap-panel ap-form-panel">
|
<section class="ao-panel" style="max-width:560px;margin:0 auto">
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Název</label>
|
<label>Název</label>
|
||||||
<input class="ap-input" @bind="name" />
|
<input class="ao-input" @bind="name" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Kategorie</label>
|
<label>Kategorie</label>
|
||||||
<select class="ap-select" @bind="categoryId">
|
<select class="ao-select" style="width:100%" @bind="categoryId">
|
||||||
<option value="0">— vyberte —</option>
|
<option value="0">— vyberte —</option>
|
||||||
@foreach (var c in categories)
|
@foreach (var c in categories)
|
||||||
{
|
{
|
||||||
@@ -57,22 +57,22 @@
|
|||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Popis</label>
|
<label>Popis</label>
|
||||||
<textarea class="ap-textarea" @bind="description"></textarea>
|
<textarea class="ao-input" style="min-height:110px;resize:vertical" @bind="description"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Cena (Kč)</label>
|
<label>Cena (Kč)</label>
|
||||||
<input type="number" step="0.01" class="ap-input" @bind="price" />
|
<input type="number" step="0.01" class="ao-input" @bind="price" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>Sklad (ks)</label>
|
<label>Sklad (ks)</label>
|
||||||
<input type="number" class="ap-input" @bind="stockQuantity" />
|
<input type="number" class="ao-input" @bind="stockQuantity" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ap-field">
|
<div class="ap-field">
|
||||||
<label>URL obrázku</label>
|
<label>URL obrázku</label>
|
||||||
<input class="ap-input" @bind="imageUrl" />
|
<input class="ao-input" @bind="imageUrl" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="ap-switch">
|
<label class="ap-switch">
|
||||||
|
|||||||
@@ -9,89 +9,73 @@
|
|||||||
|
|
||||||
@attribute [Authorize(Roles = "Admin")]
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<AuthorizeView>
|
<PageTitle>Zboží</PageTitle>
|
||||||
<PageTitle>Zboží</PageTitle>
|
|
||||||
|
|
||||||
<div class="ap">
|
<div class="ap ao">
|
||||||
<header class="ap-hero ap-hero-left">
|
<header class="ao-hero">
|
||||||
<p class="ap-eyebrow">Administrace</p>
|
<p class="ao-eyebrow">Administrace</p>
|
||||||
<div class="ap-hero-row">
|
<h1>Zboží</h1>
|
||||||
<div>
|
<p class="ao-sub">Přehled a správa produktů.</p>
|
||||||
<h1>Zboží</h1>
|
<div style="margin-top:16px">
|
||||||
<p class="ap-sub">Přehled a správa produktů.</p>
|
<a class="ap-btn ap-btn-primary" href="/admin/zbozi/edit">Nové zboží</a>
|
||||||
</div>
|
|
||||||
<a class="ap-btn ap-btn-primary" href="/admin/zbozi/edit">Nové zboží</a>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="ap-toolbar">
|
|
||||||
<input class="ap-input"
|
|
||||||
placeholder="Hledat produkt…"
|
|
||||||
@bind="search"
|
|
||||||
@bind:event="oninput" />
|
|
||||||
</div>
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(error))
|
@if (!string.IsNullOrEmpty(error))
|
||||||
{
|
{
|
||||||
<div class="ap-alert">@error</div>
|
<div class="ao-alert">@error</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (items is null)
|
<div class="ao-filters">
|
||||||
{
|
<input class="ao-input" placeholder="Hledat produkt…" @bind="search" @bind:event="oninput" />
|
||||||
<div class="ap-loading">Načítám zboží…</div>
|
|
||||||
}
|
|
||||||
else if (Filtered.Count == 0)
|
|
||||||
{
|
|
||||||
<section class="ap-panel">
|
|
||||||
<p class="ap-empty">Žádné produkty k zobrazení.</p>
|
|
||||||
<a class="ap-btn ap-btn-primary" href="/admin/zbozi/edit">Přidat produkt</a>
|
|
||||||
</section>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<section class="ap-panel ap-panel-table">
|
|
||||||
<div class="ap-panel-head">
|
|
||||||
<h2>Katalog</h2>
|
|
||||||
<span class="ap-muted">@Filtered.Count položek</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ap-table-wrap">
|
|
||||||
<table class="ap-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Produkt</th>
|
|
||||||
<th>Kategorie</th>
|
|
||||||
<th>Cena</th>
|
|
||||||
<th>Sklad</th>
|
|
||||||
<th>Stav</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var p in Filtered)
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
<td class="ap-name">@p.Name</td>
|
|
||||||
<td>@p.CategoryName</td>
|
|
||||||
<td>@p.Price.ToString("N0") Kč</td>
|
|
||||||
<td>@p.StockQuantity</td>
|
|
||||||
<td>
|
|
||||||
<span class="ap-status @(p.IsVisible ? "is-on" : "is-off")">
|
|
||||||
@(p.IsVisible ? "Viditelné" : "Skryté")
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td class="ap-actions-cell">
|
|
||||||
<a class="ap-btn ap-btn-ghost" href="@($"/admin/zbozi/edit/{p.Id}")">Upravit</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</AuthorizeView>
|
|
||||||
|
@if (items is null)
|
||||||
|
{
|
||||||
|
<div class="ao-loading">Načítám zboží…</div>
|
||||||
|
}
|
||||||
|
else if (Filtered.Count == 0)
|
||||||
|
{
|
||||||
|
<div class="ao-empty">Žádné produkty.</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<section class="ao-panel">
|
||||||
|
<div class="ao-panel-head">
|
||||||
|
<div>
|
||||||
|
<h2>Katalog</h2>
|
||||||
|
<p>@Filtered.Count položek</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ao-list">
|
||||||
|
@foreach (var p in Filtered)
|
||||||
|
{
|
||||||
|
<article class="ao-card" @key="p.Id">
|
||||||
|
<div class="ao-card-main" style="cursor:default">
|
||||||
|
<div class="ao-card-left">
|
||||||
|
<span class="ao-code">@p.Name</span>
|
||||||
|
<span class="ao-date">@p.CategoryName</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-mid">
|
||||||
|
<span class="ao-pay">@p.Price.ToString("N0") Kč</span>
|
||||||
|
<span class="ao-qty">@p.StockQuantity ks</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-right">
|
||||||
|
<span class="ao-badge @(p.IsVisible ? "is-paid" : "is-cancel")">
|
||||||
|
@(p.IsVisible ? "Viditelné" : "Skryté")
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sklad-row">
|
||||||
|
<a class="ap-btn ap-btn-ghost" href="@($"/admin/zbozi/edit/{p.Id}")">Upravit</a>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Row>? items;
|
private List<Row>? items;
|
||||||
@@ -102,16 +86,8 @@
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (items is null)
|
if (items is null) return new();
|
||||||
{
|
if (string.IsNullOrWhiteSpace(search)) return items;
|
||||||
return new List<Row>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(search))
|
|
||||||
{
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
return items.Where(p =>
|
return items.Where(p =>
|
||||||
p.Name.Contains(search, StringComparison.OrdinalIgnoreCase) ||
|
p.Name.Contains(search, StringComparison.OrdinalIgnoreCase) ||
|
||||||
p.CategoryName.Contains(search, StringComparison.OrdinalIgnoreCase)).ToList();
|
p.CategoryName.Contains(search, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|||||||
419
Web-Jarmark/Web-Jarmark/Components/Pages/Admin/Sklad.razor
Normal file
419
Web-Jarmark/Web-Jarmark/Components/Pages/Admin/Sklad.razor
Normal file
@@ -0,0 +1,419 @@
|
|||||||
|
@page "/admin/sklad"
|
||||||
|
@layout Web_Jarmark.Components.Layout.Admin.AdminLayout
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
@using Web_Jarmark.Data
|
||||||
|
@using Web_Jarmark.Data.Models
|
||||||
|
@inject ApplicationDbContext Db
|
||||||
|
|
||||||
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
|
<PageTitle>Sklad</PageTitle>
|
||||||
|
|
||||||
|
<div class="ap ao">
|
||||||
|
<header class="ao-hero">
|
||||||
|
<p class="ao-eyebrow">Administrace</p>
|
||||||
|
<h1>Sklad</h1>
|
||||||
|
<p class="ao-sub">Sledování zásob, rychlé úpravy a upozornění na nízký stav.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
@if (!string.IsNullOrEmpty(message))
|
||||||
|
{
|
||||||
|
<div class="ao-alert">@message</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (loading)
|
||||||
|
{
|
||||||
|
<div class="ao-loading">Načítám sklad…</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<section class="ao-stats">
|
||||||
|
<article class="ao-stat" style="--i:0">
|
||||||
|
<span>Produktů</span>
|
||||||
|
<strong>@items.Count</strong>
|
||||||
|
<small>ve skladu</small>
|
||||||
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:1">
|
||||||
|
<span>Nízký sklad</span>
|
||||||
|
<strong>@items.Count(i => i.StockQuantity > 0 && i.StockQuantity <= LowThreshold)</strong>
|
||||||
|
<small>≤ @LowThreshold ks</small>
|
||||||
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:2">
|
||||||
|
<span>Vyprodané</span>
|
||||||
|
<strong>@items.Count(i => i.StockQuantity <= 0)</strong>
|
||||||
|
<small>0 ks</small>
|
||||||
|
</article>
|
||||||
|
<article class="ao-stat" style="--i:3">
|
||||||
|
<span>Hodnota skladu</span>
|
||||||
|
<strong>@items.Sum(i => i.Price * i.StockQuantity).ToString("N0")</strong>
|
||||||
|
<small>@items.Sum(i => i.StockQuantity) ks celkem</small>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="ao-filters">
|
||||||
|
<input class="ao-input" placeholder="Hledat produkt nebo kategorii…"
|
||||||
|
@bind="search" @bind:event="oninput" />
|
||||||
|
|
||||||
|
<select class="ao-select" @bind="stockFilter">
|
||||||
|
<option value="all">Stav: vše</option>
|
||||||
|
<option value="ok">V pořádku (>@LowThreshold)</option>
|
||||||
|
<option value="low">Nízký (1–@LowThreshold)</option>
|
||||||
|
<option value="out">Vyprodané (0)</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select class="ao-select" @bind="categoryFilter">
|
||||||
|
<option value="all">Kategorie: vše</option>
|
||||||
|
@foreach (var c in categoryNames)
|
||||||
|
{
|
||||||
|
<option value="@c">@c</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select class="ao-select" @bind="sortBy">
|
||||||
|
<option value="stock_asc">Řadit: nejméně kusů</option>
|
||||||
|
<option value="stock_desc">Řadit: nejvíce kusů</option>
|
||||||
|
<option value="name">Řadit: název</option>
|
||||||
|
<option value="value">Řadit: hodnota</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sklad-row" style="padding-left:0;padding-right:0">
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy" @onclick="ReloadAsync">Obnovit</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy || !HasPending" @onclick="SaveAllAsync">
|
||||||
|
Uložit všechny změny @(HasPending ? $"({PendingCount})" : "")
|
||||||
|
</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy" @onclick="() => QuickFilterOut()">
|
||||||
|
Jen vyprodané
|
||||||
|
</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy" @onclick="() => QuickFilterLow()">
|
||||||
|
Jen nízký sklad
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="ao-panel">
|
||||||
|
<div class="ao-panel-head">
|
||||||
|
<div>
|
||||||
|
<h2>Zásoby</h2>
|
||||||
|
<p>@Filtered.Count položek</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (Filtered.Count == 0)
|
||||||
|
{
|
||||||
|
<div class="ao-empty">Nic nenalezeno.</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="ao-list">
|
||||||
|
@foreach (var p in Filtered)
|
||||||
|
{
|
||||||
|
var qty = GetEditQty(p.Id);
|
||||||
|
var dirty = IsDirty(p.Id, p.StockQuantity);
|
||||||
|
|
||||||
|
<article class="ao-card @(dirty ? "is-open" : null)" @key="p.Id">
|
||||||
|
<div class="ao-card-main" style="cursor:default">
|
||||||
|
<div class="ao-card-left">
|
||||||
|
<span class="ao-code">@p.Name</span>
|
||||||
|
<span class="ao-date">@p.CategoryName</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-mid">
|
||||||
|
<span class="ao-pay">@p.Price.ToString("N0") Kč / ks</span>
|
||||||
|
<span class="ao-qty">hodnota @((p.Price * qty).ToString("N0")) Kč</span>
|
||||||
|
</div>
|
||||||
|
<div class="ao-card-right">
|
||||||
|
<span class="ao-badge @StockBadge(qty)">
|
||||||
|
@StockLabel(qty)
|
||||||
|
</span>
|
||||||
|
@if (dirty)
|
||||||
|
{
|
||||||
|
<span class="ao-date">neuloženo</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sklad-row">
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => Adjust(p.Id, -5)">
|
||||||
|
−5
|
||||||
|
</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => Adjust(p.Id, -1)">
|
||||||
|
−
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<input type="number" min="0" class="ao-input sklad-input"
|
||||||
|
value="@qty"
|
||||||
|
@onchange="e => OnStockInput(p.Id, e)" />
|
||||||
|
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => Adjust(p.Id, 1)">
|
||||||
|
+
|
||||||
|
</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => Adjust(p.Id, 5)">
|
||||||
|
+5
|
||||||
|
</button>
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => Adjust(p.Id, 10)">
|
||||||
|
+10
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="ap-btn ap-btn-primary" disabled="@busy"
|
||||||
|
@onclick="() => SaveOneAsync(p.Id)">
|
||||||
|
Uložit
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => SetQty(p.Id, 0)">
|
||||||
|
Na 0
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="ap-btn ap-btn-ghost" disabled="@busy"
|
||||||
|
@onclick="() => ToggleVisibleAsync(p)">
|
||||||
|
@(p.IsVisible ? "Skrýt" : "Zobrazit")
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<a class="ap-btn ap-btn-ghost" href="@($"/admin/zbozi/edit/{p.Id}")">Upravit</a>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</section>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private const int LowThreshold = 5;
|
||||||
|
|
||||||
|
private List<StockRow> items = new();
|
||||||
|
private readonly Dictionary<int, int> edits = new();
|
||||||
|
private List<string> categoryNames = new();
|
||||||
|
|
||||||
|
private bool loading = true;
|
||||||
|
private bool busy;
|
||||||
|
private string? message;
|
||||||
|
|
||||||
|
private string search = "";
|
||||||
|
private string stockFilter = "all";
|
||||||
|
private string categoryFilter = "all";
|
||||||
|
private string sortBy = "stock_asc";
|
||||||
|
|
||||||
|
private bool HasPending => items.Any(i => IsDirty(i.Id, i.StockQuantity));
|
||||||
|
private int PendingCount => items.Count(i => IsDirty(i.Id, i.StockQuantity));
|
||||||
|
|
||||||
|
private List<StockRow> Filtered
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
IEnumerable<StockRow> q = items;
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(search))
|
||||||
|
{
|
||||||
|
q = q.Where(p =>
|
||||||
|
p.Name.Contains(search, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
p.CategoryName.Contains(search, StringComparison.OrdinalIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (categoryFilter != "all")
|
||||||
|
{
|
||||||
|
q = q.Where(p => p.CategoryName == categoryFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
q = stockFilter switch
|
||||||
|
{
|
||||||
|
"ok" => q.Where(p => GetEditQty(p.Id) > LowThreshold),
|
||||||
|
"low" => q.Where(p =>
|
||||||
|
{
|
||||||
|
var n = GetEditQty(p.Id);
|
||||||
|
return n > 0 && n <= LowThreshold;
|
||||||
|
}),
|
||||||
|
"out" => q.Where(p => GetEditQty(p.Id) <= 0),
|
||||||
|
_ => q
|
||||||
|
};
|
||||||
|
|
||||||
|
q = sortBy switch
|
||||||
|
{
|
||||||
|
"stock_desc" => q.OrderByDescending(p => GetEditQty(p.Id)).ThenBy(p => p.Name),
|
||||||
|
"name" => q.OrderBy(p => p.Name),
|
||||||
|
"value" => q.OrderByDescending(p => p.Price * GetEditQty(p.Id)),
|
||||||
|
_ => q.OrderBy(p => GetEditQty(p.Id)).ThenBy(p => p.Name)
|
||||||
|
};
|
||||||
|
|
||||||
|
return q.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await ReloadAsync();
|
||||||
|
loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ReloadAsync()
|
||||||
|
{
|
||||||
|
items = await Db.Products
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(p => p.Name)
|
||||||
|
.Select(p => new StockRow(
|
||||||
|
p.Id,
|
||||||
|
p.Name,
|
||||||
|
p.Category.Name,
|
||||||
|
p.Price,
|
||||||
|
p.StockQuantity,
|
||||||
|
p.IsVisible))
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
categoryNames = items
|
||||||
|
.Select(i => i.CategoryName)
|
||||||
|
.Distinct()
|
||||||
|
.OrderBy(x => x)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
edits.Clear();
|
||||||
|
foreach (var i in items)
|
||||||
|
edits[i.Id] = i.StockQuantity;
|
||||||
|
|
||||||
|
message = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int GetEditQty(int id) =>
|
||||||
|
edits.TryGetValue(id, out var v) ? v : 0;
|
||||||
|
|
||||||
|
private bool IsDirty(int id, int original) =>
|
||||||
|
edits.TryGetValue(id, out var v) && v != original;
|
||||||
|
|
||||||
|
private void OnStockInput(int id, ChangeEventArgs e)
|
||||||
|
{
|
||||||
|
if (int.TryParse(e.Value?.ToString(), out var val))
|
||||||
|
edits[id] = Math.Max(0, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Adjust(int id, int delta)
|
||||||
|
{
|
||||||
|
edits[id] = Math.Max(0, GetEditQty(id) + delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetQty(int id, int qty)
|
||||||
|
{
|
||||||
|
edits[id] = Math.Max(0, qty);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void QuickFilterOut()
|
||||||
|
{
|
||||||
|
stockFilter = "out";
|
||||||
|
sortBy = "name";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void QuickFilterLow()
|
||||||
|
{
|
||||||
|
stockFilter = "low";
|
||||||
|
sortBy = "stock_asc";
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SaveOneAsync(int id)
|
||||||
|
{
|
||||||
|
busy = true;
|
||||||
|
message = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var entity = await Db.Products.FirstOrDefaultAsync(p => p.Id == id);
|
||||||
|
if (entity is null)
|
||||||
|
{
|
||||||
|
message = "Produkt nebyl nalezen.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var qty = GetEditQty(id);
|
||||||
|
entity.StockQuantity = qty;
|
||||||
|
entity.UpdatedAt = DateTime.UtcNow;
|
||||||
|
await Db.SaveChangesAsync();
|
||||||
|
|
||||||
|
message = $"Uloženo: {entity.Name} → {qty} ks";
|
||||||
|
await ReloadAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
message = "Chyba: " + ex.Message;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
busy = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SaveAllAsync()
|
||||||
|
{
|
||||||
|
busy = true;
|
||||||
|
message = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var changed = items.Where(i => IsDirty(i.Id, i.StockQuantity)).ToList();
|
||||||
|
if (changed.Count == 0)
|
||||||
|
{
|
||||||
|
message = "Žádné změny k uložení.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ids = changed.Select(c => c.Id).ToList();
|
||||||
|
var entities = await Db.Products.Where(p => ids.Contains(p.Id)).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var entity in entities)
|
||||||
|
{
|
||||||
|
entity.StockQuantity = GetEditQty(entity.Id);
|
||||||
|
entity.UpdatedAt = DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Db.SaveChangesAsync();
|
||||||
|
message = $"Uloženo změn: {entities.Count}";
|
||||||
|
await ReloadAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
message = "Hromadné uložení selhalo: " + ex.Message;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
busy = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ToggleVisibleAsync(StockRow row)
|
||||||
|
{
|
||||||
|
busy = true;
|
||||||
|
message = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var entity = await Db.Products.FirstAsync(p => p.Id == row.Id);
|
||||||
|
entity.IsVisible = !entity.IsVisible;
|
||||||
|
entity.UpdatedAt = DateTime.UtcNow;
|
||||||
|
await Db.SaveChangesAsync();
|
||||||
|
message = entity.IsVisible ? $"Zobrazeno: {entity.Name}" : $"Skryto v e-shopu: {entity.Name}";
|
||||||
|
await ReloadAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
message = ex.Message;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
busy = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string StockLabel(int q) =>
|
||||||
|
q <= 0 ? "Vyprodané" : q <= LowThreshold ? "Nízký sklad" : "V pořádku";
|
||||||
|
|
||||||
|
private static string StockBadge(int q) =>
|
||||||
|
q <= 0 ? "is-cancel" : q <= LowThreshold ? "is-pending" : "is-paid";
|
||||||
|
|
||||||
|
private sealed record StockRow(
|
||||||
|
int Id,
|
||||||
|
string Name,
|
||||||
|
string CategoryName,
|
||||||
|
decimal Price,
|
||||||
|
int StockQuantity,
|
||||||
|
bool IsVisible);
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -3116,3 +3116,517 @@ textarea.wj-input {
|
|||||||
.cart-remove-button:hover {
|
.cart-remove-button:hover {
|
||||||
background: #b02a37;
|
background: #b02a37;
|
||||||
}
|
}
|
||||||
|
/* Detail objednávky v adminu */
|
||||||
|
.ap-order-detail {
|
||||||
|
padding: 8px 4px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-grid span {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-grid strong {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-items {
|
||||||
|
margin-top: 14px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-item span {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-order-total {
|
||||||
|
margin-top: 14px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 4px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.ap-order-grid {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sklad-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sklad-input {
|
||||||
|
width: 90px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.sklad-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.sklad-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
}
|
||||||
|
/* ===== Apple admin listy (globálnì pro kategorie, zboží, sklad, objednávky) ===== */
|
||||||
|
|
||||||
|
.ao {
|
||||||
|
max-width: 980px;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #1d1d1f;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-hero {
|
||||||
|
text-align: center;
|
||||||
|
padding: 18px 8px 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-eyebrow {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-hero h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-sub {
|
||||||
|
margin: 10px auto 0;
|
||||||
|
max-width: 420px;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-loading,
|
||||||
|
.ao-empty,
|
||||||
|
.ao-alert {
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
|
color: #6e6e73;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-alert {
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stats {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat {
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.04);
|
||||||
|
border-radius: 22px;
|
||||||
|
padding: 18px 16px;
|
||||||
|
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat span {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat strong {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 750;
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-stat small {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #86868b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel {
|
||||||
|
background: rgba(255, 255, 255, 0.92);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.045);
|
||||||
|
border-radius: 26px;
|
||||||
|
padding: 18px 18px 12px;
|
||||||
|
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 4px 6px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-panel-head p {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-filters {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 0 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input,
|
||||||
|
.ao-select {
|
||||||
|
border: 1px solid #d2d2d7;
|
||||||
|
border-radius: 14px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
font-size: 14px;
|
||||||
|
background: #fff;
|
||||||
|
color: #1d1d1f;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 180px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-select {
|
||||||
|
min-width: 190px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-input:focus,
|
||||||
|
.ao-select:focus {
|
||||||
|
border-color: #1d1d1f;
|
||||||
|
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card {
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fafafa;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card.is-open,
|
||||||
|
.ao-card:hover {
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-main {
|
||||||
|
width: 100%;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1.2fr 1fr 1fr auto;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px;
|
||||||
|
text-align: left;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-left,
|
||||||
|
.ao-card-mid,
|
||||||
|
.ao-card-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-right {
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-code {
|
||||||
|
font-weight: 750;
|
||||||
|
font-size: 15px;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-date,
|
||||||
|
.ao-pay,
|
||||||
|
.ao-qty {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-price {
|
||||||
|
font-weight: 750;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
background: #f0f0f2;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-pending {
|
||||||
|
background: #f0f0f2;
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-paid {
|
||||||
|
background: #1d1d1f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-shipped {
|
||||||
|
background: #3a3a3c;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-done {
|
||||||
|
background: #1d1d1f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-badge.is-cancel {
|
||||||
|
background: #e8e8ed;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-chevron {
|
||||||
|
font-size: 22px;
|
||||||
|
color: #aeaeb2;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-chevron.is-open {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail {
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid span {
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #6e6e73;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid strong {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-note {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-items {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-item span {
|
||||||
|
display: block;
|
||||||
|
margin-top: 2px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6e6e73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-total {
|
||||||
|
margin-top: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 4px 4px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-total strong {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 750;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sklad-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sklad-input {
|
||||||
|
width: 90px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-field label {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-help {
|
||||||
|
color: #6e6e73;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-switch {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 8px 0 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-form-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||||
|
background: #fff;
|
||||||
|
color: #1d1d1f;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-btn:hover {
|
||||||
|
background: #f5f5f7;
|
||||||
|
color: #1d1d1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-btn-primary {
|
||||||
|
background: #1d1d1f;
|
||||||
|
border-color: #1d1d1f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-btn-primary:hover {
|
||||||
|
background: #000;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ap-btn-ghost {
|
||||||
|
padding: 7px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
background: #f5f5f7;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.ao-stats {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-card-main {
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ao-detail-grid {
|
||||||
|
grid--template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user