Browse Source

Use the LeptonX Lite theme in the sample app.

pull/168/head
gdlcf88 4 years ago
parent
commit
ce25d2ebab
  1. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenuContributor.cs
  2. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenuContributor.cs
  3. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs
  4. 2
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs
  5. 2
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Menus/BasketsMenuContributor.cs
  6. 2
      plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Menus/CouponsMenuContributor.cs
  7. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj
  8. 33
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs
  9. 1
      samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/global-styles.css
  10. 10
      samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/libs/abp/jquery/abp.jquery.js
  11. 5
      samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/libs/bootstrap/js/bootstrap.enable.popovers.everywhere.js

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Menus/OrdersMenuContributor.cs

@ -38,7 +38,7 @@ namespace EasyAbp.EShop.Orders.Web.Menus
if (!orderManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == OrdersMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(OrdersMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(OrdersMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(orderManagementMenuItem);
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Menus/PaymentsMenuContributor.cs

@ -44,7 +44,7 @@ namespace EasyAbp.EShop.Payments.Web.Menus
if (!paymentManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == PaymentsMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(PaymentsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(PaymentsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(paymentManagementMenuItem);
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs

@ -41,7 +41,7 @@ namespace EasyAbp.EShop.Products.Web.Menus
if (!productManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == ProductsMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(productManagementMenuItem);
}

2
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs

@ -51,7 +51,7 @@ namespace EasyAbp.EShop.Stores.Web.Menus
if (!storeManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == StoresMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(StoresMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(StoresMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(storeManagementMenuItem);
}

2
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/Menus/BasketsMenuContributor.cs

@ -28,7 +28,7 @@ namespace EasyAbp.EShop.Plugins.Baskets.Web.Menus
if (!basketManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == BasketsMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(BasketsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(BasketsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(basketManagementMenuItem);
}

2
plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Menus/CouponsMenuContributor.cs

@ -39,7 +39,7 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Menus
if (!couponManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == CouponsMenus.ModuleGroupPrefix,
() => new ApplicationMenuItem(CouponsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"]));
() => new ApplicationMenuItem(CouponsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag"));
eShopMenuItem.Items.Add(couponManagementMenuItem);
}

2
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj

@ -47,7 +47,7 @@
<PackageReference Include="EasyAbp.PaymentService.Web" Version="$(EasyAbpPaymentServiceModuleVersion)" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="$(EasyAbpPaymentServiceModuleVersion)" />
<PackageReference Include="EasyAbp.PaymentService.Prepayment.Web" Version="$(EasyAbpPaymentServiceModuleVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="$(AbpVersion)" />

33
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs

@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using EasyAbp.EShop;
using EasyAbp.EShop.Plugins;
using EasyAbp.EShop.Plugins.Web;
@ -30,13 +29,14 @@ using EShopSample.Localization;
using EShopSample.MultiTenancy;
using EShopSample.Web.Menus;
using Microsoft.OpenApi.Models;
using NUglify.JavaScript.Syntax;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
@ -61,7 +61,7 @@ namespace EShopSample.Web
typeof(AbpAutofacModule),
typeof(AbpIdentityWebModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpTenantManagementWebModule),
typeof(AbpFeatureManagementWebModule),
@ -98,21 +98,23 @@ namespace EShopSample.Web
var configuration = context.Services.GetConfiguration();
ConfigureUrls(configuration);
ConfigureAuthentication(context, configuration);
ConfigureBundles();
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
ConfigureLocalizationServices();
ConfigureNavigationServices();
ConfigureAutoApiControllers();
ConfigureSwaggerServices(context.Services);
ConfigureConventionalControllers();
}
private void ConfigureConventionalControllers()
private void ConfigureBundles()
{
Configure<AbpAspNetCoreMvcOptions>(options =>
Configure<AbpBundlingOptions>(options =>
{
options.ConventionalControllers.Create(typeof(EShopSampleApplicationModule).Assembly);
options.StyleBundles.Configure(
LeptonXLiteThemeBundles.Styles.Global,
bundle => { bundle.AddFiles("/global-styles.css"); }
);
});
}
@ -124,17 +126,6 @@ namespace EShopSample.Web
});
}
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication()
.AddJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.Audience = "EShopSample";
});
}
private void ConfigureAutoMapper()
{
Configure<AbpAutoMapperOptions>(options =>

1
samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/global-styles.css

@ -0,0 +1 @@
/* Your Global Styles */

10
samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/libs/abp/jquery/abp.jquery.js

@ -205,14 +205,16 @@ var abp = abp || {};
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
var messagePromise = null;
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText);
if (userOptions.abpHandleError !== false) {
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
messagePromise = abp.ajax.showError(responseJSON.error);
}
abp.ajax.logError(jqXHR.responseJSON.error);
abp.ajax.logError(responseJSON.error);
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
$dfd && $dfd.reject(responseJSON.error, jqXHR);
userOptions.error && userOptions.error(responseJSON.error, jqXHR);
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
abp.ajax.handleUnAuthorizedRequest(messagePromise);

5
samples/EShopSample/aspnet-core/src/EShopSample.Web/wwwroot/libs/bootstrap/js/bootstrap.enable.popovers.everywhere.js

@ -0,0 +1,5 @@
(function () {
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
})();
Loading…
Cancel
Save