From 0f8bfac57332941fc14b7c14e898b2ef21e17d00 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 28 Nov 2018 18:19:29 +0300 Subject: [PATCH] Created IPageLayout --- .../Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs | 14 ++++++++++++++ .../Abp/AspNetCore/Mvc/UI/Layout/BreadCrumbItem.cs | 11 +++++++++++ .../Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs | 14 ++++++++++++++ .../Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs | 7 +++++++ .../Abp/AspNetCore/Mvc/UI/Layout/PageLayout.cs | 14 ++++++++++++++ .../Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs | 8 ++++++-- 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumbItem.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/PageLayout.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs new file mode 100644 index 0000000000..07827ef60f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +{ + public class BreadCrumb + { + public List Items { get; } + + public BreadCrumb() + { + Items = new List(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumbItem.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumbItem.cs new file mode 100644 index 0000000000..0fd76bf79c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumbItem.cs @@ -0,0 +1,11 @@ +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +{ + public class BreadCrumbItem + { + public string Text { get; set; } + + public string Icon { get; set; } + + public string Url { get; set; } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs new file mode 100644 index 0000000000..2d71850842 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs @@ -0,0 +1,14 @@ +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +{ + public class ContentLayout + { + public string Title { get; set; } + + public BreadCrumb BreadCrumb { get; } + + public ContentLayout() + { + BreadCrumb = new BreadCrumb(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs new file mode 100644 index 0000000000..4e42019001 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +{ + public interface IPageLayout + { + ContentLayout Content { get; } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/PageLayout.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/PageLayout.cs new file mode 100644 index 0000000000..68f94598c9 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/PageLayout.cs @@ -0,0 +1,14 @@ +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +{ + public class PageLayout : IPageLayout, IScopedDependency + { + public ContentLayout Content { get; } + + public PageLayout() + { + Content = new ContentLayout(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs index aa4003c5f0..de19f6db7b 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs @@ -85,7 +85,6 @@ namespace Volo.Abp.UI.Navigation /// public string CssClass { get; set; } - public ApplicationMenuItem( [NotNull] string name, [NotNull] string displayName, @@ -107,7 +106,7 @@ namespace Volo.Abp.UI.Navigation Order = order; CustomData = customData; Target = target; - ElementId = elementId; + ElementId = elementId ?? GetDefaultElementId(); CssClass = cssClass; Items = new List(); @@ -123,5 +122,10 @@ namespace Volo.Abp.UI.Navigation Items.Add(menuItem); return this; } + + private string GetDefaultElementId() + { + return "MenuItem_" + Name; + } } } \ No newline at end of file