mirror of https://github.com/abpframework/abp.git
10 changed files with 124 additions and 24 deletions
@ -0,0 +1,8 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class CmsKitContentWidgetOptions |
||||
|
{ |
||||
|
public Dictionary<string, ContentWidgetConfig> WidgetConfigs { get; } = new(); |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public abstract class ContentFragment |
||||
|
{ |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class ContentParser : IContentParser, ITransientDependency |
||||
|
{ |
||||
|
public async Task<List<ContentFragment>> ParseAsync(string content) |
||||
|
{ |
||||
|
return new List<ContentFragment> { |
||||
|
new MarkdownContentFragment { |
||||
|
Content = "**ABP Framework** is completely open source and developed in a community-driven manner." |
||||
|
}, |
||||
|
new WidgetContentFragment("CmsPoll") { Properties = { { "widgetName", "poll-right" } } }, |
||||
|
new MarkdownContentFragment { |
||||
|
Content = "Thanks _for_ *your* feedback." |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class ContentWidgetConfig |
||||
|
{ |
||||
|
public string Name { get; } |
||||
|
public Type ViewComponentType { get; set; } |
||||
|
|
||||
|
public ContentWidgetConfig(string name) |
||||
|
{ |
||||
|
Name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public interface IContentParser |
||||
|
{ |
||||
|
Task<List<ContentFragment>> ParseAsync(string content); |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class MarkdownContentFragment : ContentFragment |
||||
|
{ |
||||
|
public string Content { get; set; } |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class PageViewModel |
||||
|
{ |
||||
|
public Guid Id { get; set; } |
||||
|
|
||||
|
public string Title { get; set; } |
||||
|
|
||||
|
public List<ContentFragment> ContentFragments { get; set; } |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages; |
||||
|
|
||||
|
public class WidgetContentFragment : ContentFragment |
||||
|
{ |
||||
|
public string Name { get; } |
||||
|
|
||||
|
public string ViewComponentName { get; set; } |
||||
|
|
||||
|
public Dictionary<string, string> Properties { get; } |
||||
|
|
||||
|
public WidgetContentFragment(string name) |
||||
|
{ |
||||
|
Name = name; |
||||
|
Properties = new Dictionary<string, string>(); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue