|
|
|
@ -9,9 +9,9 @@ |
|
|
|
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection |
|
|
|
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating |
|
|
|
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags |
|
|
|
@using Volo.CmsKit.Public.Web.Renderers |
|
|
|
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs |
|
|
|
@using Volo.CmsKit.Contents |
|
|
|
@using Volo.CmsKit.Web.Renderers |
|
|
|
|
|
|
|
@inherits CmsKitPublicPageBase |
|
|
|
|
|
|
|
@ -32,13 +32,14 @@ |
|
|
|
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.css" /> |
|
|
|
</abp-abp-style-bundle> |
|
|
|
} |
|
|
|
|
|
|
|
<abp-abp-style-bundle> |
|
|
|
<abp-style src="/Pages/Public/CmsKit/Blogs/blogPost.css" /> |
|
|
|
<abp-style type="typeof(HighlightJsStyleContributor)" /> |
|
|
|
</abp-abp-style-bundle> |
|
|
|
} |
|
|
|
|
|
|
|
@section scripts{ |
|
|
|
@section scripts{ |
|
|
|
@if (isScrollIndexEnabled) |
|
|
|
{ |
|
|
|
<abp-script-bundle> |
|
|
|
@ -54,49 +55,39 @@ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")> |
|
|
|
<abp-card class="mb-4"> |
|
|
|
<img src="/api/cms-kit/media/@Model.BlogPost.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" /> |
|
|
|
<abp-card-body> |
|
|
|
<abp-row> |
|
|
|
<div class="col-lg-8 col-md-10 mx-auto pb-4"> |
|
|
|
<h1 class="mt-lg-4 mt-md-3">@Model.BlogPost.Title</h1> |
|
|
|
<p class="mb-lg-5 mb-md-3"> |
|
|
|
<a href="/blogs/@Model.BlogSlug?authorId=@Model.BlogPost.Author.Id"> |
|
|
|
<span class="font-weight-bold">@@@Model.BlogPost.Author?.UserName</span> |
|
|
|
</a> |
|
|
|
<small style="opacity:.65;">@Model.BlogPost.CreationTime</small> |
|
|
|
</p> |
|
|
|
@foreach (var contentFragment in Model.BlogPost.ContentFragments) |
|
|
|
<div class="row"> |
|
|
|
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")> |
|
|
|
<abp-card class="mb-4"> |
|
|
|
<img src="/api/cms-kit/media/@Model.BlogPost.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" /> |
|
|
|
<abp-card-body> |
|
|
|
<abp-row> |
|
|
|
<div class="col-lg-8 col-md-10 mx-auto pb-4"> |
|
|
|
<h1 class="mt-lg-4 mt-md-3">@Model.BlogPost.Title</h1> |
|
|
|
<p class="mb-lg-5 mb-md-3"> |
|
|
|
<a href="/blogs/@Model.BlogSlug?authorId=@Model.BlogPost.Author.Id"> |
|
|
|
<span class="font-weight-bold">@@@Model.BlogPost.Author?.UserName</span> |
|
|
|
</a> |
|
|
|
<small style="opacity:.65;">@Model.BlogPost.CreationTime</small> |
|
|
|
</p> |
|
|
|
@await Component.InvokeAsync("ContentFragment", new { contentDto = Model.BlogPost }) |
|
|
|
<p class="mb-3"> |
|
|
|
@if (Model.BlogPost.LastModificationTime != null) |
|
|
|
{ |
|
|
|
if (contentFragment.Type == ContentConsts.Markdown) |
|
|
|
{ |
|
|
|
@Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty<string>("Content"))) |
|
|
|
} |
|
|
|
else if (contentFragment.Type == ContentConsts.Widget) |
|
|
|
{ |
|
|
|
@await Component.InvokeAsync(contentFragment.GetProperty<string>("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject()) |
|
|
|
} |
|
|
|
<small style="opacity:.65;">@L["LastModification"].Value : @Model.BlogPost.LastModificationTime</small> |
|
|
|
} |
|
|
|
<p class="mb-3"> |
|
|
|
@if (Model.BlogPost.LastModificationTime != null) |
|
|
|
{ |
|
|
|
<small style="opacity:.65;">@L["LastModification"].Value : @Model.BlogPost.LastModificationTime</small> |
|
|
|
} |
|
|
|
</p> |
|
|
|
<hr /> |
|
|
|
</p> |
|
|
|
<hr /> |
|
|
|
|
|
|
|
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>()) |
|
|
|
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>()) |
|
|
|
{ |
|
|
|
if (Model.TagsFeature?.IsEnabled == true) |
|
|
|
{ |
|
|
|
if (Model.TagsFeature?.IsEnabled == true) |
|
|
|
@await Component.InvokeAsync(typeof(TagViewComponent), new |
|
|
|
{ |
|
|
|
@await Component.InvokeAsync(typeof(TagViewComponent), new |
|
|
|
{ |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString(), |
|
|
|
urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}" |
|
|
|
}) |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString(), |
|
|
|
urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}" |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</div> |
|
|
|
@ -109,10 +100,10 @@ |
|
|
|
if (Model.ReactionsFeature?.IsEnabled == true) |
|
|
|
{ |
|
|
|
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new |
|
|
|
{ |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString() |
|
|
|
}) |
|
|
|
{ |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</abp-column> |
|
|
|
@ -122,10 +113,10 @@ |
|
|
|
if (Model.RatingsFeature?.IsEnabled == true) |
|
|
|
{ |
|
|
|
@await Component.InvokeAsync(typeof(RatingViewComponent), new |
|
|
|
{ |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString() |
|
|
|
}) |
|
|
|
{ |
|
|
|
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, |
|
|
|
entityId = Model.BlogPost.Id.ToString() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</abp-column> |
|
|
|
@ -133,6 +124,7 @@ |
|
|
|
</abp-card-body> |
|
|
|
</abp-card> |
|
|
|
</div> |
|
|
|
|
|
|
|
@if (isScrollIndexEnabled) |
|
|
|
{ |
|
|
|
<div class="col-md-2 d-sm-none d-md-block"> |
|
|
|
@ -140,7 +132,7 @@ |
|
|
|
<h5>@L["InThisDocument"]</h5> |
|
|
|
<nav id="blog-post-sticky-index" class="navbar index-scroll pt-0"> |
|
|
|
</nav> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="col p-0 py-3"> |
|
|
|
<a href="#" class="scroll-top-btn"> |
|
|
|
|