diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 3b249ffff7..37780167bb 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -13,12 +13,6 @@ @inject IOptionsSnapshot twitterOptions @using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.TagHelpers -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid -@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @using Volo.Blogging.Localization @using Volo.Blogging.Pages.Blog @inject IHtmlLocalizer L @@ -57,359 +51,446 @@ }
- -
-
-
-
-
-
-

@Model.Post.Title

+ +
+
+
+
+
+
+

@Model.Post.Title

+
+ +
+
+
+ Cover Image +
+
+
+
+
+
+
+ @if (Model.Post.Writer != null) + { + + User Avatar + + } +
+ +
+

Last Blog Posts

+ @for (var index = 0; index < Model.LatestPosts.Count && index < 4; index++) + { + if (Model.LatestPosts[index].Id != Model.Post.Id) + { + var post = Model.LatestPosts[index]; + +
+
-
- Cover Image -
-
-
-
+
+ } + }
+
+
+ +
+
+
+

+ @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) +

+
+
+
+ +
+
+ +
+
+@if (Model.Post.Tags.Count > 0) +{ +
+
@L["TagsInThisArticle"]
+ @foreach (var tag in Model.Post.Tags) + { + @tag.Name + } +
+} + +@if (Model.CommentsWithReplies.Count > 0) +{ + + +

@L["CommentWithCount", @Model.CommentCount]

+ @if (hasCommentingPermission) + { + @L["LeaveComment"] + } + else + { + @L["LeaveComment"] + } +
+
-
-
-
-

- @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) +

+ @foreach (var commentWithRepliesDto in Model.CommentsWithReplies) + { +
+ User Avatar +
+
+ @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) + @BloggingPageHelper.ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) +
+

+ @commentWithRepliesDto.Comment.Text

-
-
-
+
-
-
-
-
- @(L["ShareOn"].Value + " :") - - Twitter - - - Linkedin - - - E-mail - -
- @if (Model.Post.Tags.Count > 0) - { -
-
@L["TagsInThisArticle"]
- @foreach (var tag in Model.Post.Tags) + @if (hasCommentingPermission) { - @tag.Name + + @L["Reply"] + } -
- } - @if (Model.CommentsWithReplies.Count > 0) - { - - -

@L["CommentWithCount", @Model.CommentCount]

- @if (hasCommentingPermission) - { - @L["LeaveComment"] - } - else - { - @L["LeaveComment"] - } -
-
+ @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { + | + + @L["Delete"] + + } -
- @foreach (var commentWithRepliesDto in Model.CommentsWithReplies) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
- User Avatar -
-
- @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) - @BloggingPageHelper.ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) -
-

- @commentWithRepliesDto.Comment.Text -

-
+ | + + @L["Edit"] + + } +
- @if (hasCommentingPermission) - { - - @L["Reply"] - - } + @if (hasCommentingPermission) + { +
+
+

+ @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Delete"] - - } +

+
+
+ + - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Edit"] - - } -
+
+ +
+ + + +
+
+
+ } + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { +
+
+
+
+ + +
+ +
+ + + +
+
+
+ } + + @foreach (var reply in commentWithRepliesDto.Replies) + { +
+ User Avatar +
+
+ @(reply.Writer == null ? "" : reply.Writer.UserName) + @BloggingPageHelper.ConvertDatetimeToTimeAgo(reply.CreationTime) +
+

+ @reply.Text +

+
@if (hasCommentingPermission) { -
-
-

- @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] - -

-
-
- - - -
- -
- - - -
-
-
+ + @L["Reply"] + } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
-
-
-
- - -
- -
- - - -
-
-
+ | + + @L["Delete"] + } - @foreach (var reply in commentWithRepliesDto.Replies) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
- User Avatar -
-
- @(reply.Writer == null ? "" : reply.Writer.UserName) - @BloggingPageHelper.ConvertDatetimeToTimeAgo(reply.CreationTime) -
-

