104 lines
3.1 KiB
Plaintext
104 lines
3.1 KiB
Plaintext
@page
|
|
@model IndexModel
|
|
|
|
|
|
@if (!string.IsNullOrEmpty(Model.LastError))
|
|
{
|
|
@Html.Raw(Model.LastError)
|
|
return;
|
|
}
|
|
|
|
@if (Model.Poets == null)
|
|
{
|
|
<p>
|
|
Хато дар дарёфти феҳристи суханварон
|
|
</p>
|
|
return;
|
|
}
|
|
|
|
<div class="text-center">
|
|
@if (Model.IsSearchPage)
|
|
{
|
|
@if (Model.Poems == null)
|
|
{
|
|
<div class="poem">
|
|
<h2>Ёфт менашавад ҷустаем мо</h2>
|
|
<p>
|
|
Шеъре шомили ин иборат ёфт нашуд.
|
|
</p>
|
|
</div>
|
|
}
|
|
else
|
|
for (int poemIndex = 0; poemIndex < Model.Poems.Count; poemIndex++)
|
|
{
|
|
var poem = Model.Poems[poemIndex];
|
|
|
|
<div class="sitem">
|
|
<a class="sitem-poet-portrait" href="@poem.Category.Poet.FullUrl" title="@poem.Category.Poet.Nickname">
|
|
<img src="/images/poets/@(poem.Category.Poet.Id).png" alt="@poem.Category.Poet.Nickname" loading="lazy"
|
|
onerror="this.onerror=null;this.src='/images/poets/999.png';" />
|
|
</a>
|
|
<div class="sitem-body">
|
|
<h2>
|
|
<a href="@poem.FullUrl">@poem.FullTitle</a>
|
|
</h2>
|
|
<div class="sit">
|
|
@Html.Raw(poem.PlainText)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<div class="spacer"> </div>
|
|
|
|
@Html.Raw(Model.PagingToolsHtml)
|
|
|
|
}
|
|
else
|
|
@if (Model.IsHomePage)
|
|
{
|
|
<div class="tg-poet-grid">
|
|
@foreach (var poet in Model.Poets)
|
|
{
|
|
<a class="tg-poet-card" href="@poet.FullUrl" title="@poet.Name">
|
|
<span class="tg-poet-portrait">
|
|
<img src="/images/poets/@(poet.Id).png" alt="@poet.Nickname" loading="lazy"
|
|
onerror="this.onerror=null;this.src='/images/poets/999.png';" />
|
|
</span>
|
|
<span class="tg-poet-name">@poet.Nickname</span>
|
|
</a>
|
|
}
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
@if (Model.IsPoetPage)
|
|
{
|
|
<div class="tg-poet-header">
|
|
<span class="tg-poet-portrait-lg">
|
|
<img src="/images/poets/@(Model.GanjoorPage.PoetOrCat.Poet.Id).png" alt="@Model.GanjoorPage.PoetOrCat.Poet.Nickname" loading="lazy"
|
|
onerror="this.onerror=null;this.src='/images/poets/999.png';" />
|
|
</span>
|
|
</div>
|
|
<div class="tg-poet-page">
|
|
@Html.Raw(Model.GanjoorPage.HtmlText)
|
|
</div>
|
|
}
|
|
else if (Model.IsCatPage)
|
|
{
|
|
<div class="tg-cat-page">
|
|
@Html.Raw(Model.GanjoorPage.HtmlText)
|
|
</div>
|
|
}
|
|
else if (Model.IsPoemPage)
|
|
{
|
|
@Html.Raw(Model.GanjoorPage.HtmlText)
|
|
}
|
|
else
|
|
{
|
|
@Html.Raw(Model.GanjoorPage.HtmlText)
|
|
}
|
|
}
|
|
|
|
</div>
|