diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopWebModule.cs b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopWebModule.cs index 8d489677..82cf853b 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopWebModule.cs +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopWebModule.cs @@ -6,6 +6,7 @@ using EasyAbp.EShop.Orders.Web; using EasyAbp.EShop.Payments.Web; using EasyAbp.EShop.Products.Web; using EasyAbp.EShop.Stores.Web; +using EasyAbp.EShop.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopMenuContributor.cs b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenuContributor.cs similarity index 93% rename from integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopMenuContributor.cs rename to integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenuContributor.cs index f19bee41..cb36a501 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EShopMenuContributor.cs +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenuContributor.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Web +namespace EasyAbp.EShop.Web.Menus { public class EShopMenuContributor : IMenuContributor { diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenus.cs b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenus.cs new file mode 100644 index 00000000..c2426dda --- /dev/null +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Menus/EShopMenus.cs @@ -0,0 +1,13 @@ +namespace EasyAbp.EShop.Web.Menus +{ + public class EShopMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShop/Index.cshtml b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShop/Index.cshtml index 0f183876..10852dba 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShop/Index.cshtml +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShop/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Web.Pages.EShopPage @model EasyAbp.EShop.Web.Pages.EShop.IndexModel @{ } diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShopPage.cs b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShopPage.cs deleted file mode 100644 index d6c1d550..00000000 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/Pages/EShopPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Web.Pages.EShopPage - */ - public abstract class EShopPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EShopOrdersWebModule.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EShopOrdersWebModule.cs index 19ad7f80..2b556c47 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EShopOrdersWebModule.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EShopOrdersWebModule.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Orders.Localization; +using EasyAbp.EShop.Orders.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersMenuContributor.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenuContributor.cs similarity index 77% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersMenuContributor.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenuContributor.cs index 3be700ae..f1660326 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersMenuContributor.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenuContributor.cs @@ -1,14 +1,12 @@ using System.Collections.Generic; using System.Threading.Tasks; using EasyAbp.EShop.Orders.Authorization; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Localization; using EasyAbp.EShop.Orders.Localization; using EasyAbp.EShop.Stores.Stores; -using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Orders.Web +namespace EasyAbp.EShop.Orders.Web.Menus { public class OrdersMenuContributor : IMenuContributor { @@ -24,7 +22,7 @@ namespace EasyAbp.EShop.Orders.Web { var l = context.GetLocalizer(); //Add main menu items. - var orderManagementMenuItem = new ApplicationMenuItem("EasyAbpEShopOrders", l["Menu:OrderManagement"]); + var orderManagementMenuItem = new ApplicationMenuItem(OrdersMenus.Prefix, l["Menu:OrderManagement"]); if (await context.IsGrantedAsync(OrdersPermissions.Orders.Manage)) { @@ -33,14 +31,14 @@ namespace EasyAbp.EShop.Orders.Web var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; orderManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopOrdersOrder", l["Menu:Order"], "/EShop/Orders/Orders/Order?storeId=" + defaultStore) + new ApplicationMenuItem(OrdersMenus.Order, l["Menu:Order"], "/EShop/Orders/Orders/Order?storeId=" + defaultStore) ); } if (!orderManagementMenuItem.Items.IsNullOrEmpty()) { - var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop", - () => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"])); + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == OrdersMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(OrdersMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(orderManagementMenuItem); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenus.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenus.cs new file mode 100644 index 00000000..fc499b41 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenus.cs @@ -0,0 +1,15 @@ +namespace EasyAbp.EShop.Orders.Web.Menus +{ + public class OrdersMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Orders"; + + public const string Order = Prefix + ".Order"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml index 5be644c2..438ac15b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Orders.Web.Pages.OrdersPage @model EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.IndexModel @{ } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml index 9223169f..72fe436d 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml @@ -1,15 +1,18 @@ @page +@using EasyAbp.EShop.Orders.Localization +@using EasyAbp.EShop.Orders.Web.Menus @using EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.Orders.Order +@using Microsoft.Extensions.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Orders.Web.Pages.OrdersPage @model IndexModel @inject IPageLayout PageLayout +@inject IStringLocalizer L @{ PageLayout.Content.Title = L["Order"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Order"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopOrdersOrder"; + PageLayout.Content.MenuItemName = OrdersMenus.Order; - var cardTitle = @L["Order"].Value; + var cardTitle = L["Order"].Value; if (Model.StoreName != null) { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/OrdersPage.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/OrdersPage.cs deleted file mode 100644 index c6d2aa7c..00000000 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/OrdersPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Orders.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Orders.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.OrdersPage - */ - public abstract class OrdersPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs index e8eb9eb1..ae761d2a 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Payments.Localization; +using EasyAbp.EShop.Payments.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenuContributor.cs similarity index 75% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenuContributor.cs index 5e35a349..604c97e0 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenuContributor.cs @@ -1,12 +1,12 @@ using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; -using EasyAbp.EShop.Payments.Localization; -using EasyAbp.EShop.Payments.Authorization; using System.Threading.Tasks; +using EasyAbp.EShop.Payments.Authorization; +using EasyAbp.EShop.Payments.Localization; using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Payments.Web +namespace EasyAbp.EShop.Payments.Web.Menus { public class PaymentsMenuContributor : IMenuContributor { @@ -22,7 +22,7 @@ namespace EasyAbp.EShop.Payments.Web { var l = context.GetLocalizer(); //Add main menu items. - var paymentManagementMenuItem = new ApplicationMenuItem("EasyAbpEShopPayments", l["Menu:PaymentManagement"]); + var paymentManagementMenuItem = new ApplicationMenuItem(PaymentsMenus.Prefix, l["Menu:PaymentManagement"]); var storeAppService = context.ServiceProvider.GetRequiredService(); @@ -31,20 +31,20 @@ namespace EasyAbp.EShop.Payments.Web if (await context.IsGrantedAsync(PaymentsPermissions.Payments.Manage)) { paymentManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopPaymentsPayment", l["Menu:Payment"], "/EShop/Payments/Payments/Payment?storeId=" + defaultStore) + new ApplicationMenuItem(PaymentsMenus.Payment, l["Menu:Payment"], "/EShop/Payments/Payments/Payment?storeId=" + defaultStore) ); } if (await context.IsGrantedAsync(PaymentsPermissions.Refunds.Manage)) { paymentManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopPaymentsRefund", l["Menu:Refund"], "/EShop/Payments/Refunds/Refund?storeId=" + defaultStore) + new ApplicationMenuItem(PaymentsMenus.Refund, l["Menu:Refund"], "/EShop/Payments/Refunds/Refund?storeId=" + defaultStore) ); } if (!paymentManagementMenuItem.Items.IsNullOrEmpty()) { - var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop", - () => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"])); + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == PaymentsMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(PaymentsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(paymentManagementMenuItem); } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenus.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenus.cs new file mode 100644 index 00000000..7b360054 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenus.cs @@ -0,0 +1,17 @@ +namespace EasyAbp.EShop.Payments.Web.Menus +{ + public class PaymentsMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Payments"; + + public const string Payment = Prefix + ".Payment"; + + public const string Refund = Prefix + ".Refund"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Index.cshtml b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Index.cshtml index 8d496257..761d0102 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Index.cshtml +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage @model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.IndexModel @{ } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml index 40521be7..9f95994e 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml @@ -1,18 +1,20 @@ @page @using Microsoft.AspNetCore.Authorization -@using EasyAbp.EShop.Payments.Authorization +@using EasyAbp.EShop.Payments.Localization +@using EasyAbp.EShop.Payments.Web.Menus @using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment +@using Microsoft.Extensions.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage @model IndexModel @inject IPageLayout PageLayout +@inject IStringLocalizer L @inject IAuthorizationService Authorization @{ PageLayout.Content.Title = L["Payment"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Payment"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopPaymentsPayment"; + PageLayout.Content.MenuItemName = PaymentsMenus.Payment; - var cardTitle = @L["Payment"].Value; + var cardTitle = L["Payment"].Value; if (Model.StoreName != null) { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml index df133784..2373b263 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml @@ -1,18 +1,21 @@ @page @using Microsoft.AspNetCore.Authorization @using EasyAbp.EShop.Payments.Authorization +@using EasyAbp.EShop.Payments.Localization +@using EasyAbp.EShop.Payments.Web.Menus @using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund +@using Microsoft.Extensions.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage @model IndexModel @inject IPageLayout PageLayout +@inject IStringLocalizer L @inject IAuthorizationService Authorization @{ PageLayout.Content.Title = L["Refund"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Refund"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopPaymentsRefund"; + PageLayout.Content.MenuItemName = PaymentsMenus.Refund; - var cardTitle = @L["Refund"].Value; + var cardTitle = L["Refund"].Value; if (Model.StoreName != null) { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/PaymentsPage.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/PaymentsPage.cs deleted file mode 100644 index 475da97b..00000000 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/PaymentsPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Payments.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Payments.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage - */ - public abstract class PaymentsPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EShopPluginsWebModule.cs b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EShopPluginsWebModule.cs index 0b94b0b6..6063a3fd 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EShopPluginsWebModule.cs +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EShopPluginsWebModule.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Plugins.Localization; +using EasyAbp.EShop.Plugins.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/PluginsMenuContributor.cs b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenuContributor.cs similarity index 92% rename from modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/PluginsMenuContributor.cs rename to modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenuContributor.cs index 7b2f09b2..44809536 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/PluginsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenuContributor.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Plugins.Web +namespace EasyAbp.EShop.Plugins.Web.Menus { public class PluginsMenuContributor : IMenuContributor { diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenus.cs b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenus.cs new file mode 100644 index 00000000..ee917bed --- /dev/null +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Menus/PluginsMenus.cs @@ -0,0 +1,13 @@ +namespace EasyAbp.EShop.Plugins.Web.Menus +{ + public class PluginsMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Plugins"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/EShop/Plugins/Index.cshtml b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/EShop/Plugins/Index.cshtml index 96f192fb..d8e817e9 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/EShop/Plugins/Index.cshtml +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/EShop/Plugins/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Plugins.Web.Pages.PluginsPage @model EasyAbp.EShop.Plugins.Web.Pages.EShop.Plugins.IndexModel @{ } diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/PluginsPage.cs b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/PluginsPage.cs deleted file mode 100644 index e1d0decc..00000000 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/Pages/PluginsPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Plugins.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Plugins.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Plugins.Web.Pages.PluginsPage - */ - public abstract class PluginsPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EShopProductsWebModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EShopProductsWebModule.cs index fe75c151..70817417 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EShopProductsWebModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EShopProductsWebModule.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Products.Localization; +using EasyAbp.EShop.Products.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsMenuContributor.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs similarity index 73% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsMenuContributor.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs index 6d61904b..788f6f70 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs @@ -1,12 +1,12 @@ using System.Collections.Generic; using System.Threading.Tasks; using EasyAbp.EShop.Products.Authorization; -using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Products.Localization; using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Products.Web +namespace EasyAbp.EShop.Products.Web.Menus { public class ProductsMenuContributor : IMenuContributor { @@ -22,19 +22,19 @@ namespace EasyAbp.EShop.Products.Web { var l = context.GetLocalizer(); //Add main menu items. - var productManagementMenuItem = new ApplicationMenuItem("EasyAbpEShopProducts", l["Menu:ProductManagement"]); + var productManagementMenuItem = new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"]); if (await context.IsGrantedAsync(ProductsPermissions.ProductTypes.Default)) { productManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopProductsProductType", l["Menu:ProductType"], "/EShop/Products/ProductTypes/ProductType") + new ApplicationMenuItem(ProductsMenus.ProductType, l["Menu:ProductType"], "/EShop/Products/ProductTypes/ProductType") ); } if (await context.IsGrantedAsync(ProductsPermissions.Categories.Default)) { productManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopProductsCategory", l["Menu:Category"], "/EShop/Products/Categories/Category") + new ApplicationMenuItem(ProductsMenus.Category, l["Menu:Category"], "/EShop/Products/Categories/Category") ); } @@ -45,14 +45,14 @@ namespace EasyAbp.EShop.Products.Web var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; productManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopProductsProduct", l["Menu:Product"], "/EShop/Products/Products/Product?storeId=" + defaultStore) + new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product?storeId=" + defaultStore) ); } if (!productManagementMenuItem.Items.IsNullOrEmpty()) { - var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop", - () => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"])); + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == ProductsMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(productManagementMenuItem); } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs new file mode 100644 index 00000000..ef679742 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs @@ -0,0 +1,19 @@ +namespace EasyAbp.EShop.Products.Web.Menus +{ + public class ProductsMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Products"; + + public const string ProductType = Prefix + ".ProductType"; + + public const string Category = Prefix + ".Category"; + + public const string Product = Prefix + ".Product"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/CreateModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/CreateModal.cshtml index 9f088ae1..1ba53691 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/CreateModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/CreateModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category.CreateModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/EditModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/EditModal.cshtml index 98c0340e..b8c1de1b 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/EditModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/EditModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category.EditModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml index 8fcb03da..a4321f3d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml @@ -1,13 +1,16 @@ @page +@using EasyAbp.EShop.Products.Localization +@using EasyAbp.EShop.Products.Web.Menus @using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@inject IHtmlLocalizer L @model IndexModel @inject IPageLayout PageLayout @{ PageLayout.Content.Title = L["Category"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Category"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopProductsCategory"; + PageLayout.Content.MenuItemName = ProductsMenus.Category; } @section scripts diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Index.cshtml index 28686454..008073bd 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.IndexModel @{ } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/CreateModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/CreateModal.cshtml index 0bdbef32..795c5b43 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/CreateModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/CreateModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType.CreateModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/EditModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/EditModal.cshtml index db87fb40..b0fc000c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/EditModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/EditModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType.EditModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml index 2dbde511..5f66c471 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml @@ -1,13 +1,16 @@ @page +@using EasyAbp.EShop.Products.Localization +@using EasyAbp.EShop.Products.Web.Menus @using EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage @model IndexModel @inject IPageLayout PageLayout +@inject IHtmlLocalizer L @{ PageLayout.Content.Title = L["ProductType"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:ProductType"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopProductsProductType"; + PageLayout.Content.MenuItemName = ProductsMenus.ProductType; } @section scripts diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml index ebb253a1..599dfc17 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.CreateModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml index 6207a5f0..5648dd09 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.EditModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml index a1eb7b53..291868d0 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml @@ -1,13 +1,16 @@ @page +@using EasyAbp.EShop.Products.Localization +@using EasyAbp.EShop.Products.Web.Menus @using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage @model IndexModel @inject IPageLayout PageLayout +@inject IHtmlLocalizer L @{ PageLayout.Content.Title = L["Product"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Product"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopProductsProduct"; + PageLayout.Content.MenuItemName = ProductsMenus.Product; } @section scripts diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/CreateModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/CreateModal.cshtml index 74c658b3..89b16a8f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/CreateModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/CreateModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku.CreateModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/EditModal.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/EditModal.cshtml index c16207a4..4527616d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/EditModal.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/EditModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage +@using EasyAbp.EShop.Products.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku.EditModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/Index.cshtml index fb508910..d08b4d73 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/Index.cshtml @@ -1,13 +1,16 @@ @page +@using EasyAbp.EShop.Products.Localization +@using EasyAbp.EShop.Products.Web.Menus @using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage @model IndexModel @inject IPageLayout PageLayout +@inject IHtmlLocalizer L @{ PageLayout.Content.Title = L["ProductSku"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:Product"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopProductsProduct"; + PageLayout.Content.MenuItemName = ProductsMenus.Product; } @section scripts diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/ProductsPage.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/ProductsPage.cs deleted file mode 100644 index b10fd820..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/ProductsPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Products.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Products.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Products.Web.Pages.ProductsPage - */ - public abstract class ProductsPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs similarity index 95% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissionDefinitionProvider.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs index f03a7cbd..77bdb864 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs @@ -3,7 +3,7 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; -namespace EasyAbp.EShop.Stores.Authorization +namespace EasyAbp.EShop.Stores.Permissions { public class StoresPermissionDefinitionProvider : PermissionDefinitionProvider { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs similarity index 92% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissions.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs index 1fce29e3..be383fde 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Authorization/StoresPermissions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs @@ -1,6 +1,6 @@ using Volo.Abp.Reflection; -namespace EasyAbp.EShop.Stores.Authorization +namespace EasyAbp.EShop.Stores.Permissions { public class StoresPermissions { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs index c3d1bb34..d40f0ad9 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Stores.Localization; +using EasyAbp.EShop.Stores.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresMenuContributor.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs similarity index 69% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresMenuContributor.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs index 7a1ecd65..fb91ec4c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresMenuContributor.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs @@ -1,13 +1,10 @@ using System.Collections.Generic; using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Authorization; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Localization; using EasyAbp.EShop.Stores.Localization; -using Microsoft.AspNetCore.Authorization; +using EasyAbp.EShop.Stores.Permissions; using Volo.Abp.UI.Navigation; -namespace EasyAbp.EShop.Stores.Web +namespace EasyAbp.EShop.Stores.Web.Menus { public class StoresMenuContributor : IMenuContributor { @@ -23,19 +20,19 @@ namespace EasyAbp.EShop.Stores.Web { var l = context.GetLocalizer(); //Add main menu items. - var storeManagementMenuItem = new ApplicationMenuItem("EasyAbpEShopStores", l["Menu:StoreManagement"]); + var storeManagementMenuItem = new ApplicationMenuItem(StoresMenus.Prefix, l["Menu:StoreManagement"]); if (await context.IsGrantedAsync(StoresPermissions.Stores.Default)) { storeManagementMenuItem.AddItem( - new ApplicationMenuItem("EasyAbpEShopStoresStore", l["Menu:Store"], "/EShop/Stores/Stores/Store") + new ApplicationMenuItem(StoresMenus.Store, l["Menu:Store"], "/EShop/Stores/Stores/Store") ); } if (!storeManagementMenuItem.Items.IsNullOrEmpty()) { - var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop", - () => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"])); + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == StoresMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(StoresMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(storeManagementMenuItem); } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs new file mode 100644 index 00000000..fc6bf9ec --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs @@ -0,0 +1,15 @@ +namespace EasyAbp.EShop.Stores.Web.Menus +{ + public class StoresMenus + { + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Stores"; + + public const string Store = Prefix + ".Store"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Index.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Index.cshtml index f0a17332..bacfa1b0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Index.cshtml +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Index.cshtml @@ -1,5 +1,4 @@ @page -@inherits EasyAbp.EShop.Stores.Web.Pages.StoresPage @model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.IndexModel @{ } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml index 1bf97e88..83f30e27 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Stores.Web.Pages.StoresPage +@using EasyAbp.EShop.Stores.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.CreateModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml index 9c6e7f40..172d6789 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml @@ -1,6 +1,8 @@ @page -@inherits EasyAbp.EShop.Stores.Web.Pages.StoresPage +@using EasyAbp.EShop.Stores.Localization +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L @model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.EditModalModel @{ Layout = null; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml index d37a9b1c..ffecf74d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml @@ -1,6 +1,20 @@ @page -@inherits EasyAbp.EShop.Stores.Web.Pages.StoresPage -@model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.IndexModel +@using EasyAbp.EShop.Stores.Permissions +@using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store +@using EasyAbp.EShop.Stores.Localization +@using EasyAbp.EShop.Stores.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["BasketItem"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:BasketItem"].Value); + PageLayout.Content.MenuItemName = StoresMenus.Store; +} @section scripts { @@ -14,14 +28,17 @@ - -

@L["Store"]

+ + @L["Store"] - + + @if (await Authorization.IsGrantedAsync(StoresPermissions.Stores.Create)) + { + }
diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/StoresPage.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/StoresPage.cs deleted file mode 100644 index f8b7800b..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/StoresPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Localization; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using EasyAbp.EShop.Stores.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Stores.Web.Pages -{ - /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): - * @inherits EasyAbp.EShop.Stores.Web.Pages.StoresPage - */ - public abstract class StoresPage : AbpPage - { - [RazorInject] - public IHtmlLocalizer L { get; set; } - } -} diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/EditModal.cshtml b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/EditModal.cshtml index 3d988706..bdccd845 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/EditModal.cshtml +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/EditModal.cshtml @@ -12,7 +12,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/Index.cshtml b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/Index.cshtml index 4e72482c..80eefcc4 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/Index.cshtml +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/Index.cshtml @@ -2,6 +2,7 @@ @using EasyAbp.EShop.Plugins.Baskets.Permissions @using EasyAbp.EShop.Plugins.Baskets.Web.Pages.EShop.Plugins.Baskets.BasketItems.BasketItem @using EasyAbp.EShop.Plugins.Baskets.Localization +@using EasyAbp.EShop.Plugins.Baskets.Web.Menus @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout @@ -12,7 +13,7 @@ @{ PageLayout.Content.Title = L["BasketItem"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:BasketItem"].Value); - PageLayout.Content.MenuItemName = "EasyAbpEShopBasketsBasketItem"; + PageLayout.Content.MenuItemName = BasketsMenus.BasketItem; } @section scripts