|
|
|
|
@ -20,16 +20,16 @@
|
|
|
|
|
@<span>
|
|
|
|
|
<i class="far fa-comment-alt me-2"></i>
|
|
|
|
|
@((string.IsNullOrWhiteSpace(author.Name)
|
|
|
|
|
? author.UserName
|
|
|
|
|
: author.Name + " " + author.Surname).Trim())
|
|
|
|
|
? author.UserName
|
|
|
|
|
: author.Name + " " + author.Surname).Trim())
|
|
|
|
|
<small class="text-muted float-end" style="opacity: .5; font-size: 14px">@creationTime.ToString()</small>
|
|
|
|
|
</span>;
|
|
|
|
|
}
|
|
|
|
|
@{
|
|
|
|
|
Func<dynamic, IHtmlContent> GetCommentArea(Guid? repliedCommentId, bool cancelButton = false) =>
|
|
|
|
|
@<div class="cms-comment-form-area bg-light card p-3 mx-0 @(repliedCommentId.HasValue ? "my-3" : "mt-3")"
|
|
|
|
|
data-reply-id="@(repliedCommentId?.ToString() ?? "")"
|
|
|
|
|
style="@(string.IsNullOrEmpty(repliedCommentId?.ToString() ?? "") ? "" : "display:none")">
|
|
|
|
|
data-reply-id="@(repliedCommentId?.ToString() ?? "")"
|
|
|
|
|
style="@(string.IsNullOrEmpty(repliedCommentId?.ToString() ?? "") ? "" : "display:none")">
|
|
|
|
|
<form class="cms-comment-form">
|
|
|
|
|
<input hidden value="@(repliedCommentId?.ToString() ?? "")" name="repliedCommentId" />
|
|
|
|
|
<div class="row">
|
|
|
|
|
@ -43,31 +43,31 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if (CmsKitCommentOptions.Value.IsRecaptchaEnabled)
|
|
|
|
|
{
|
|
|
|
|
<div class="volo-captcha">
|
|
|
|
|
<label class="form-label" for="Input_Captcha">@L["CaptchaCode"]</label>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="bd-highlight">
|
|
|
|
|
<img src="@Model.Input.CaptchaImageBase64" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex-grow-1 bd-highlight">
|
|
|
|
|
<abp-input type="number" asp-for="@Model.Input.Captcha" suppress-label="true" class="d-inline-block" autocomplete="off" />
|
|
|
|
|
</div>
|
|
|
|
|
<abp-input asp-for="@Model.CaptchaId" value="@Model.CaptchaOutput.Id" />
|
|
|
|
|
{
|
|
|
|
|
<div class="volo-captcha">
|
|
|
|
|
<label class="form-label" for="Input_Captcha">@L["CaptchaCode"]</label>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="bd-highlight">
|
|
|
|
|
<img src="@Model.Input.CaptchaImageBase64" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex-grow-1 bd-highlight">
|
|
|
|
|
<abp-input type="number" asp-for="@Model.Input.Captcha" suppress-label="true" class="d-inline-block" autocomplete="off" />
|
|
|
|
|
</div>
|
|
|
|
|
<abp-input asp-for="@Model.CaptchaId" value="@Model.CaptchaOutput.Id" />
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="text-end">
|
|
|
|
|
<abp-button id="submit-button" type="submit" button-type="Primary">
|
|
|
|
|
<i class="fa fa-comment-alt me-1"></i> @L["Send"]
|
|
|
|
|
</abp-button>
|
|
|
|
|
@if (cancelButton)
|
|
|
|
|
{
|
|
|
|
|
<abp-button type="button" button-type="Light" class="reply-cancel-button" data-reply-id="@(repliedCommentId?.ToString() ?? "")">
|
|
|
|
|
<i class="fa fa-times me-1"></i> @L["Cancel"]
|
|
|
|
|
</abp-button>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
<abp-button type="button" button-type="Light" class="reply-cancel-button" data-reply-id="@(repliedCommentId?.ToString() ?? "")">
|
|
|
|
|
<i class="fa fa-times me-1"></i> @L["Cancel"]
|
|
|
|
|
</abp-button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -86,32 +86,32 @@
|
|
|
|
|
Func<dynamic, IHtmlContent> GetCommentActionArea(Guid id, Guid authorId, bool isReply) =>
|
|
|
|
|
@<div class="inner-comment-buttons text-start">
|
|
|
|
|
@if (!isReply)
|
|
|
|
|
{
|
|
|
|
|
@if (CurrentUser.IsAuthenticated)
|
|
|
|
|
{
|
|
|
|
|
<a href="#" class="comment-links comment-reply-link btn btn-sm shadow-sm btn-primary" data-reply-id="@id.ToString()" id="@($"cms-comment_{Model.Input.EntityType}_{Model.Input.EntityId}_{id}_link")">
|
|
|
|
|
<i class="fa fa-reply mr -1"></i> @L["Reply"]
|
|
|
|
|
</a>
|
|
|
|
|
{
|
|
|
|
|
@if (CurrentUser.IsAuthenticated)
|
|
|
|
|
{
|
|
|
|
|
<a href="#" class="comment-links comment-reply-link btn btn-sm shadow-sm btn-primary" data-reply-id="@id.ToString()" id="@($"cms-comment_{Model.Input.EntityType}_{Model.Input.EntityId}_{id}_link")">
|
|
|
|
|
<i class="fa fa-reply mr -1"></i> @L["Reply"]
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<a href="#" class="comment-links comment-delete-link btn btn-sm shadow-sm btn-link text-muted bg-white " data-author-id="@authorId.ToString()" data-id="@id.ToString()">
|
|
|
|
|
<i class="fa fa-trash mr -1"></i> @L["Delete"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<a href="@(Model.Input.LoginUrl + "_" + id)" class="btn btn-sm btn-light shadow-sm">
|
|
|
|
|
@L["LoginToReply"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="#" class="comment-links comment-delete-link btn btn-sm shadow-sm btn-link text-muted bg-white " data-author-id="@authorId.ToString()" data-id="@id.ToString()">
|
|
|
|
|
<i class="fa fa-trash mr -1"></i> @L["Delete"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<a href="@(Model.Input.LoginUrl + "_" + id)" class="btn btn-sm btn-light shadow-sm">
|
|
|
|
|
@L["LoginToReply"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@if (authorId == CurrentUser.Id)
|
|
|
|
|
{
|
|
|
|
|
<a href="#" class="comment-links comment-edit-link btn btn-sm shadow-sm btn-link text-muted bg-white" data-id="@id.ToString()">
|
|
|
|
|
<i class="fa fa-pencil mr -1 "></i> @L["Edit"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
<a href="#" class="comment-links comment-edit-link btn btn-sm shadow-sm btn-link text-muted bg-white" data-id="@id.ToString()">
|
|
|
|
|
<i class="fa fa-pencil mr -1 "></i> @L["Edit"]
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
}
|
|
|
|
|
@{
|
|
|
|
|
@ -128,26 +128,26 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt-0">
|
|
|
|
|
<small class="text-muted float-end" >@L["MarkdownSupported"]</small>
|
|
|
|
|
<small class="text-muted float-end">@L["MarkdownSupported"]</small>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if (CmsKitCommentOptions.Value.IsRecaptchaEnabled)
|
|
|
|
|
{
|
|
|
|
|
var output = await Model.GenerateCaptchaAsync();
|
|
|
|
|
{
|
|
|
|
|
var output = await Model.GenerateCaptchaAsync();
|
|
|
|
|
|
|
|
|
|
<div class="volo-captcha">
|
|
|
|
|
<label class="form-label" for="Input_Captcha_@output.Id">@L["CaptchaCode"]</label>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="bd-highlight">
|
|
|
|
|
<img src="@Model.GetCaptchaImageBase64(output.ImageBytes)"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex-grow-1 bd-highlight">
|
|
|
|
|
<abp-input id="Input_Captcha_@output.Id" type="number" asp-for="@Model.Input.Captcha" suppress-label="true" class="d-inline-block" autocomplete="off"/>
|
|
|
|
|
</div>
|
|
|
|
|
<abp-input asp-for="@Model.CaptchaId" value="@output.Id"/>
|
|
|
|
|
<div class="volo-captcha">
|
|
|
|
|
<label class="form-label" for="Input_Captcha_@output.Id">@L["CaptchaCode"]</label>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="bd-highlight">
|
|
|
|
|
<img src="@Model.GetCaptchaImageBase64(output.ImageBytes)" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex-grow-1 bd-highlight">
|
|
|
|
|
<abp-input id="Input_Captcha_@output.Id" type="number" asp-for="@Model.Input.Captcha" suppress-label="true" class="d-inline-block" autocomplete="off" />
|
|
|
|
|
</div>
|
|
|
|
|
<abp-input asp-for="@Model.CaptchaId" value="@output.Id" />
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="text-end">
|
|
|
|
|
<abp-button type="submit" button-type="Primary" size="Block"> @L["Update"] </abp-button>
|
|
|
|
|
@ -183,22 +183,25 @@
|
|
|
|
|
|
|
|
|
|
@GetCommentContentArea(comment.Id, comment.Text).Invoke(null)
|
|
|
|
|
|
|
|
|
|
<div class="row mt-2">
|
|
|
|
|
<div class="col">
|
|
|
|
|
<div class="my-2 ">
|
|
|
|
|
@GetCommentActionArea(comment.Id, comment.Author.Id, false).Invoke(null)
|
|
|
|
|
@if (!Model.Input.IsReadOnly)
|
|
|
|
|
{
|
|
|
|
|
<div class="row mt-2">
|
|
|
|
|
<div class="col">
|
|
|
|
|
<div class="my-2 ">
|
|
|
|
|
@GetCommentActionArea(comment.Id, comment.Author.Id, false).Invoke(null)
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="reaction-in-comment">
|
|
|
|
|
@if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
|
|
|
|
|
{
|
|
|
|
|
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "comment", entityId = comment.Id.ToString() })
|
|
|
|
|
}
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="reaction-in-comment">
|
|
|
|
|
@if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
|
|
|
|
|
{
|
|
|
|
|
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "comment", entityId = comment.Id.ToString() })
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@GetEditArea(comment.Id, Model.Input.RawCommentTexts[comment.Id], comment.ConcurrencyStamp).Invoke(null)
|
|
|
|
|
@GetEditArea(comment.Id, Model.Input.RawCommentTexts[comment.Id], comment.ConcurrencyStamp).Invoke(null)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (comment.Replies.Any())
|
|
|
|
|
{
|
|
|
|
|
@ -212,23 +215,26 @@
|
|
|
|
|
|
|
|
|
|
@GetCommentContentArea(reply.Id, reply.Text).Invoke(null)
|
|
|
|
|
|
|
|
|
|
<div class="row mt-2">
|
|
|
|
|
<div class="col">
|
|
|
|
|
<div class="my-2 ">
|
|
|
|
|
@GetCommentActionArea(reply.Id, reply.Author.Id, true).Invoke(null)
|
|
|
|
|
@if (!Model.Input.IsReadOnly)
|
|
|
|
|
{
|
|
|
|
|
<div class="row mt-2">
|
|
|
|
|
<div class="col">
|
|
|
|
|
<div class="my-2 ">
|
|
|
|
|
@GetCommentActionArea(reply.Id, reply.Author.Id, true).Invoke(null)
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="reaction-in-comment">
|
|
|
|
|
@if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
|
|
|
|
|
{
|
|
|
|
|
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "comment", entityId = reply.Id.ToString() })
|
|
|
|
|
}
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="reaction-in-comment">
|
|
|
|
|
@if (cmsKitUiOptions.Value.CommentsOptions.IsReactionsEnabled && GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
|
|
|
|
|
{
|
|
|
|
|
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new { entityType = "comment", entityId = reply.Id.ToString() })
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@GetEditArea(reply.Id, Model.Input.RawCommentTexts[reply.Id], reply.ConcurrencyStamp).Invoke(null)
|
|
|
|
|
@GetEditArea(reply.Id, Model.Input.RawCommentTexts[reply.Id], reply.ConcurrencyStamp).Invoke(null)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|