divan/GanjooRazor/Pages/Hashieha.cshtml
Hamid Reza Mohammadi 68315aa4aa refactoring
2026-07-18 13:51:04 +03:30

252 lines
14 KiB
Plaintext

@page
@using DNTPersianUtils.Core;
@model GanjooRazor.Pages.HashiehaModel
@{
Layout = "_Layout";
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
@Html.Raw(Model.LastError)
}
else
{
<partial name="_SearchHeaderPartial" model="@(new _SearchHeaderPartialModel(){ Poets = Model.Poets, SelectedPoetId = Model.PoetId, CurrentCategory = Model.Poet?.Cat })" />
<!-- #hdr2 -->
<div id="fa">
<partial name="_InlineLoginPartial" model="Model" />
<div id="maincnt">
<div class="sitem actionbox">
<div class="related-images-frame padding-20px">
<form method="get" id="searchcommentsform">
<input type="text" name="w" id="w" class="width-100per" value="@Model.Query" placeholder="جستجو در @Model.Title" />
@if (Model.Profile != null)
{
<input type="hidden" id="userid" name="userid" value="@Model.Profile.Id" />
}
<input type="submit" class="width-100per margin-top-5px" value="جستجو در @Model.Title" />
</form>
</div><!-- related-images-frame -->
</div> <!-- sitem actionbo -->
<div class="poem">
<h2>
<a href="@Model.HomeLink">
@Model.Title
</a>
</h2>
@if (Model.Profile != null)
{
<div class="text-align-center">
<small><a href="/hashieha">همهٔ حاشیه‌ها</a></small>
</div>
<div id="profile">
<p>
@Model.Profile.NickName
@if (!string.IsNullOrEmpty(Model.Profile.Website))
{
<a href="@Model.Profile.Website">🌐</a>
}
@if (Model.CanAdministerUsers)
{
<a href="/Admin/ExamineUser?id=@Model.Profile.Id">#</a>
}
</p>
<p>
<small>تاریخ پیوستن: <strong>@RMuseum.Services.Implementation.LanguageUtils.FormatDate(Model.Contributions.CreateDate)</strong></small>
</p>
@if (!string.IsNullOrEmpty(Model.Profile.Bio))
{
@Html.Raw(Model.Profile.Bio)
}
@if (
Model.Contributions.PoemCorrections > 0
||
Model.Contributions.SectionCorrections > 0
||
Model.Contributions.CatCorrections > 0
||
Model.Contributions.SuggestedSongs > 0
||
Model.Contributions.QuotedPoems > 0
||
Model.Contributions.Comments > 0
||
Model.Contributions.Recitations > 0
||
Model.Contributions.MuseumLinks > 0
||
Model.Contributions.PinterestLinks > 0
||
Model.Contributions.PoetSpecLines > 0
||
Model.Contributions.PoetPictures > 0
||
Model.Contributions.PublicUserNotes > 0
)
{
<table>
<tr>
<th colspan="2">
<span class="align-center">آمار مشارکت‌ها:</span>
</th>
</tr>
@if (Model.Contributions.Comments > 0)
{
<tr>
<td><p>حاشیه‌ها:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.Comments)</p></td>
</tr>
}
@if(Model.Contributions.PoemCorrections > 0)
{
<tr>
<td><p><a href="https://blog.ganjoor.net/1400/05/23/notes-for-suggesting-corrections/">ویرایش‌ها</a>ی تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PoemCorrections)</p></td>
</tr>
}
@if (Model.Contributions.SectionCorrections > 0)
{
<tr>
<td><p><a href="https://blog.ganjoor.net/1401/02/30/section-editor/">ویرایش‌های قطعات</a> تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.SectionCorrections)</p></td>
</tr>
}
@if (Model.Contributions.CatCorrections > 0)
{
<tr>
<td><p><a href="https://blog.ganjoor.net/1404/01/05/cat-editor/">ویرایش‌های بخش</a>‌های تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.CatCorrections)</p></td>
</tr>
}
@if (Model.Contributions.SuggestedSongs > 0)
{
<tr>
<td><p><a href="https://blog.ganjoor.net/1395/06/28/bptags/">ترانه</a>‌های مرتبط تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.SuggestedSongs)</p></td>
</tr>
}
@if (Model.Contributions.QuotedPoems > 0)
{
<tr>
<td><p><a href="https://blog.ganjoor.net/1402/11/06/suggest-quotes/">مشق</a>‌های پیشنهادی تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.QuotedPoems)</p></td>
</tr>
}
@if (Model.Contributions.Recitations > 0)
{
<tr>
<td><p><a href="https://ava.ganjoor.net/about">خوانش</a>‌های تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.Recitations)</p></td>
</tr>
}
@if (Model.Contributions.MuseumLinks > 0)
{
<tr>
<td><p>ارتباطات پیشنهادی <a href="https://museum.ganjoor.net">گنجینه</a>:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.MuseumLinks)</p></td>
</tr>
}
@if (Model.Contributions.PinterestLinks > 0)
{
<tr>
<td><p>ارتباطات پیشنهادی <a href="https://blog.ganjoor.net/1399/01/29/pinterest/">تصاویر خارجی</a>:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PinterestLinks)</p></td>
</tr>
}
@if (Model.Contributions.PoetSpecLines > 0)
{
<tr>
<td><p>نکات پیشنهادی <a href="https://blog.ganjoor.net/1400/11/28/photos/"> دربارهٔ چهرهٔ سخنوان</a>:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PoetSpecLines)</p></td>
</tr>
}
@if (Model.Contributions.PoetPictures > 0)
{
<tr>
<td><p>تصاویر <a href="https://blog.ganjoor.net/1400/11/28/photos/">چهرهٔ پیشنهادی</a>:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PoetPictures)</p></td>
</tr>
}
@if (Model.Contributions.PublicUserNotes > 0)
{
<tr>
<td><p><a href="https://museum.ganjoor.net/notes">یادداشت‌های عمومی گنجینه</a>:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PublicUserNotes)</p></td>
</tr>
}
</table>
}
</div>
<hr />
}
@if (Model.Comments.Count == 0)
{
<p>حاشیه‌ای با مشخصات مورد نظر شما پیدا نشد.</p>
}
else
foreach (var comment in Model.Comments)
{
<div class="ganjoor-comment">
<p>
@if (comment.UserId == null)
{
@comment.AuthorName
}
else
{
<a href="/hashieha/?userid=@comment.UserId">@comment.AuthorName</a>
}
<small>
در @comment.CommentDate.ToFriendlyPersianDateTextify()
@if (comment.InReplyTo != null)
{
<text>
@(" ")در پاسخ به @comment.InReplyTo.AuthorName
</text>
}
</small>
@(" ")دربارهٔ <a href="@comment.Poem.UrlSlug#comment-@comment.Id">@comment.Poem.Title</a>:
</p>
@if (comment.CoupletIndex != -1)
{
<div class="commentquote">
@comment.CoupletSummary
</div>
}
<blockquote>
@Html.Raw(comment.HtmlComment)
</blockquote>
</div>
}
</div>
@Html.Raw(Model.PagingToolsHtml)
</div>
<partial name="_FooterPartial" model=@(new _FooterPartialModel(){StickyEnabled = true}) />
</div>
@if (ViewData["TrackingScript"] != null && !string.IsNullOrEmpty(ViewData["TrackingScript"].ToString()))
{
@Html.Raw(ViewData["TrackingScript"])
}
}