Files
GmRelayBot/src/GmRelay.Web/Components/Layout/NavMenu.razor
T
Toutsu cea6ec801a
PR Checks / test-and-build (pull_request) Successful in 5m11s
chore: bump version to 2.1.0
Synchronize version across all 4 files:
- Directory.Build.props
- compose.yaml (bot + web images)
- .gitea/workflows/deploy.yml
- NavMenu.razor

Bump version → 2.1.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:22:00 +03:00

83 lines
3.6 KiB
Plaintext

@inject NavigationManager Navigation
<div class="nav-header">
<a class="nav-brand" href="">
<img src="logo.png" alt="GM-Relay" class="nav-brand-icon" />
<span class="nav-brand-text">GM-Relay</span>
</a>
<button class="nav-toggle" @onclick="ToggleMenu" aria-label="Переключить меню">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="6" x2="21" y2="6"/>
<line x1="3" y1="12" x2="21" y2="12"/>
<line x1="3" y1="18" x2="21" y2="18"/>
</svg>
</button>
</div>
<nav class="nav-body @(isOpen ? "open" : "")">
<AuthorizeView>
<Authorized>
<div class="nav-section">
<NavLink class="nav-item" href="" Match="NavLinkMatch.All" @onclick="CloseMenu">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
<polyline points="9 22 9 12 15 12 15 22"/>
</svg>
Главная страница
</NavLink>
<NavLink class="nav-item" href="templates" @onclick="CloseMenu">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="4" width="18" height="16" rx="2"/>
<path d="M7 8h10"/>
<path d="M7 12h6"/>
<path d="M7 16h8"/>
</svg>
Шаблоны
</NavLink>
</div>
<div class="nav-footer">
<div class="nav-user">
<div class="nav-user-avatar">
@(context.User.Identity?.Name?.Substring(0, 1).ToUpper() ?? "?")
</div>
<span class="nav-user-name">@context.User.Identity?.Name</span>
</div>
<form action="/auth/logout" method="post">
<AntiforgeryToken />
<button type="submit" class="nav-logout-btn">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1-2 2h4"/>
<polyline points="16 17 21 12 16 7"/>
<line x1="21" y1="12" x2="9" y2="12"/>
</svg>
Выход
</button>
</form>
<div class="nav-version">v2.1.0</div>
</div>
</Authorized>
<NotAuthorized>
<div class="nav-section">
<NavLink class="nav-item" href="login" @onclick="CloseMenu">
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/>
<polyline points="10 17 15 12 10 7"/>
<line x1="15" y1="12" x2="3" y2="12"/>
</svg>
Вход
</NavLink>
</div>
</NotAuthorized>
</AuthorizeView>
</nav>
@code {
private bool isOpen;
private void ToggleMenu() => isOpen = !isOpen;
private void CloseMenu() => isOpen = false;
}