diff --git a/docs/en/UI/Angular/Theming.md b/docs/en/UI/Angular/Theming.md index c7f303763d..435acc6930 100644 --- a/docs/en/UI/Angular/Theming.md +++ b/docs/en/UI/Angular/Theming.md @@ -16,10 +16,11 @@ In order to accomplish these goals, ABP Framework; ### Current Themes -Currently, two themes are **officially provided**: +Currently, three themes are **officially provided**: * The [Basic Theme](Basic-Theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**. * The [Lepton Theme](https://commercial.abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP Commercial](https://commercial.abp.io/) license. +* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](https://docs.abp.io/en/commercial/latest/themes/lepton-x/commercial/angular) and [lite](../../Themes/LeptonXLite/Angular.md) choices. ## Overall diff --git a/docs/en/UI/AspNetCore/Overall.md b/docs/en/UI/AspNetCore/Overall.md index 8cd9dd3f5e..bc24c56fb8 100644 --- a/docs/en/UI/AspNetCore/Overall.md +++ b/docs/en/UI/AspNetCore/Overall.md @@ -32,10 +32,11 @@ ABP Framework provides a complete [Theming](Theming.md) system with the followin ### Current Themes -Currently, two themes are **officially provided**: +Currently, three themes are **officially provided**: * The [Basic Theme](Basic-Theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**. * The [Lepton Theme](https://commercial.abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP Commercial](https://commercial.abp.io/) license. +* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](https://docs.abp.io/en/commercial/latest/themes/lepton-x/commercial/mvc) and [lite](../../Themes/LeptonXLite/AspNetCore.md) choices. There are also some community-driven themes for the ABP Framework (you can search on the web). diff --git a/docs/en/UI/AspNetCore/Page-Header.md b/docs/en/UI/AspNetCore/Page-Header.md index f6ec3074de..8b045c89ab 100644 --- a/docs/en/UI/AspNetCore/Page-Header.md +++ b/docs/en/UI/AspNetCore/Page-Header.md @@ -23,6 +23,8 @@ Page Title can be set as shown in the example below: ### Breadcrumb > **The [Basic Theme](Basic-Theme.md) currently doesn't implement the breadcrumbs.** +> +> The [LeptonX Lite Theme](../../Themes/LeptonXLite/AspNetCore.md) supports breadcrumbs. Breadcrumb items can be added to the `PageLayout.Content.BreadCrumb`. @@ -48,11 +50,13 @@ Any item that you add is inserted between Home and Current Page items. You can a ### The Selected Menu Item > **The [Basic Theme](Basic-Theme.md) currently doesn't implement the selected menu item since it is not applicable to the top menu which is the only option for the Basic Theme for now.** +> +> The [LeptonX Lite Theme](../../Themes/LeptonXLite/AspNetCore.md) supports selected menu item. You can set the Menu Item name related to this page: -````csharp +```csharp PageLayout.Content.MenuItemName = "BookStore.Books"; -```` +``` Menu item name should match a unique menu item name defined using the [Navigation / Menu](Navigation-Menu.md) system. In this case, it is expected from the theme to make the menu item "active" in the main menu. \ No newline at end of file diff --git a/docs/en/UI/AspNetCore/Toolbars.md b/docs/en/UI/AspNetCore/Toolbars.md index d82150b47e..975157151f 100644 --- a/docs/en/UI/AspNetCore/Toolbars.md +++ b/docs/en/UI/AspNetCore/Toolbars.md @@ -8,6 +8,12 @@ There is only one **standard toolbar** named "Main" (defined as a constant: `Sta In the screenshot above, there are two items added to the main toolbar: Language switch component & user menu. You can add your own items here. +Also, [LeptonX Lite Theme](../../Themes/LeptonXLite/AspNetCore.md) has 2 different toolbars for desktop and mobile views which defined as constants: `LeptonXLiteToolbars.Main`, `LeptonXLiteToolbars.MainMobile`. + +| LeptonXLiteToolbars.Main | LeptonXLiteToolbars.MainMobile | +| :---: | :---: | +| ![leptonx](../../images/leptonxlite-toolbar-main-example.png) | ![leptonx](../../images/leptonxlite-toolbar-mainmobile-example.png) | + ## Example: Add a Notification Icon In this example, we will add a **notification (bell) icon** to the left of the language switch item. A item in the toolbar should be a **view component**. So, first, create a new view component in your project: diff --git a/docs/en/UI/Blazor/Overall.md b/docs/en/UI/Blazor/Overall.md index ff361d6784..402d61acb0 100644 --- a/docs/en/UI/Blazor/Overall.md +++ b/docs/en/UI/Blazor/Overall.md @@ -75,10 +75,11 @@ ABP Framework provides a complete [Theming](Theming.md) system with the followin ### Current Themes -Currently, two themes are **officially provided**: +Currently, three themes are **officially provided**: * The [Basic Theme](Basic-Theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**. * The [Lepton Theme](https://commercial.abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP Commercial](https://commercial.abp.io/) license. +* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](https://docs.abp.io/en/commercial/latest/themes/lepton-x/commercial/blazor) and [lite](../../Themes/LeptonXLite/Blazor.md) choices. ### Base Libraries diff --git a/docs/en/UI/Blazor/Page-Header.md b/docs/en/UI/Blazor/Page-Header.md index 29cb006bd3..1bdc9c93c0 100644 --- a/docs/en/UI/Blazor/Page-Header.md +++ b/docs/en/UI/Blazor/Page-Header.md @@ -16,6 +16,8 @@ Once you add the `PageHeader` component to your page, you can control the relate ## Breadcrumb > **The [Basic Theme](Basic-Theme.md) currently doesn't implement the breadcrumbs.** +> +> The [LeptonX Lite Theme](../../Themes/LeptonXLite/Blazor.md) supports breadcrumbs. Breadcrumbs can be added using the `BreadcrumbItems` property. diff --git a/docs/en/UI/Blazor/Page-Layout.md b/docs/en/UI/Blazor/Page-Layout.md index 49ed1659f4..c6f3d62000 100644 --- a/docs/en/UI/Blazor/Page-Layout.md +++ b/docs/en/UI/Blazor/Page-Layout.md @@ -42,6 +42,10 @@ Menu item name can be set on runtime too. } ``` + +![leptonx selected menu item](../../images/leptonx-selected-menu-item-example.gif) + + > Be aware, The [Basic Theme](../Blazor/Basic-Theme.md) currently doesn't support the selected menu item since it is not applicable to the top menu. ## BreadCrumbs diff --git a/docs/en/UI/Blazor/Toolbars.md b/docs/en/UI/Blazor/Toolbars.md index 3ff1b7f135..c0878f080a 100644 --- a/docs/en/UI/Blazor/Toolbars.md +++ b/docs/en/UI/Blazor/Toolbars.md @@ -8,6 +8,12 @@ There is only one **standard toolbar** named "Main" (defined as a constant: `Sta In the screenshot above, there are two items added to the main toolbar: Language switch component & user menu. You can add your own items here. +Also, [LeptonX Lite Theme](../../Themes/LeptonXLite/Blazor.md) has 2 different toolbars for desktop and mobile views which defined as constants: `LeptonXLiteToolbars.Main`, `LeptonXLiteToolbars.MainMobile`. + +| LeptonXLiteToolbars.Main | LeptonXLiteToolbars.MainMobile | +| :---: | :---: | +| ![leptonx](../../images/leptonxlite-toolbar-main-example.png) | ![leptonx](../../images/leptonxlite-toolbar-mainmobile-example.png) | + ## Example: Add a Notification Icon In this example, we will add a **notification (bell) icon** to the left of the language switch item. A item in the toolbar should be a **Razor Component**. So, first, create a new razor component in your project (the location of the component doesn't matter): diff --git a/docs/en/images/breadcrumbs-example.png b/docs/en/images/breadcrumbs-example.png index 17ae5f8ba5..8b4bbc62d7 100644 Binary files a/docs/en/images/breadcrumbs-example.png and b/docs/en/images/breadcrumbs-example.png differ diff --git a/docs/en/images/leptonx-selected-menu-item-example.gif b/docs/en/images/leptonx-selected-menu-item-example.gif new file mode 100644 index 0000000000..8f1170cd55 Binary files /dev/null and b/docs/en/images/leptonx-selected-menu-item-example.gif differ diff --git a/docs/en/images/leptonxlite-toolbar-main-example.png b/docs/en/images/leptonxlite-toolbar-main-example.png new file mode 100644 index 0000000000..30edcf547b Binary files /dev/null and b/docs/en/images/leptonxlite-toolbar-main-example.png differ diff --git a/docs/en/images/leptonxlite-toolbar-mainmobile-example.png b/docs/en/images/leptonxlite-toolbar-mainmobile-example.png new file mode 100644 index 0000000000..95815b5843 Binary files /dev/null and b/docs/en/images/leptonxlite-toolbar-mainmobile-example.png differ diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalResources/GlobalResourceConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalResources/GlobalResourceConsts.cs index 47f20e1d72..7787d0c69d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalResources/GlobalResourceConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalResources/GlobalResourceConsts.cs @@ -1,6 +1,6 @@ namespace Volo.CmsKit.GlobalResources; -public class GlobalResourceConsts +public static class GlobalResourceConsts { public const string GlobalStyleName = "GlobalStyle"; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/GlobalResources/GlobalResourceDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/GlobalResources/GlobalResourceDto.cs index 16e0575288..5d1ba87fe0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/GlobalResources/GlobalResourceDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/GlobalResources/GlobalResourceDto.cs @@ -1,8 +1,12 @@ -namespace Volo.CmsKit.Public.GlobalResources; +using System; +using Volo.Abp.Application.Dtos; -public class GlobalResourceDto +namespace Volo.CmsKit.Public.GlobalResources; + +[Serializable] +public class GlobalResourceDto : AuditedEntityDto { public string Name { get; set; } - + public string Value { get; set; } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/Handlers/GlobalResourceEventHandler.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/Handlers/GlobalResourceEventHandler.cs index 1e9503006c..d16e271e4e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/Handlers/GlobalResourceEventHandler.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/Handlers/GlobalResourceEventHandler.cs @@ -5,11 +5,10 @@ using Volo.Abp.Domain.Entities.Events; using Volo.Abp.EventBus; using Volo.Abp.ObjectMapping; using Volo.CmsKit.GlobalResources; -using Volo.CmsKit.Public.GlobalResources; namespace Volo.CmsKit.Public.GlobalResources.Handlers; -public class GlobalResourceEventHandler: +public class GlobalResourceEventHandler : ILocalEventHandler>, ITransientDependency { @@ -23,11 +22,11 @@ public class GlobalResourceEventHandler: ObjectMapper = objectMapper; _resourceCache = resourceCache; } - + public async Task HandleEventAsync(EntityUpdatedEventData eventData) { await _resourceCache.SetAsync( - eventData.Entity.Name, + eventData.Entity.Name, ObjectMapper.Map(eventData.Entity)); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml index 11929dec03..fdcfb382bb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml @@ -1 +1,3 @@ - +@model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style.GlobalStyleModel + + \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleModel.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleModel.cs new file mode 100644 index 0000000000..869f768987 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleModel.cs @@ -0,0 +1,6 @@ +namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style; + +public class GlobalStyleModel +{ + public long LastModificationTimeTimestamp { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleViewComponent.cs index 3d9bc010c4..49062bdb06 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/GlobalResources/Style/GlobalStyleViewComponent.cs @@ -1,13 +1,33 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; +using Volo.CmsKit.Public.GlobalResources; namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style; public class GlobalStyleViewComponent : AbpViewComponent { + protected IGlobalResourcePublicAppService GlobalResourcePublicAppService { get; } + + public GlobalStyleViewComponent(IGlobalResourcePublicAppService globalResourcePublicAppService) + { + GlobalResourcePublicAppService = globalResourcePublicAppService; + } + + [BindProperty(SupportsGet = true)] + public DateTime? LastModificationTime { get; set; } + public async Task InvokeAsync() { - return View("~/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml"); + var lastModificationTime = (await GlobalResourcePublicAppService.GetGlobalStyleAsync())?.LastModificationTime; + var lastModificationTimeTimestamp = (long)(lastModificationTime.HasValue ? lastModificationTime.Value.Subtract(DateTime.UnixEpoch).TotalSeconds : 0); + + return View("~/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml", + new GlobalStyleModel() + { + LastModificationTimeTimestamp = lastModificationTimeTimestamp + }); } + } \ No newline at end of file