From 420bf222998ae72242981e8bac589fc5058191df Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 31 Aug 2020 16:54:37 +0300 Subject: [PATCH] cmskit comment page refactor --- .../Components/Commenting/Default.cshtml | 98 +++++++++++-------- 1 file changed, 58 insertions(+), 40 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml index 8cf2878d16..ab7fc9805b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml @@ -64,34 +64,37 @@ ; } @{ - Func GetCommentActionArea(Guid id, Guid authorId, bool isReply, string text) => - @
-
- @if (!isReply) + Func GetCommentActionArea(Guid id, Guid authorId, bool isReply) => + @
+ @if (!isReply) + { + @if (CurrentUser.IsAuthenticated) { - @if (CurrentUser.IsAuthenticated) - { - - @L["Reply"] - - } - else - { - @L["LoginToReply"] - } + + @L["Reply"] + } - @if (authorId == CurrentUser.Id) + else { - - @L["Delete"] - + @L["LoginToReply"] + } + } + @if (authorId == CurrentUser.Id) + { + + @L["Delete"] + - - @L["Edit"] - - } -
+ + @L["Edit"] + + } +
; +} +@{ + Func GetEditArea(Guid id, string text) => + @
@@ -160,23 +178,23 @@ @if (comment.Replies.Count >= 5) {
- @if (CurrentUser.IsAuthenticated) - { - - @L["Reply"] - - } - else - { - @L["LoginToReply"] - } + @if (CurrentUser.IsAuthenticated) + { + + @L["Reply"] + + } + else + { + @L["LoginToReply"] + }
} } - @if (CurrentUser.IsAuthenticated) - { - @GetCommentArea(comment.Id, true).Invoke(null) - } + @if (CurrentUser.IsAuthenticated) + { + @GetCommentArea(comment.Id, true).Invoke(null) + }