Files
divan/GanjooRazor/Pages/_CommentPartial.cshtml
T

63 lines
3.4 KiB
Plaintext

@model GanjooRazor.Pages._CommentPartialModel
@using DNTPersianUtils.Core
@{
Layout = null;
}
@if (Model.Comment == null)
{
<div class="item" id="comment-error">
<p style="color:red">خطا</p>
@Html.Raw(Model.Error)
</div>
}
else
{
<div class="ganjoor-comment" id="comment-@Model.Comment.Id@Model.DivSuffix">
@if (!string.IsNullOrEmpty(Model.Comment.PublishStatus))
{
<div class="red-color">@Model.Comment.PublishStatus</div>
}
@if (Model.Comment.UserId != null)
{
<div class="comment-author"><a href="/hashieha/?userid=@Model.Comment.UserId">@(string.IsNullOrEmpty(Model.Comment.AuthorName) ? "#" : Model.Comment.AuthorName)</a> <small>در @Html.Raw($"{Model.Comment.CommentDate.ToFriendlyPersianDateTextify()}")</small> @Model.Wrote:</div>
}
else
{
<div class="comment-author">@(string.IsNullOrEmpty(Model.Comment.AuthorName) ? "ناشناس" : Model.Comment.AuthorName) <small>در @Html.Raw($"{Model.Comment.CommentDate.ToFriendlyPersianDateTextify()}")</small> @Model.Wrote:</div>
}
@if (Model.Comment.CoupletIndex != -1)
{
<div class="commentquote">دربارهٔ <a href="@($"#bn{Model.Comment.CoupletIndex + 1}")">@Model.Comment.CoupletSummary</a></div>
}
<blockquote id="comment-text-@Model.Comment.Id@Model.DivSuffix">
@Html.Raw(Model.Comment.HtmlComment)
</blockquote>
<p>
@if (Model.Comment.MyComment)
{
<a role="button" onclick="deleteMyComment(@Model.Comment.Id, '@Model.Comment.CoupletIndex')" class="w3tooltip"><i class="pageicons">delete</i><span class="w3tooltiptext">حذف حاشیه</span></a>
<a role="button" onclick="editMyComment(@Model.Comment.Id, '@Model.Comment.CoupletIndex')" class="w3tooltip"><i class="pageicons">edit</i><span class="w3tooltiptext">ویرایش حاشیه</span></a>
}
<a role="button" onclick="replyComment(@Model.Comment.Id, @(Model.LoggedIn ? "true" : "false"), '@Model.DivSuffix')" class="w3tooltip"><i class="pageicons">reply</i><span class="w3tooltiptext">پاسخگویی به این حاشیه</span></a>
<a href="/ReportComment/?CommentId=@Model.Comment.Id" onclick="wpopen(this.href); return false" class="w3tooltip"><i class="pageicons">flag</i><span class="w3tooltiptext">گزارش حاشیهٔ نامناسب</span></a>
<a role="button" onclick="copyCommentUrl(@Model.Comment.Id, '@Model.DivSuffix')" class="w3tooltip"><i class="pageicons">link</i><span class="w3tooltiptext" id="copycommentlink-tooltip-@Model.Comment.Id@Model.DivSuffix">رونوشت نشانی حاشیه</span></a>
@if (Model.LoggedIn)
{
<a role="button" id="bookmark-comment-@Model.Comment.Id@Model.DivSuffix" class="w3tooltip cursor-pointer" onclick="switchBookmark(@Model.PoemId, -@Model.Comment.Id, '@Model.DivSuffix')"><i class="pageicons" id="bookmark-icon-comment-@Model.Comment.Id@Model.DivSuffix">@(@Model.Comment.IsBookmarked ? "star" : "star_border")</i><span class="w3tooltiptext">نشان کردن / حذف نشان</span></a>
}
</p>
<div class='spacer'>&nbsp;</div>
@foreach (var reply in Model.Comment.Replies)
{
<partial name="_CommentPartial" model=Model.GetCommentModel(reply) />
}
</div>
}