Projects (GanjooRazor -> DivanRazor, GanjoorService.sln -> DivanService.sln), files, folders, classes, namespaces, settings, API routes (/api/divan) and DB tables (Divan*). External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed consistently (no pending model changes); requires a fresh database. Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
4.1 KiB
Plaintext
103 lines
4.1 KiB
Plaintext
@page
|
|
@model DivanRazor.Areas.User.Pages.AllPoemSectionsModel
|
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using DNTPersianUtils.Core
|
|
@{
|
|
Layout = "_UserPanelLayout";
|
|
ViewData["Title"] = "همهٔ قطعات شعر";
|
|
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
|
}
|
|
<div class="up-page-header">
|
|
<h1>@ViewData["Title"]</h1>
|
|
</div>
|
|
@if (!string.IsNullOrEmpty(Model.FatalError))
|
|
{
|
|
<div class="up-alert up-alert--danger">@Html.Raw(Model.FatalError)</div>
|
|
}
|
|
else
|
|
{
|
|
<script>
|
|
async function rebuildRelatedSections(sectionId, meterId, rhyming) {
|
|
var ok = await upConfirm(String(meterId) + ' : ' + rhyming);
|
|
if (!ok) return;
|
|
$('#rebuild-related-' + String(sectionId)).hide();
|
|
|
|
var url = '?handler=RebuildRelatedSections';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
data: {
|
|
meterId: meterId,
|
|
rhyming: rhyming
|
|
},
|
|
success: function() {
|
|
upToast('شروع شد.');
|
|
},
|
|
error: function(e) {
|
|
upToast(e.responseText || String(e), 'error');
|
|
$('#rebuild-related-' + String(sectionId)).show();
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
@if (Model.PoemSections != null && Model.PoemSections.Length > 0)
|
|
{
|
|
@foreach (var poemSection in Model.PoemSections)
|
|
{
|
|
<div class="up-card">
|
|
@if (poemSection.SectionType == RMuseum.Models.Divan.PoemSectionType.WholePoem)
|
|
{
|
|
<h2 class="up-card__title">
|
|
<a href="/User/Section?poemId=@poemSection.PoemId&index=@poemSection.Index" role="button" class="up-btn up-btn--sm up-btn--ghost">
|
|
قطعهٔ @(poemSection.Number.ToPersianNumbers()):
|
|
</a>
|
|
</h2>
|
|
}
|
|
|
|
<p>@Html.Raw(poemSection.HtmlText)</p>
|
|
|
|
<div class="up-field-row">
|
|
<div class="up-field">
|
|
<label>نوع</label>
|
|
<p class="up-field-static">@poemSection.SectionType</p>
|
|
</div>
|
|
<div class="up-field">
|
|
<label>Verse Type</label>
|
|
<p class="up-field-static">@poemSection.VerseType</p>
|
|
</div>
|
|
<div class="up-field">
|
|
<label>Index</label>
|
|
<p class="up-field-static">@poemSection.Index</p>
|
|
</div>
|
|
<div class="up-field">
|
|
<label>Number</label>
|
|
<p class="up-field-static">@poemSection.Number</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="up-field-row">
|
|
<div class="up-field">
|
|
<label><span class="up-field-icon" aria-hidden="true">🎵</span> وزن</label>
|
|
<p class="up-field-static">@(poemSection.DivanMetre == null ? "تعیین نشده" : poemSection.DivanMetre.Rhythm)</p>
|
|
</div>
|
|
<div class="up-field">
|
|
<label><span class="up-field-icon" aria-hidden="true">🔤</span> حروف قافیه</label>
|
|
<p class="up-field-static">@poemSection.RhymeLetters</p>
|
|
</div>
|
|
</div>
|
|
|
|
@if (poemSection.DivanMetre != null && !string.IsNullOrEmpty(poemSection.RhymeLetters) && Model.CanEdit)
|
|
{
|
|
<a role="button" id="rebuild-related-@poemSection.Id" class="up-btn up-btn--danger up-btn--block" onclick="rebuildRelatedSections(@poemSection.Id, @poemSection.DivanMetreId, '@poemSection.RhymeLetters')">🔁 بازسازی مرتبطها</a>
|
|
}
|
|
</div>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<partial name="_EmptyState" model="@("قطعهای برای این شعر یافت نشد.")" />
|
|
}
|
|
}
|