Compare commits

..

2 Commits

Author SHA1 Message Date
Ondur
1dad6cc160 Merge branch 'main' of https://git.vedetvic.cz/Ondur/Web-Jarmark 2026-11-11 17:16:22 +01:00
Ondur
89fd7a2f46 admin 2026-11-11 17:16:20 +01:00
5 changed files with 271 additions and 139 deletions

View File

@@ -1,15 +1,42 @@
@inherits LayoutComponentBase
@inherits LayoutComponentBase
@implements IDisposable
@inject NavigationManager Nav
<div class="admin-shell">
<div class="admin-shell @(collapsed ? "is-collapsed" : null)">
<aside class="admin-sidebar">
<div class="admin-sidebar-head">
<a href="/admin" class="admin-logo">
<span class="admin-logo-mark">W</span>
<span class="admin-logo-text">Web-Jarmark</span>
</a>
<button type="button"
class="admin-toggle"
title="@(collapsed ? "Rozbalit" : "Sbalit")"
@onclick="Toggle">
☰
</button>
</div>
<AdminNavMenu />
<div class="admin-sidebar-foot">
<div class="admin-foot-card">
<span class="admin-logo-mark small">W</span>
<div class="admin-foot-text">
<strong>Web-Jarmark</strong>
<small>Administrace</small>
</div>
</div>
</div>
</aside>
<div class="admin-main">
<header class="admin-topbar">
<div class="admin-topbar-title">@SectionTitle</div>
<div class="admin-topbar-user">
<span class="admin-dot"></span>
Administrátor
<span>Administrátor</span>
</div>
</header>
@@ -20,8 +47,11 @@
</div>
@code {
private bool collapsed;
private string SectionTitle = "Přehled";
private void Toggle() => collapsed = !collapsed;
protected override void OnInitialized()
{
UpdateTitle();
@@ -45,7 +75,6 @@
var p when p.StartsWith("/admin/zbozi") => "Zboží",
var p when p.StartsWith("/admin/objednavky") => "Objednávky",
var p when p.StartsWith("/admin/administratori") => "Administrátoři",
var p when p.StartsWith("/admin/zakaznici") => "Administrátoři",
var p when p.StartsWith("/admin/sklad") => "Sklad",
var p when p.StartsWith("/admin/statistiky") => "Statistiky",
var p when p.StartsWith("/admin/nastaveni") => "Nastavení",

View File

@@ -1,200 +1,141 @@
/* Nový admin shell – třídy admin-*, ať se nesráží se starým app.css */
/* Apple-like admin – plovoucí, hodně zaoblené */
.admin-shell {
--bg: #f3f3f3;
--surface: #ffffff;
--ink: #111111;
--muted: #6b6b6b;
--line: #e4e4e4;
--hover: #f0f0f0;
--active: #111111;
--sidebar: 250px;
--sidebar-collapsed: 78px;
--radius: 12px;
display: flex;
--bg: #f5f5f7;
--ink: #1d1d1f;
--muted: #6e6e73;
--line: rgba(0, 0, 0, 0.06);
--sidebar-w: 280px;
--sidebar-w-collapsed: 92px;
min-height: 100vh;
display: flex;
gap: 14px;
padding: 14px;
box-sizing: border-box;
background: var(--bg);
color: var(--ink);
font-family: Inter, "Segoe UI", system-ui, sans-serif;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
}
/* SIDEBAR */
/* ===== SIDEBAR CARD ===== */
.admin-sidebar {
width: var(--sidebar);
width: var(--sidebar-w);
flex-shrink: 0;
position: sticky;
top: 0;
height: 100vh;
top: 14px;
height: calc(100vh - 28px);
display: flex;
flex-direction: column;
background: var(--surface);
border-right: 1px solid var(--line);
transition: width 0.25s ease;
background: rgba(255, 255, 255, 0.86);
border: 1px solid rgba(0, 0, 0, 0.04);
border-radius: 28px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
backdrop-filter: blur(18px);
overflow: hidden;
transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-shell.is-collapsed .admin-sidebar {
width: var(--sidebar-collapsed);
width: var(--sidebar-w-collapsed);
}
.admin-sidebar-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 18px 14px 10px;
gap: 10px;
padding: 18px 16px 12px;
}
.admin-logo {
display: flex;
align-items: center;
gap: 10px;
gap: 12px;
text-decoration: none;
color: var(--ink);
min-width: 0;
}
.admin-logo-mark {
width: 36px;
height: 36px;
width: 40px;
height: 40px;
border-radius: 14px;
background: #1d1d1f;
color: #fff;
display: grid;
place-items: center;
background: #111;
color: #fff;
border-radius: 10px;
font-weight: 800;
font-size: 15px;
flex-shrink: 0;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.admin-logo-mark.small {
width: 30px;
height: 30px;
width: 32px;
height: 32px;
border-radius: 11px;
font-size: 12px;
border-radius: 8px;
}
.admin-logo-text {
font-weight: 750;
font-size: 15px;
font-weight: 700;
font-size: 16px;
letter-spacing: -0.03em;
white-space: nowrap;
}
.admin-shell.is-collapsed .admin-logo-text,
.admin-shell.is-collapsed .admin-foot-text {
display: none;
}
.admin-toggle {
width: 34px;
height: 34px;
border: 1px solid var(--line);
border-radius: 10px;
background: #fff;
width: 38px;
height: 38px;
border: 0;
border-radius: 13px;
background: #f0f0f2;
color: var(--ink);
cursor: pointer;
flex-shrink: 0;
transition: background 0.2s ease, transform 0.15s ease;
}
.admin-toggle:hover {
background: var(--hover);
background: #e6e6ea;
transform: scale(1.03);
}
.admin-sidebar-foot {
margin-top: auto;
padding: 12px;
border-top: 1px solid var(--line);
display: flex;
align-items: center;
gap: 10px;
}
.admin-foot-text strong {
display: block;
font-size: 12px;
}
.admin-foot-text small {
display: block;
color: var(--muted);
font-size: 11px;
margin-top: 2px;
}
/* MAIN */
.admin-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.admin-topbar {
height: 64px;
padding: 0 28px;
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(255, 255, 255, 0.92);
border-bottom: 1px solid var(--line);
position: sticky;
top: 0;
z-index: 10;
}
.admin-topbar-title {
font-size: 17px;
font-weight: 700;
}
.admin-topbar-user {
display: flex;
align-items: center;
gap: 8px;
font-weight: 600;
font-size: 13px;
}
.admin-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #111;
box-shadow: 0 0 0 3px #ececec;
}
.admin-content {
padding: 28px 32px 40px;
}
/* MENU uvnitř sidebaru (přes ::deep, protože je v child komponentě) */
/* NAV */
::deep .admin-nav {
display: flex;
flex-direction: column;
gap: 4px;
padding: 8px 10px 16px;
gap: 6px;
padding: 8px 12px 12px;
flex: 1;
overflow-y: auto;
}
::deep .admin-nav-link {
display: flex;
align-items: center;
gap: 12px;
padding: 11px 12px;
border-radius: 10px;
color: #444;
padding: 13px 14px;
border-radius: 16px;
text-decoration: none;
color: var(--muted);
font-weight: 600;
transition: background 0.15s ease, color 0.15s ease;
font-size: 14px;
letter-spacing: -0.01em;
transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
white-space: nowrap;
}
::deep .admin-nav-link:hover {
background: var(--hover);
color: #111;
background: rgba(0, 0, 0, 0.04);
color: var(--ink);
}
::deep .admin-nav-link.active {
background: #111;
background: #1d1d1f;
color: #fff;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}
::deep .admin-nav-ico {
@@ -202,10 +143,104 @@
text-align: center;
flex-shrink: 0;
font-size: 15px;
opacity: 0.9;
}
.admin-shell.is-collapsed ::deep .admin-nav-label {
::deep .admin-nav-label {
overflow: hidden;
}
/* FOOT */
.admin-sidebar-foot {
padding: 10px 12px 14px;
}
.admin-foot-card {
display: flex;
align-items: center;
gap: 10px;
padding: 12px;
border-radius: 18px;
background: #f5f5f7;
}
.admin-foot-text {
min-width: 0;
overflow: hidden;
}
.admin-foot-text strong {
display: block;
font-size: 13px;
font-weight: 700;
letter-spacing: -0.02em;
}
.admin-foot-text small {
display: block;
font-size: 11px;
color: var(--muted);
}
/* ===== MAIN CARD ===== */
.admin-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(0, 0, 0, 0.04);
border-radius: 28px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
backdrop-filter: blur(18px);
overflow: hidden;
}
.admin-topbar {
height: 68px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 0 28px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
background: rgba(255, 255, 255, 0.55);
}
.admin-topbar-title {
font-size: 20px;
font-weight: 700;
letter-spacing: -0.03em;
}
.admin-topbar-user {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 999px;
background: #f5f5f7;
font-size: 13px;
font-weight: 600;
color: var(--muted);
}
.admin-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #1d1d1f;
}
.admin-content {
padding: 22px 28px 36px;
flex: 1;
overflow: auto;
}
/* Collapsed */
.admin-shell.is-collapsed .admin-logo-text,
.admin-shell.is-collapsed ::deep .admin-nav-label,
.admin-shell.is-collapsed .admin-foot-text {
display: none;
}
@@ -214,3 +249,31 @@
padding-left: 0;
padding-right: 0;
}
.admin-shell.is-collapsed .admin-sidebar-head {
justify-content: center;
flex-direction: column;
}
.admin-shell.is-collapsed .admin-foot-card {
justify-content: center;
}
.admin-shell.is-collapsed .admin-logo {
justify-content: center;
}
/* SVG ikony v menu */
::deep .admin-nav-ico {
width: 22px;
height: 22px;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
::deep .admin-nav-ico svg {
width: 20px;
height: 20px;
display: block;
}

View File

@@ -3,42 +3,82 @@
<nav class="admin-nav">
<a href="/admin" class="admin-nav-link @(IsCurrent("/admin", true) ? "active" : null)">
<span class="admin-nav-ico">⌂</span>
<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="M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1v-9.5Z" />
</svg>
</span>
<span class="admin-nav-label">Přehled</span>
</a>
<a href="/admin/kategorie" class="admin-nav-link @(IsCurrent("/admin/kategorie") ? "active" : null)">
<span class="admin-nav-ico">▤</span>
<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">
<rect x="4" y="4" width="7" height="7" rx="1.5" />
<rect x="13" y="4" width="7" height="7" rx="1.5" />
<rect x="4" y="13" width="7" height="7" rx="1.5" />
<rect x="13" y="13" width="7" height="7" rx="1.5" />
</svg>
</span>
<span class="admin-nav-label">Kategorie</span>
</a>
<a href="/admin/zbozi" class="admin-nav-link @(IsCurrent("/admin/zbozi") ? "active" : null)">
<span class="admin-nav-ico">◇</span>
<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="M7 7h10l1.2 12.2a1.5 1.5 0 0 1-1.5 1.6H7.3a1.5 1.5 0 0 1-1.5-1.6L7 7Z" />
<path d="M9 7a3 3 0 0 1 6 0" />
</svg>
</span>
<span class="admin-nav-label">Zboží</span>
</a>
<a href="/admin/objednavky" class="admin-nav-link @(IsCurrent("/admin/objednavky") ? "active" : null)">
<span class="admin-nav-ico">▣</span>
<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="M7 4h10a2 2 0 0 1 2 2v14l-3-2-3 2-3-2-3 2V6a2 2 0 0 1 2-2Z" />
<path d="M9 9h6M9 13h6" />
</svg>
</span>
<span class="admin-nav-label">Objednávky</span>
</a>
<a href="/admin/administratori" class="admin-nav-link @(IsCurrent("/admin/administratori") ? "active" : null)">
<span class="admin-nav-ico">👤</span>
<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">
<circle cx="12" cy="8" r="3.5" />
<path d="M5.5 19a6.5 6.5 0 0 1 13 0" />
</svg>
</span>
<span class="admin-nav-label">Administrátoři</span>
</a>
<a href="/admin/sklad" class="admin-nav-link @(IsCurrent("/admin/sklad") ? "active" : null)">
<span class="admin-nav-ico">▥</span>
<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="M4 8.5 12 4l8 4.5V19a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8.5Z" />
<path d="M12 12v8M8 10.5 12 12l4-1.5" />
</svg>
</span>
<span class="admin-nav-label">Sklad</span>
</a>
<a href="/admin/statistiky" class="admin-nav-link @(IsCurrent("/admin/statistiky") ? "active" : null)">
<span class="admin-nav-ico">▦</span>
<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="M5 19V11M12 19V5M19 19v-7" />
</svg>
</span>
<span class="admin-nav-label">Statistiky</span>
</a>
<a href="/admin/nastaveni" class="admin-nav-link @(IsCurrent("/admin/nastaveni") ? "active" : null)">
<span class="admin-nav-ico">⚙</span>
<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">
<circle cx="12" cy="12" r="3" />
<path d="M12 3.5v2.2M12 18.3v2.2M4.9 6.4l1.6 1.6M17.5 16l1.6 1.6M3.5 12h2.2M18.3 12h2.2M4.9 17.6l1.6-1.6M17.5 8l1.6-1.6" />
</svg>
</span>
<span class="admin-nav-label">Nastavení</span>
</a>
</nav>