From ec5b0caeb630eb4d2bd0a84451585381baf8e898 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 4 Aug 2020 16:31:45 +0300 Subject: [PATCH] cmskit comment ui improvements --- .../CmsKit/Localization/Resources/en.json | 1 + .../Components/Commenting/Default.cshtml | 87 ++++++++++--------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 6d577e080c..3e16a17a47 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -4,6 +4,7 @@ "PickYourReaction": "Pick your reaction", "YourComment": "Your comment", "YourReply": "Your reply", + "Comments": "Comments", "Send": "Send", "Delete": "Delete", "Reply": "Reply", 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 a22f579c7c..faf3537430 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 @@ -88,55 +88,58 @@
- @foreach (var comment in Model.Comments) - { -
-
-
- - @GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null) -
- - @GetCommentContentArea(comment.Id, comment.Author.Id, false, comment.Text).Invoke(null) +
+

+ + @L["Comments"] +

+ @foreach (var comment in Model.Comments) + { +
+
+
+ @GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null) +
- @if (CurrentUser.IsAuthenticated) - { - @GetCommentArea(comment.Id, true).Invoke(null) - } + @GetCommentContentArea(comment.Id, comment.Author.Id, false, comment.Text).Invoke(null) - @if (comment.Replies.Any()) - { -
- @foreach (var reply in comment.Replies) - { -
-
+ @if (CurrentUser.IsAuthenticated) + { + @GetCommentArea(comment.Id, true).Invoke(null) + } -
- - @GetCommentTitle(reply.Author, reply.CreationTime).Invoke(null) -
+ @if (comment.Replies.Any()) + { +
+ @foreach (var reply in comment.Replies) + { +
+
- @GetCommentContentArea(reply.Id, reply.Author.Id, true, reply.Text).Invoke(null) +
+ @GetCommentTitle(reply.Author, reply.CreationTime).Invoke(null) +
+ @GetCommentContentArea(reply.Id, reply.Author.Id, true, reply.Text).Invoke(null) +
-
- } -
- } -
-
- } -
- @if (CurrentUser.IsAuthenticated) - { - @GetCommentArea(null).Invoke(null) - } - else if (!string.IsNullOrWhiteSpace(Model.LoginUrl)) - { - + } +
} +
+ @if (CurrentUser.IsAuthenticated) + { + @GetCommentArea(null).Invoke(null) + } + else if (!string.IsNullOrWhiteSpace(Model.LoginUrl)) + { + + } +