feat(web): add Discord login button, platform indicator, and CSS styles
- Discord login button on /login with brand colors - NavMenu shows user avatar (Discord) and platform label - CSS: login-divider, login-btn-discord, nav-user-info, nav-user-platform - NavMenu version bumped to v2.8.0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,19 @@
|
||||
<div class="nav-footer">
|
||||
<div class="nav-user">
|
||||
<div class="nav-user-avatar">
|
||||
@(context.User.Identity?.Name?.Substring(0, 1).ToUpper() ?? "?")
|
||||
@if (!string.IsNullOrWhiteSpace(context.User.GetAvatarUrl()))
|
||||
{
|
||||
<img src="@context.User.GetAvatarUrl()" alt="" />
|
||||
}
|
||||
else
|
||||
{
|
||||
@(context.User.Identity?.Name?.Substring(0, 1).ToUpper() ?? "?")
|
||||
}
|
||||
</div>
|
||||
<div class="nav-user-info">
|
||||
<span class="nav-user-name">@context.User.Identity?.Name</span>
|
||||
<span class="nav-user-platform">@GetPlatformLabel(context.User)</span>
|
||||
</div>
|
||||
<span class="nav-user-name">@context.User.Identity?.Name</span>
|
||||
</div>
|
||||
|
||||
<form action="/auth/logout" method="post">
|
||||
@@ -56,7 +66,7 @@
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="nav-version">v2.7.2</div>
|
||||
<div class="nav-version">v2.8.0</div>
|
||||
</div>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
@@ -79,4 +89,7 @@
|
||||
|
||||
private void ToggleMenu() => isOpen = !isOpen;
|
||||
private void CloseMenu() => isOpen = false;
|
||||
|
||||
private static string GetPlatformLabel(System.Security.Claims.ClaimsPrincipal user) =>
|
||||
user.TryGetDiscordId(out _) ? "Discord" : "Telegram";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user