divan/GanjooRazor/Pages/_CommentPartial.cshtml
Hamid Reza Mohammadi 55688e20c3 fixing layout
2021-05-29 06:36:36 +04:30

49 lines
1.7 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">
@if (Model.Comment.UserId != null)
{
<p><a href="/hashieha/?userid=@Model.Comment.UserId">@Model.Comment.AuthorName</a> <small>در @Html.Raw($"{Model.Comment.CommentDate.ToFriendlyPersianDateTextify()}")</small> @Model.Wrote:</p>
}
else
{
<p>@Model.Comment.AuthorName <small>در @Html.Raw($"{Model.Comment.CommentDate.ToFriendlyPersianDateTextify()}")</small> @Model.Wrote:</p>
}
<blockquote id="comment-text-@Model.Comment.Id">
@Html.Raw(Model.Comment.HtmlComment)
</blockquote>
<p>
@if (Model.Comment.MyComment)
{
<a role="button" onclick="deleteMyComment(@Model.Comment.Id)" class="actionlink" title="حذف حاشیه">🗑</a>
<a role="button" onclick="editMyComment(@Model.Comment.Id)" class="actionlink" title="ویرایش حاشیه">✎</a>
}
<a role="button" onclick="replyComment(@Model.Comment.Id, @(Model.LoggedIn ? "true" : "false"))" class="actionlink" title="پاسخگویی به این حاشیه">⤶</a>
<a href="/ReportComment/?CommentId=@Model.Comment.Id" onclick="wpopen(this.href); return false" class="comments-link" title="گزارش حاشیهٔ نامناسب">⚐</a>
</p>
<div class='spacer'>&nbsp;</div>
<hr />
@foreach (var reply in Model.Comment.Replies)
{
<partial name="_CommentPartial" model=Model.GetCommentModel(reply) />
}
</div>
}