From 4f3e6bbb1618c0325a7ae9f2647504683784625a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 19 Sep 2018 13:17:51 +0300 Subject: [PATCH] Blogging module: more fixes --- .../Volo/Blogging/Posts/PostAppService.cs | 5 +++++ .../Pages/Blog/Posts/Detail.cshtml | 10 +++++----- .../Pages/Blog/Posts/Index.cshtml | 19 +++++++++++++------ .../Pages/Blog/Posts/Index.cshtml.cs | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index 56a6bf3682..48bbd7e65e 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -53,6 +53,11 @@ namespace Volo.Blogging.Posts postDto.CommentCount = await _commentRepository.GetCommentCountOfPostAsync(postDto.Id); } + foreach (var postDto in postDtos) + { + postDto.Tags = await GetTagsOfPost(postDto.Id); + } + foreach (var postDto in postDtos) { if (postDto.CreatorId.HasValue) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml index 38d8fb93f7..9940485aa6 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml @@ -41,35 +41,35 @@ @if (!string.IsNullOrWhiteSpace(Model.Blog.Facebook)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Twitter)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Instagram)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Github)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.StackOverflow)) { | - + } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml index 70a5250dca..eee2ff4498 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml @@ -31,7 +31,14 @@

@Model.Blog.Name - @L["BLOG"] + @if (string.IsNullOrWhiteSpace(Model.TagName)) + { + @L["BLOG"] + } + else + { + @Html.Raw("#")@Model.TagName + }

@@ -44,35 +51,35 @@ @if (!string.IsNullOrWhiteSpace(Model.Blog.Facebook)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Twitter)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Instagram)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.Github)) { | - + } @if (!string.IsNullOrWhiteSpace(Model.Blog.StackOverflow)) { | - + } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs index f2f66c4082..256f13e852 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs @@ -40,7 +40,7 @@ namespace Volo.Blogging.Pages.Blog.Posts { Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); Posts = (await _postAppService.GetListByBlogIdAndTagName(Blog.Id, TagName)).Items; - PopularTags = (await _tagAppService.GetPopularTags(new GetPopularTagsInput {ResultCount = 10})); + PopularTags = (await _tagAppService.GetPopularTags(new GetPopularTagsInput {ResultCount = 10, MinimumPostCount = 2})); } } } \ No newline at end of file