Browse Source

Merge pull request #168 from EasyAbp/use-leptonx-lite

Use the LeptonX Lite theme in the sample app.
pull/169/head
Super 4 years ago
committed by GitHub
parent
commit
3e10a7ac05
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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. 37
      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)" />

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

@ -30,13 +30,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 +62,7 @@ namespace EShopSample.Web
typeof(AbpAutofacModule),
typeof(AbpIdentityWebModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpTenantManagementWebModule),
typeof(AbpFeatureManagementWebModule),
@ -98,6 +99,7 @@ namespace EShopSample.Web
var configuration = context.Services.GetConfiguration();
ConfigureUrls(configuration);
ConfigureBundles();
ConfigureAuthentication(context, configuration);
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
@ -105,22 +107,16 @@ namespace EShopSample.Web
ConfigureNavigationServices();
ConfigureAutoApiControllers();
ConfigureSwaggerServices(context.Services);
ConfigureConventionalControllers();
}
private void ConfigureConventionalControllers()
private void ConfigureBundles()
{
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(EShopSampleApplicationModule).Assembly);
});
}
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
Configure<AbpBundlingOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.StyleBundles.Configure(
LeptonXLiteThemeBundles.Styles.Global,
bundle => { bundle.AddFiles("/global-styles.css"); }
);
});
}
@ -130,11 +126,19 @@ namespace EShopSample.Web
.AddJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.Audience = "EShopSample";
});
}
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
});
}
private void ConfigureAutoMapper()
{
Configure<AbpAutoMapperOptions>(options =>
@ -272,7 +276,6 @@ namespace EShopSample.Web
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsEnabled)
{

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