mirror of https://github.com/abpframework/abp.git
5 changed files with 32 additions and 71 deletions
@ -1,31 +0,0 @@ |
|||||
@model Volo.CmsKit.Public.Blogs.BlogPostPublicDto |
|
||||
@using Volo.CmsKit.Localization |
|
||||
@using Microsoft.Extensions.Localization |
|
||||
|
|
||||
@inject IStringLocalizer<CmsKitResource> L |
|
||||
|
|
||||
@{ |
|
||||
string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.Title; |
|
||||
} |
|
||||
|
|
||||
<abp-card> |
|
||||
<img src="/api/cms-kit/media/@Model.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.Title</h1> |
|
||||
<p class="mb-lg-5 mb-md-3"> |
|
||||
<span class="font-weight-bold">@@@Model.Author?.UserName</span> |
|
||||
<small style="opacity:.65;">@Model.CreationTime</small> |
|
||||
</p> |
|
||||
@Html.Raw(Model.Content) |
|
||||
<p> |
|
||||
@if (Model.LastModificationTime != null) |
|
||||
{ |
|
||||
<small style="opacity:.65;">@L["LastModification"].Value : @Model.LastModificationTime</small> |
|
||||
} |
|
||||
</p> |
|
||||
</div> |
|
||||
</abp-row> |
|
||||
</abp-card-body> |
|
||||
</abp-card> |
|
||||
@ -1,33 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|
||||
using Volo.CmsKit.Public.Blogs; |
|
||||
|
|
||||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Blogs.BlogPost |
|
||||
{ |
|
||||
[Widget(StyleFiles = new[] |
|
||||
{ |
|
||||
"/Pages/CmsKit/Shared/Components/Blogs/BlogPost/default.css" |
|
||||
})] |
|
||||
public class DefaultBlogPostViewComponent : AbpViewComponent |
|
||||
{ |
|
||||
protected IBlogPostPublicAppService BlogPostPublicAppService { get; } |
|
||||
|
|
||||
public DefaultBlogPostViewComponent(IBlogPostPublicAppService blogPostPublicAppService) |
|
||||
{ |
|
||||
BlogPostPublicAppService = blogPostPublicAppService; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<IViewComponentResult> InvokeAsync(string blogSlug, string blogPostSlug) |
|
||||
{ |
|
||||
var blogPost = await BlogPostPublicAppService.GetAsync(blogSlug, blogPostSlug); |
|
||||
|
|
||||
return View("~/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml", blogPost); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue