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 5c3a601f3f..d7adf3c196 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 @@ -96,217 +96,223 @@
-
-
-
@L["TagsInThisArticle"]
- @foreach (var tag in Model.Post.Tags) - { - @tag.Name - } -
- - - -

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

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

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

+ @if (hasCommentingPermission) + { + @L["LeaveComment"] + } + else { -
- -
-
- @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) - @ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) -
-

- @commentWithRepliesDto.Comment.Text -

-
+ @L["LeaveComment"] + } + + + } - @if (hasCommentingPermission) - { - - @L["Reply"] - - } +
+ @foreach (var commentWithRepliesDto in Model.CommentsWithReplies) + { +
+ +
+
+ @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) + @ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) +
+

+ @commentWithRepliesDto.Comment.Text +

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

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

+ + @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)) + { +
+
+
+
+ +
+
-
+ + +
- } +
+
+ } - @foreach (var reply in commentWithRepliesDto.Replies) - { -
- -
-
- @(reply.Writer == null ? "" : reply.Writer.UserName) - @ConvertDatetimeToTimeAgo(reply.CreationTime) -
-

- @reply.Text -

-
+ @foreach (var reply in commentWithRepliesDto.Replies) + { +
+ +
+
+ @(reply.Writer == null ? "" : reply.Writer.UserName) + @ConvertDatetimeToTimeAgo(reply.CreationTime) +
+

+ @reply.Text +

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

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

@L["LeaveComment"]

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