- @reply.Text -

-
- - @if (hasCommentingPermission) - { - - @L["Reply"] - - } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Delete"] - - } - - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Edit"] - - } -
+ | + + @L["Edit"] + + } +
- @if (hasCommentingPermission) - { -
-
-

- @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] -

-
-
- - -
- -
- - - -
-
+ @if (hasCommentingPermission) + { +
+
+

+ @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] +

+
+
+ + +
+
- } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { -
-
-
- - -
- -
- - - -
-
+ + + +
+
+
+ } + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { +
+
+
+
+ +
+
- } + + +
- } -
-
- } -
- } - - @if (hasCommentingPermission) - { -
-
-

@L["LeaveComment"]

-
-
-
-
- - -
-
- - -
-
-
- } - else - { - @L["LeaveComment"] - } -
-
-

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

- @for (var index = 1; index < Model.PostsList.Count && index < 5; index++) - { - var post = Model.PostsList[index]; -
-
- - - - - - - @L["Blog"].Value.ToUpper() - -
-
- -

- - @post.Title - -

-

- - @post.Description.TruncateWithPostfix(150) - - @L["ReadMore"] -

-
-
-
- -
+ }
}
+ } +
+} + +@if (hasCommentingPermission) +{ +
+
+

@L["LeaveComment"]

+
+
+
+
+ + +
+ +
+ +
+} +else +{ + @L["LeaveComment"] +} +
+
+

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

+ @for (var index = 0; index < Model.PostsList.Count && index <= 5; index++) + { + if (Model.PostsList[index].Id != Model.Post.Id) + { + var post = Model.PostsList[index]; +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } + + } +
+
+
+
+ +
+
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs index f902d849f9..49bef9c549 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs @@ -41,6 +41,11 @@ namespace Volo.Blogging.Pages.Blog.Posts public BlogDto Blog { get; set; } public List PostsList { get; set; } + + public IReadOnlyList LatestPosts { get; set; } + + [BindProperty(SupportsGet = true)] + public string TagName { get; set; } public DetailModel(IPostAppService postAppService, IBlogAppService blogAppService, ICommentAppService commentAppService) { @@ -82,6 +87,7 @@ namespace Volo.Blogging.Pages.Blog.Posts Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); Post = await _postAppService.GetForReadingAsync(new GetPostInput { BlogId = Blog.Id, Url = PostUrl }); PostsList = await _postAppService.GetListByUserIdAsync(Post.Writer.Id); + LatestPosts = (await _postAppService.GetListByBlogIdAndTagNameAsync(Blog.Id, TagName)).Items; CommentsWithReplies = await _commentAppService.GetHierarchicalListOfPostAsync(Post.Id); CountComments(); } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index 7a0d0da168..b6d1a2d975 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -15,6 +15,12 @@ pageHeader + ' | ' + blogName + ' | ' + window.location.href ) ); + + $('#FacebookShareLink').attr( + 'href', + 'https://www.facebook.com/sharer/sharer.php?u=' + + encodeURI(window.location.href) + ); $('#LinkedinShareLink').attr( 'href', @@ -43,6 +49,10 @@ encodeURI(pageHeader + ' | ' + blogName) + '&' ); + + $(".copy-link").click(function() { + var copiedLink = $(this); + }); }; $('div .replyForm').hide(); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css index 6aac0e363b..66328cb885 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css @@ -320,3 +320,9 @@ div.vs-blog { text-decoration: none; } div.vs-blog > .form-group { margin: 0 !important; } +.last-post-title{ + font-size: 0.9rem; + font-weight: 550; + text-decoration: none; + color: black; +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css index 4c5167a694..668e566cba 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css @@ -1,3 +1,6 @@ .post-desc { overflow-wrap: break-word; -} \ No newline at end of file +} +a:not(#all-posts-tab,#edit-profile-tab) { + color: unset!important; +}