From adca1f405724703a9159aac674f1b38874168070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C4=9Fan=20=C3=9Cnl=C3=BC?= <36102404+armgnunlu@users.noreply.github.com> Date: Tue, 22 Sep 2020 11:13:41 +0300 Subject: [PATCH] Resolved #5324 --- .../Pages/Index.cshtml | 65 ++-- .../Components/Commenting/Default.cshtml | 281 +++++++++--------- .../Shared/Components/Commenting/default.css | 7 +- .../Shared/Components/Rating/Default.cshtml | 77 +++-- .../Shared/Components/Rating/default.css | 8 + .../Shared/Components/Rating/default.js | 8 +- .../ReactionSelection/Default.cshtml | 8 +- 7 files changed, 256 insertions(+), 198 deletions(-) diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml index c33377a8cc..e61017dd4b 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml @@ -22,15 +22,26 @@ -@if (GlobalFeatureManager.Instance.IsEnabled()) -{ - @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "quote", entityId = "1" }) -} -@if (GlobalFeatureManager.Instance.IsEnabled()) -{ - @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = "1" }) -} -
+ + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(RatingViewComponent), new { entityType = "quote", entityId = "1" }) + } + + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "quote", entityId = "1" }) + } + + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = "1" }) + } + + @@ -41,19 +52,23 @@ - -
-@if (GlobalFeatureManager.Instance.IsEnabled()) -{ - @await Component.InvokeAsync(typeof(RatingViewComponent), new { entityType = "quote", entityId = "2" }) -} -
-@if (GlobalFeatureManager.Instance.IsEnabled()) -{ - @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "quote", entityId = "2" }) -} -@if (GlobalFeatureManager.Instance.IsEnabled()) -{ - @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = "2" }) -} -
+ + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(RatingViewComponent), new { entityType = "quote", entityId = "2" }) + } + + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "quote", entityId = "2" }) + } + + + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = "2" }) + } + + 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 f988dd29e7..1dc4ca37ff 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 @@ -15,189 +15,198 @@ @{ Func GetCommentTitle(CmsUserDto author, DateTime creationTime) => - @ - - @((string.IsNullOrWhiteSpace(author.Name) + @ + + @((string.IsNullOrWhiteSpace(author.Name) ? author.UserName : author.Name + " " + author.Surname).Trim()) - @creationTime.ToString() - ; + @creationTime.ToString() + ; } @{ Func GetCommentArea(Guid? repliedCommentId, bool cancelButton = false) => - @
-
- -
-
-
- -
+ @
+ + +
+
+
+
-
-
- @if (cancelButton) - { - - @L["Cancel"] - - } - - @L["Send"] +
+
+
+ + @L["Send"] + + @if (cancelButton) + { + + @L["Cancel"] -
+ }
- -
; +
+ +
; } @{ Func GetCommentContentArea(Guid id, string text) => - @
-
-

- @text -

-
-
; + @
+

+ @text +

+
; } @{ Func GetCommentActionArea(Guid id, Guid authorId, bool isReply) => - @
- @if (!isReply) + @
+ @if (!isReply) + { + @if (CurrentUser.IsAuthenticated) { - @if (CurrentUser.IsAuthenticated) - { - - @L["Reply"] - - } - else - { - @L["LoginToReply"] - } + + @L["Reply"] + } - @if (authorId == CurrentUser.Id) + else { - - @L["Delete"] - - - - - @L["Edit"] - + @L["LoginToReply"] } -
; + } + @if (authorId == CurrentUser.Id) + { + + @L["Delete"] + + + @L["Edit"] + + } +
; } @{ Func GetEditArea(Guid id, string text) => - @
-