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 253016f03b..95faf6c6ee 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 @@ -8,52 +8,45 @@ @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection @model IndexModel @inject IStringLocalizer Localizer -

CMS Kit DEMO

+

CMS Kit DEMO

- - - -

- Any fool can write code that a computer can understand. Good programmers write code that humans can understand. + + + +

+ "Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

-
- Martin Fowler -
+

- Martin Fowler

- - @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"}) - } -
- - - -

- Writing code is very simple, but writing simple code is the hardest thing there is! +@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" }) +} +


+ + + +

+ "Writing code is very simple, but writing simple code is the hardest thing there is!"

-
- Halil ibrahim Kalkan (inspired from Johan Cruyff) -
+

- Halil ibrahim Kalkan Inspired from Johan Cruyff

- - @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(ReactionSelectionViewComponent), new { entityType = "quote", entityId = "2" }) +} +@if (GlobalFeatureManager.Instance.IsEnabled()) +{ + @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = "2" }) +} +
\ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/CmsKitCommonWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/CmsKitCommonWebModule.cs index 54743b948f..53b4359ca7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/CmsKitCommonWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/CmsKitCommonWebModule.cs @@ -18,14 +18,18 @@ namespace Volo.CmsKit.Web { Configure(options => { - options.ReactionIcons[StandardReactions.Smile] = new LocalizableIconDictionary("/cms-kit/icons/smile.png"); - options.ReactionIcons[StandardReactions.ThumbsUp] = new LocalizableIconDictionary("/cms-kit/icons/thumbsup.png"); - options.ReactionIcons[StandardReactions.Confused] = new LocalizableIconDictionary("/cms-kit/icons/confused.png"); - options.ReactionIcons[StandardReactions.Eyes] = new LocalizableIconDictionary("/cms-kit/icons/eyes.png"); - options.ReactionIcons[StandardReactions.Heart] = new LocalizableIconDictionary("/cms-kit/icons/heart.png"); - options.ReactionIcons[StandardReactions.Hooray] = new LocalizableIconDictionary("/cms-kit/icons/hooray.png"); - options.ReactionIcons[StandardReactions.Rocket] = new LocalizableIconDictionary("/cms-kit/icons/rocket.png"); - options.ReactionIcons[StandardReactions.ThumbsDown] = new LocalizableIconDictionary("/cms-kit/icons/thumbsdown.png"); + options.ReactionIcons[StandardReactions.Smile] = new LocalizableIconDictionary("fas fa-smile text-warning"); + options.ReactionIcons[StandardReactions.ThumbsUp] = new LocalizableIconDictionary("fa fa-thumbs-up text-primary"); + options.ReactionIcons[StandardReactions.Confused] = new LocalizableIconDictionary("fas fa-surprise text-warning"); + options.ReactionIcons[StandardReactions.Eyes] = new LocalizableIconDictionary("fas fa-meh-rolling-eyes text-warning"); + options.ReactionIcons[StandardReactions.Heart] = new LocalizableIconDictionary("fa fa-heart text-danger"); + options.ReactionIcons[StandardReactions.HeartBroken] = new LocalizableIconDictionary("fas fa-heart-broken text-danger"); + options.ReactionIcons[StandardReactions.Wink] = new LocalizableIconDictionary("fas fa-grin-wink text-warning"); + options.ReactionIcons[StandardReactions.Pray] = new LocalizableIconDictionary("fas fa-praying-hands text-info"); + options.ReactionIcons[StandardReactions.Rocket] = new LocalizableIconDictionary("fa fa-rocket text-success"); + options.ReactionIcons[StandardReactions.ThumbsDown] = new LocalizableIconDictionary("fa fa-thumbs-down text-secondary"); + options.ReactionIcons[StandardReactions.Victory] = new LocalizableIconDictionary("fas fa-hand-peace text-warning"); + options.ReactionIcons[StandardReactions.Rock] = new LocalizableIconDictionary("fas fa-hand-rock text-warning"); }); Configure(options => @@ -35,3 +39,4 @@ namespace Volo.CmsKit.Web } } } + diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Reactions/StandardReactions.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Reactions/StandardReactions.cs index 69a2d4c73a..532971502d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Reactions/StandardReactions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Reactions/StandardReactions.cs @@ -8,7 +8,11 @@ public const string Confused = "_CF"; public const string Eyes = "_EY"; public const string Heart = "_HE"; - public const string Hooray = "_HO"; + public const string HeartBroken = "_HB"; + public const string Wink = "_WI"; + public const string Pray = "_PR"; public const string Rocket = "_RO"; + public const string Victory = "_VI"; + public const string Rock = "_RC"; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDomainModule.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDomainModule.cs index 7659c40126..b1937dd6e0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDomainModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDomainModule.cs @@ -16,14 +16,18 @@ namespace Volo.CmsKit { Configure(options => { - options.Reactions.AddOrReplace(StandardReactions.Smile); options.Reactions.AddOrReplace(StandardReactions.ThumbsUp); options.Reactions.AddOrReplace(StandardReactions.ThumbsDown); + options.Reactions.AddOrReplace(StandardReactions.Smile); + options.Reactions.AddOrReplace(StandardReactions.Wink); options.Reactions.AddOrReplace(StandardReactions.Confused); + options.Reactions.AddOrReplace(StandardReactions.Victory); + options.Reactions.AddOrReplace(StandardReactions.Rock); options.Reactions.AddOrReplace(StandardReactions.Eyes); options.Reactions.AddOrReplace(StandardReactions.Heart); - options.Reactions.AddOrReplace(StandardReactions.Hooray); + options.Reactions.AddOrReplace(StandardReactions.HeartBroken); options.Reactions.AddOrReplace(StandardReactions.Rocket); + options.Reactions.AddOrReplace(StandardReactions.Pray); }); } } 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 790a66fcd4..e8a26db102 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,101 +15,107 @@ @{ 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"] - -
; +
+
+ @if (cancelButton) + { + @L["Cancel"] + } + @L["Send"] +
+
+
+ +
; } @{ Func GetCommentContentArea(Guid id, string text) => - @
-
-

- @text -

-
-
; + @
+
+

+ @text +

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

- @L["Comments"] -

+
+
+ @L["Comments"] +
@foreach (var comment in Model.Comments) { -
-
+
+
@GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null)
@@ -119,7 +125,7 @@ @if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled()) { @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), - new {entityType = "comment", entityId = comment.Id.ToString()}) + new { entityType = "comment", entityId = comment.Id.ToString() }) } @GetCommentActionArea(comment.Id, comment.Author.Id, false, comment.Text).Invoke(null) @@ -131,28 +137,28 @@ @if (comment.Replies.Any()) { -
- @foreach (var reply in comment.Replies) - { -
-
+ @foreach (var reply in comment.Replies) + { +
+
+
-
+
@GetCommentTitle(reply.Author, reply.CreationTime).Invoke(null) -
+ @GetCommentContentArea(reply.Id, reply.Text).Invoke(null) @if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled()) { @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), - new {entityType = "comment", entityId = reply.Id.ToString()}) + new { entityType = "comment", entityId = reply.Id.ToString() }) } @GetCommentActionArea(reply.Id, reply.Author.Id, true, reply.Text).Invoke(null)
- } -
+
+ } }
@@ -166,7 +172,7 @@ } else if (!string.IsNullOrWhiteSpace(Model.LoginUrl)) { -
+ } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/Default.cshtml index 9096f8f154..cc9f29af27 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/Default.cshtml @@ -1,25 +1,29 @@ @inject ICurrentUser CurrentUser @using Volo.Abp.Users @model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection.ReactionSelectionViewComponent.ReactionSelectionViewModel - +
+
+ - @if (CurrentUser.IsAuthenticated) - { - - - } - @foreach (var reaction in Model.Reactions.Where(r => r.Count > 0)) - { - - - @(reaction.Count) - - } - +
\ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.css b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.css index 8e27846c5c..7ce8d0fc02 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.css +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.css @@ -1,13 +1,8 @@ -.cms-reaction-select-icon -{ +.cms-reaction-select-icon, .cms-reaction-icon { cursor: pointer; } -.cms-reaction-icon -{ - cursor: pointer; - padding: 3px 5px 5px; -} -.cms-reaction-icon-selected -{ - background-color: #eef; -} +.cms-reaction-selection-popover-content i.fa-2x{ + width: 25%; + display: inline-block; + float: left; +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.js index 3214d3af6b..7107fd5a81 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.js +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/ReactionSelection/default.js @@ -47,7 +47,7 @@ function init() { $selectIcon.popover({ - placement: 'right', + placement: 'left', html: true, trigger: 'focus', title: l('PickYourReaction'),