From 90a4c17a7dab2e0836a4950c91909a785c01be5a Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Jun 2025 20:17:35 +0800 Subject: [PATCH] fix(account): fixed user login link style - Align the login link with the language switch bar --- .../Bundling/AccountBundles.cs | 18 ++++++++++++++++++ .../Bundling/UserLoginLinkStyleContributor.cs | 14 ++++++++++++++ .../LINGYUN.Abp.Account.Web.csproj | 5 ++++- .../Toolbar/UserLoginLink/Default.cshtml | 8 ++++++++ .../Modules/_ViewImports.cshtml | 4 ++++ .../styles/user-login-link/fix-style.css | 3 +++ 6 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/AccountBundles.cs create mode 100644 aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/UserLoginLinkStyleContributor.cs create mode 100644 aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml create mode 100644 aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/_ViewImports.cshtml create mode 100644 aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/styles/user-login-link/fix-style.css diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/AccountBundles.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/AccountBundles.cs new file mode 100644 index 000000000..9e72afeb9 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/AccountBundles.cs @@ -0,0 +1,18 @@ +namespace LINGYUN.Abp.Account.Web.Bundling; + +public static class AccountBundles +{ + public static class Scripts + { + public const string Global = "Abp.Account"; + + public const string ChangePassword = Global + ".ChangePassword"; + } + + public static class Styles + { + public const string Global = "Abp.Account"; + + public const string UserLoginLink = Global + ".UserLoginLink"; + } +} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/UserLoginLinkStyleContributor.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/UserLoginLinkStyleContributor.cs new file mode 100644 index 000000000..79c159a85 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Bundling/UserLoginLinkStyleContributor.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace LINGYUN.Abp.Account.Web.Bundling; + +public class UserLoginLinkStyleContributor : BundleContributor +{ + public override Task ConfigureBundleAsync(BundleConfigurationContext context) + { + context.Files.Add("/styles/user-login-link/fix-style.css"); + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj index 61556a1ac..6b5fb6bfd 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj @@ -38,7 +38,6 @@ - @@ -48,4 +47,8 @@ + + + + diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml new file mode 100644 index 000000000..5efd868b3 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml @@ -0,0 +1,8 @@ +@using Localization.Resources.AbpUi +@using Microsoft.AspNetCore.Mvc.Localization +@using LINGYUN.Abp.Account.Web.Bundling; +@inject IHtmlLocalizer L + + + +@L["Login"] diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/_ViewImports.cshtml b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/_ViewImports.cshtml new file mode 100644 index 000000000..c1da1f5f1 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Modules/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/styles/user-login-link/fix-style.css b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/styles/user-login-link/fix-style.css new file mode 100644 index 000000000..2347184f4 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/styles/user-login-link/fix-style.css @@ -0,0 +1,3 @@ +.fix-margin { + margin: 10px 0; +}