Browse Source

cmskit comment ui improvements

pull/4961/head
Yunus Emre Kalkan 6 years ago
parent
commit
ec5b0caeb6
  1. 1
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json
  2. 87
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml

1
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",

87
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml

@ -88,55 +88,58 @@
<div class="cms-comment-area" data-entity-type="@Model.EntityType" data-entity-id="@Model.EntityId">
@foreach (var comment in Model.Comments)
{
<div class="comment pt-2 pl-5 mt-1 mb-1">
<div class="border-bottom">
<h5>
<i class="fa fa-comment-o"></i>
@GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null)
</h5>
@GetCommentContentArea(comment.Id, comment.Author.Id, false, comment.Text).Invoke(null)
<div class="pl-5 pt-3">
<h4>
<i class="fa fa-comment-o"></i>
@L["Comments"]
</h4>
@foreach (var comment in Model.Comments)
{
<div class="comment pt-2 mt-1 mb-1">
<div class="border-bottom">
<h5>
@GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null)
</h5>
@if (CurrentUser.IsAuthenticated)
{
@GetCommentArea(comment.Id, true).Invoke(null)
}
@GetCommentContentArea(comment.Id, comment.Author.Id, false, comment.Text).Invoke(null)
@if (comment.Replies.Any())
{
<div class="pl-5">
@foreach (var reply in comment.Replies)
{
<div class="comment pt-3 mt-1">
<div class="border-top">
@if (CurrentUser.IsAuthenticated)
{
@GetCommentArea(comment.Id, true).Invoke(null)
}
<h6>
<i class="fa fa-comment-o"></i>
@GetCommentTitle(reply.Author, reply.CreationTime).Invoke(null)
</h6>
@if (comment.Replies.Any())
{
<div class="pl-5">
@foreach (var reply in comment.Replies)
{
<div class="comment pt-3">
<div class="border-bottom">
@GetCommentContentArea(reply.Id, reply.Author.Id, true, reply.Text).Invoke(null)
<h6>
@GetCommentTitle(reply.Author, reply.CreationTime).Invoke(null)
</h6>
@GetCommentContentArea(reply.Id, reply.Author.Id, true, reply.Text).Invoke(null)
</div>
</div>
</div>
}
</div>
}
</div>
</div>
}
<div class="p-3 pl-5">
@if (CurrentUser.IsAuthenticated)
{
@GetCommentArea(null).Invoke(null)
}
else if (!string.IsNullOrWhiteSpace(Model.LoginUrl))
{
<div class="float-right mb-2">
<a href="@Model.LoginUrl" class="btn btn-primary"> @L["LoginToAddComment"]</a>
}
</div>
}
</div>
</div>
}
<div class="p-3 pl-5">
@if (CurrentUser.IsAuthenticated)
{
@GetCommentArea(null).Invoke(null)
}
else if (!string.IsNullOrWhiteSpace(Model.LoginUrl))
{
<div class="float-right mb-2">
<a href="@Model.LoginUrl" class="btn btn-primary"> @L["LoginToAddComment"]</a>
</div>
}
</div>
</div>
</div>

Loading…
Cancel
Save