Browse Source

cmskit comments: improved demo with public page

pull/4961/head
Yunus Emre Kalkan 6 years ago
parent
commit
3c5001c8f4
  1. 5
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs
  2. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml
  3. 36
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Public.cshtml
  4. 11
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Public.cshtml.cs
  5. 10
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj

5
modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs

@ -112,6 +112,11 @@ namespace Volo.CmsKit
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
Configure<CmsKitOptions>(options =>
{
options.PublicCommentEntities.Add("publicQuote");
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

2
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml

@ -8,8 +8,6 @@
@inject IStringLocalizer<AbpUiResource> Localizer
<h1>CMS Kit DEMO</h1>
<h2>Reactions</h2>
<abp-card class="mb-3">
<abp-card-body>
<abp-blockquote>

36
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Public.cshtml

@ -0,0 +1,36 @@
@page
@using Localization.Resources.AbpUi
@using Microsoft.Extensions.Localization
@using Volo.CmsKit.Pages
@using Volo.CmsKit.Web.Pages.CmsKit.Shared.Components.Commenting
@model PublicModel
@inject IStringLocalizer<AbpUiResource> Localizer
<h1>CMS Kit DEMO - Public</h1>
<abp-card class="mb-3">
<abp-card-body>
<abp-blockquote>
<p>
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
</p>
<footer>
Martin Fowler
</footer>
</abp-blockquote>
</abp-card-body>
@await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "publicQuote", entityId = "1", loginUrl="Account/Login?ReturnUrl=%2Fpublic" })
</abp-card>
<abp-card class="mb-3">
<abp-card-body>
<abp-blockquote>
<p>
Writing code is very simple, but writing simple code is the hardest thing there is!
</p>
<footer>
Halil ibrahim Kalkan <small>(inspired from Johan Cruyff)</small>
</footer>
</abp-blockquote>
</abp-card-body>
@await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "publicQuote", entityId = "2", loginUrl="Account/Login?ReturnUrl=%2Fpublic" })
</abp-card>

11
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Public.cshtml.cs

@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.CmsKit.Pages
{
public class PublicModel : PageModel
{
public void OnGet()
{
}
}
}

10
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj

@ -47,6 +47,16 @@
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
<Content Update="Pages\Public.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Compile Update="Pages\Public.cshtml.cs">
<DependentUpon>public.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\Public.cshtml.cs">
<DependentUpon>Public.cshtml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save