divan/GanjooRazor/Areas/User/Pages/CatEditor.cshtml
Hamid Reza Mohammadi cd82f46b46 #467 cat editor
2025-03-21 13:44:11 +03:30

121 lines
3.7 KiB
Plaintext

@page
@model GanjooRazor.Areas.User.Pages.CatEditorModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایشگر زندگینامهٔ شاعر / توصیف بخش";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
}
<h1>@ViewData["Title"]</h1>
@if (Model.MyLastEdit != null)
{
<script>
function deleteCatCorrection(id) {
if (!confirm('آیا از حذف تغییرات پیشنهادی اطمینان دارید؟'))
return;
$('#deletecorrections').hide();
$('#saving').text('در حال ذخیره ...');
var url = '?handler=DeleteCatCorrection';
$.ajax({
type: "POST",
url: url,
data: {
catid: id,
},
error: function () {
alert('خطا رخ داد.')
},
success: function () {
location.reload(true);
},
});
}
</script>
<table>
<tr>
<td colspan="2">ویرایشهای بررسی نشدهٔ من</td>
</tr>
<tr>
<td>متن اولیه</td>
<td>تغییرات من</td>
</tr>
@if (Model.MyLastEdit.Description != null)
{
<tr>
<td colspan="2">
تغییرات متن
</td>
</tr>
<tr>
<td>
<p class="red-color" id="title-lastedit-original">@Model.MyLastEdit.OriginalDescription</p>
</td>
<td>
<p class="green-color" id="title-lastedit-edited">@Model.MyLastEdit.Description</p>
</td>
</tr>
<tr>
<td colspan="2">
<p id="title-lastedit-compare">@Model.MyLastEdit.OriginalDescription</p>
<script>
$(document).ready(function () {
compareCorrectionBlocks('title-lastedit-original', 'title-lastedit-edited', 'title-lastedit-compare');
});
</script>
</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.MyLastEdit.Note))
{
<tr>
<td>یادداشت:</td>
<td>
@Model.MyLastEdit.Note
</td>
</tr>
}
<tr>
<td colspan="2" class="td-button-container">
<a role="button" id="deletecorrections" class="editor-button background-red" onclick="deletePoemCorrections(@Model.PageInformation.PoetOrCat.Cat.Id)">انصراف و حذف این ویرایش</a>
</td>
</tr>
</table>
}
<form method="post">
<table style="width:100%" class="noborder">
<tr>
<td>
<span class="inputlabel">متن: </span>
</td>
<td>
<input asp-for="Correction.CatId" type="hidden" />
<textarea asp-for="Correction.DescriptionHtml" rows="30" class="editor width-100per"></textarea>
</td>
</tr>
<tr>
<td>
<span class="inputlabel">توضیح این ویرایش: </span>
</td>
<td>
<input asp-for="Correction.Note" />
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" name="approve" id="approve" style="width:100%;color:white;background-color:green">ذخیره</button>
</td>
</tr>
</table>
</form>