From f1deeb7895529fc78e152810b62756a5b634b223 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Wed, 5 Aug 2026 18:24:30 +0330 Subject: [PATCH] improve UI/UX of the Admin Area #497 --- .../Areas/Admin/Pages/ReviewCatEdits.cshtml | 342 ++++---- .../Areas/Admin/Pages/ReviewPartEdits.cshtml | 761 ++++++++---------- .../Areas/Admin/Pages/ReviewQuoteds.cshtml | 390 +++------ GanjooRazor/wwwroot/css/user-panel.css | 15 + 4 files changed, 604 insertions(+), 904 deletions(-) diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml index 02d8b02a..9b0f3844 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml @@ -1,4 +1,4 @@ -@page +@page @using DNTPersianUtils.Core @model GanjooRazor.Areas.Admin.Pages.ReviewCatEditsModel @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @@ -6,241 +6,175 @@ Layout = "_AdminLayout"; ViewData["Title"] = "ویرایش‌های بخش‌ها"; } +
+

@ViewData["Title"]

+
@if (!string.IsNullOrEmpty(Model.FatalError)) { -

@Model.FatalError

+
@Model.FatalError
return; } @if (Model.Correction == null) { -

ویرایشی وجود ندارد.

+ return; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @if(Model.Links != null) - foreach (var link in Model.Links) - { - - - - - - - + var descriptionReviewResult = 'DontCare'; + if ($('#description_review_result_Approved').length > 0) { //has title + descriptionReviewResult = $('input[name=description_review_result]:checked').val() } - - - + var url = '?handler=SendCorrectionsModeration'; + var pms = {}; - - - - - - - - - - - - - - - - - + + +

دلیل را در یادداشت بررسی بنویسید.

+ @if (!string.IsNullOrEmpty(Model.Correction.Note)) { - - - - +
+ +
@Model.Correction.Note
+
} +
+ + +
+

 

- - - - - - - - -
- پیشنهاد دهنده: - - @Model.Correction.UserNickname -
- بررسی - -
- -
-
- زمان: - - @Model.Correction.Date.ToFriendlyPersianDateTextify() -
- تعداد کل: - - @Model.TotalCount -
- مشاهدهٔ بخش -
- تغییرات متن -
-

@Model.Correction.OriginalDescription

-
-

@Model.Correction.Description

-
-

@Model.Correction.OriginalDescription

- -
- Html -
- @Html.Raw(Model.Correction.DescriptionHtml) -
- پیوند داخل متن: -
-

- @if (link.Length > 20) - { - @Html.Raw(link.Substring(0, 19) + " ...") - } - else - { - @Html.Raw(link) - } - -

- -
- - -
- @if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) - { + pms.correctionId = correctionId; + pms.titleReviewResult = descriptionReviewResult; + pms.titleReviewNote = $('#review_note') == null ? null : $('#review_note').val(); + + $.ajax({ + type: "POST", + url: url, + data: JSON.stringify(pms), + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function () { + location.reload(true); + }, + error: function (e) { + upToast(e.responseText || 'خطا رخ داد.', 'error'); + $('#moderatecorrections').show(); + $('#saving').text(''); + } + }); + + } + + +
+
+ + +
+
+ +
@Model.Correction.Date.ToFriendlyPersianDateTextify()
+
+

تعداد کل: @Model.TotalCount

+ +

مشاهدهٔ بخش

+ +

تغییرات متن

+
+ +

@Model.Correction.OriginalDescription

+
+
+ +

@Model.Correction.Description

+
+
@Model.Correction.OriginalDescription
+ + +

Html

+
@Html.Raw(Model.Correction.DescriptionHtml)
+ + @if (Model.Links != null) + { + foreach (var link in Model.Links) + { +
+ +

+ @if (link.Length > 20) + { + @Html.Raw(link.Substring(0, 19) + " ...") + } + else + { + @Html.Raw(link) + } +

+
+ } + } + +
+ + +
+ +
+ + @if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { +
- -
+
+
- } - else - { + +
+ } + else + { +
- -
+
+
- } -
+ +
+ } +
-
+ +
+
-
+ +
+
-
-

دلیل را در یادداشت بررسی بنویسید.

-

 

یادداشت: - @Model.Correction.Note -
یادداشت بررسی:
+
+ بررسی +
+ +
+
+ diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewPartEdits.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewPartEdits.cshtml index ea26c76c..8479d1aa 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewPartEdits.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewPartEdits.cshtml @@ -1,4 +1,4 @@ -@page +@page @model GanjooRazor.Areas.Admin.Pages.ReviewPartEditsModel @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @using DNTPersianUtils.Core @@ -15,149 +15,126 @@ else ViewData["Title"] = "بازبینی ویرایش‌های قطعات"; } +
+

@ViewData["Title"]

+
-

@ViewData["Title"]

- -@if (Model.DeletedUserSections == false) -{ - وزن‌های نیافته -} -else -{ - پیشنهادهای عادی -} +
+ @if (Model.DeletedUserSections == false) + { + وزن‌های نیافته + } + else + { + پیشنهادهای عادی + } +
@if (!string.IsNullOrEmpty(Model.FatalError)) { -

@Model.FatalError

+
@Model.FatalError
} -else if (@Model.Correction == null) +else if (Model.Correction == null) { -

ویرایشی وجود ندارد.

+ } else if (Model.DeletedUserSections) { +
+

تعداد کل: @Model.TotalCount

+

@Model.PageInformation.FullTitle

- - - - - - - - - - - - - - - - - - - - - + var opt = document.createElement('option'); + opt.value = rhythm; + opt.innerHTML = rhythm; + select.appendChild(opt); - -
- تعداد کل: @Model.TotalCount -
-

@Model.PageInformation.FullTitle

-
- @Html.Raw(Model.PoemSection.HtmlText) -
- وزن: -
-
- - - @if (Model.RhythmsByVerseCount != null) - @foreach (var rhythm in Model.RhythmsByVerseCount) - { - - } - +
@Html.Raw(Model.PoemSection.HtmlText)
-
- - ذخیره -
- -
- + + @if (Model.RhythmsByVerseCount != null) + { + foreach (var rhythm in Model.RhythmsByVerseCount) { - + } - - پاک کردن وزن -
- + +
+ + + +
+ + - پیشنهاد وزن جدید -
+ var opt2 = document.createElement('option'); + opt2.value = rhythm; + opt2.innerHTML = rhythm; + document.getElementById('rhythm-new2').appendChild(opt2); + + upToast('وزن پیشنهادی به انتهای لیست وزن‌ها اضافه شده. لطفاً از لیست آن را انتخاب کنید.', 'success'); + } + } + + + +
} else { @@ -167,7 +144,6 @@ else $('#moderatecorrections').hide(); $('#saving').text('در حال بررسی ...'); - var breakFromVIndices = []; for (var i = 0; i <= verseCount; i++) { var checkVIndex = '#break-from-' + i.toString(); @@ -177,7 +153,7 @@ else } if (breakFromVIndices.length > 10) { - alert('حداکثر از ۱۰ محل می‌توانید قطعه را بشکنید.'); + upToast('حداکثر از ۱۰ محل می‌توانید قطعه را بشکنید.', 'error'); return; } @@ -201,7 +177,6 @@ else poemformatReviewResult = $('input[name=poemformat_review_result]:checked').val() } - var url = '?handler=SendCorrectionsModeration'; $.ajax({ @@ -223,17 +198,11 @@ else location.reload(true); }, error: function (e) { - if (e.responseText == null) - alert(e); - else - alert(e.responseText); + upToast(e.responseText || 'خطا رخ داد.', 'error'); $('#moderatecorrections').show(); $('#saving').text(''); } }); - - - } function checkAllNotCorrect(verseCount) { @@ -251,370 +220,306 @@ else } +

@Model.PageInformation.FullTitle

+

همهٔ قطعات شعر

-

@Model.PageInformation.FullTitle

+
+
+ + +
+
+ +
@Model.Correction.Date.ToFriendlyPersianDateTextify()
+
+

تعداد کل: @Model.TotalCount

+
+ + @if (Model.Correction.BreakFromVerse1VOrder != null) + { + دارد + } + else + { + ندارد + } +
-

- - همهٔ قطعات شعر - -

+ +

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @if (Model.TextSourceImage != null) { - - - + } @if (Model.Correction.Rhythm != null) { - - - - - - - - - - - - - - - - - - + + + + } @if (Model.Correction.RhymeLetters != null) { - - - +

قافیه

@if (Model.Correction.Rhythm == null) { - - - +
@Html.Raw(Model.PoemSection.HtmlText)
} - - - - - - - - - - - + + + + } @if (Model.Correction.Language != null) { - - - - - - - - - - - - - - - + + + + } @if (Model.Correction.PoemFormat != null) { - - - - - - - - - - - - - - - + + + + } @if (!string.IsNullOrEmpty(Model.Correction.Note)) { - - - - +
+ +
@Model.Correction.Note
+
} - @for (int v = 0; v < Model.Verses.Count; v++) - { - if - ( - Model.Correction.BreakFromVerse1VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse2VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse3VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse4VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse5VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse6VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse7VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse8VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse9VOrder == Model.Verses[v].VOrder - || - Model.Correction.BreakFromVerse10VOrder == Model.Verses[v].VOrder - ) +
+ + @for (int v = 0; v < Model.Verses.Count; v++) { -
- - + + + } + else + { +

@Model.Verses[v].Text

+ } } - else - { - - - - } - } - - - - - + +
+ + +
@if (Model.PoemSection != null) { - - - +

خودم ویرایش کنم

} -
- پیشنهاد دهنده: - - @Model.Correction.UserNickname -
- بررسی - -
- -
-
- زمان: - - @Model.Correction.Date.ToFriendlyPersianDateTextify() -
- تعداد کل: - - @Model.TotalCount -
- شکستن - - @if(Model.Correction.BreakFromVerse1VOrder != null) - { - دارد - } - else - { - ندارد - } -
- درست نیست -

 

- -
- وزن -
- @Html.Raw(Model.PoemSection.HtmlText) -
متن اولیهپیشنهاد
-

@Model.Correction.OriginalRhythm

-
-

@Model.Correction.Rhythm

-
- - @if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) - { +

وزن

+
@Html.Raw(Model.PoemSection.HtmlText)
+
+ +

@Model.Correction.OriginalRhythm

+
+
+ +

@Model.Correction.Rhythm

+
+
+ @if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { +
- -
+
+
- } - else - { + +
+ } + else + { +
- -
+
+
- } -
+ +
+ } +
-
+ +
+
-
- -
- قافیه -
- @Html.Raw(Model.PoemSection.HtmlText) -
متن اولیهپیشنهاد
-

@Model.PoemSection.RhymeLetters

-
-

@Model.Correction.RhymeLetters

-
- - @if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) - { +
+ +

@Model.PoemSection.RhymeLetters

+
+
+ +

@Model.Correction.RhymeLetters

+
+
+ @if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { +
- -
+
+
- } - else - { + +
+ } + else + { +
- -
+
+
- } -
+ +
+ } +
-
+ +
+
-
- -
- زبان -
متن اولیهپیشنهاد
-

@Model.Correction.OriginalLanguage

-
-

@Model.Correction.Language

-
- @if (Model.Correction.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) - { +

زبان

+
+ +

@Model.Correction.OriginalLanguage

+
+
+ +

@Model.Correction.Language

+
+
+ @if (Model.Correction.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { +
- -
+
+
- } - else - { + +
+ } + else + { +
- -
+
+
- } -
+ +
+ } +
-
+ +
+
-
+ +
+
-
- -
- قالب شعری -
متن اولیهپیشنهاد
-

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)

-
-

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.PoemFormat)

-
- @if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) - { +

قالب شعری

+
+ +

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)

+
+
+ +

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.PoemFormat)

+
+
+ @if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { +
- -
+
+
- } - else - { + +
+ } + else + { +
- -
+
+
- } -
+ +
+ } +
-
+ +
+
-
+ +
+
-
- -
یادداشت: - @Model.Correction.Note -
+ if ( + Model.Correction.BreakFromVerse1VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse2VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse3VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse4VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse5VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse6VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse7VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse8VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse9VOrder == Model.Verses[v].VOrder + || + Model.Correction.BreakFromVerse10VOrder == Model.Verses[v].VOrder + ) + { +
- @Model.Verses[v].Text -
- @Model.Verses[v].Text -
یادداشت بررسی:
- خودم ویرایش کنم -
+
+ بررسی +
+ +
+
+
} diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml index fda6e316..82332b4b 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml @@ -1,4 +1,4 @@ -@page +@page @using DNTPersianUtils.Core @model GanjooRazor.Areas.Admin.Pages.ReviewQuotedsModel @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @@ -6,294 +6,140 @@ Layout = "_AdminLayout"; ViewData["Title"] = "بازبینی مشق‌شعرهای پیشنهادی"; } - -

@ViewData["Title"]

+
+

@ViewData["Title"]

+
@if (!string.IsNullOrEmpty(Model.FatalError)) { -

@Model.FatalError

+
@Model.FatalError
} -else if (@Model.GanjoorQuotedPoem == null) +else if (Model.GanjoorQuotedPoem == null) { -

پیشنهادی وجود ندارد.

+ } else { -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- تعداد کل: @Model.TotalCount -
- پیشنهاد دهنده: -
- @Model.SuggestedBy.NickName -
- - تأیید می‌شود؟ -
+
+

تعداد کل: @Model.TotalCount

+
+ + +
- -
- -
- -
- بعدی -
+ + +
+ + +
+
+ + +
+
+ + بعدی +
+
+ - - +
+

بیت مرجع از شعر

-
- - - - - - - - - - - - - - - - - - - - - - - + @if (Model.GanjoorQuotedPoem.CoupletIndex != null && Model.GanjoorQuotedPoem.CoupletIndex != -1) + { +

@($"{(Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item2}")

+ } + +
+ + +
+
+ + +
+
+ +
@Model.GanjoorQuotedPoem.PoetId
+
@if (Model.GanjoorQuotedPoem.RelatedPoemId != null) { - - - +

مشاهدهٔ شعر مرتبط

} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- بیت مرجع از شعر: -
- @if (Model.GanjoorQuotedPoem.CoupletIndex != null && Model.GanjoorQuotedPoem.CoupletIndex != -1) - { -

@($"{(Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item2}")

- } -
- مصرع اول مهم است: -
- -
- مصرع دوم مهم است: -
- -
- شاعر مرجع: -
-

@Model.GanjoorQuotedPoem.PoetId

-
- مشاهدهٔ شعر مرتبط -
- بیت مرتبط: -
- @if (Model.GanjoorQuotedPoem.RelatedCoupletIndex != null && Model.GanjoorQuotedPoem.RelatedCoupletIndex != -1) +
+ + @if (Model.GanjoorQuotedPoem.RelatedCoupletIndex != null && Model.GanjoorQuotedPoem.RelatedCoupletIndex != -1) + { + if (Model.GanjoorQuotedPoem.RelatedCoupletIndex < Model.RelatedCouplets.Length) { - if (Model.GanjoorQuotedPoem.RelatedCoupletIndex < Model.RelatedCouplets.Length) - { -

@($"{(Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item2}")

- } - else{ -

خطا

- } - +

@($"{(Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item2}")

} + else + { +

خطا

+ } + } +
-
- مصرع اول مرتبط (خارج از گنجور): -
-

@Model.GanjoorQuotedPoem.RelatedCoupletVerse1

-
- مصرع اول مهم است: -
- -
- مصرع دوم مرتبط (خارج از گنجور): -
-

@Model.GanjoorQuotedPoem.RelatedCoupletVerse2

-
- مصرع دوم مهم است: -
- -
- ترتیب: -
-

@Model.GanjoorQuotedPoem.SortOrder

-
- این شعر قدیمی‌تر از شعر مرتبط است: -
- -
- منتسب به هر دو شاعر: -
- -
- شاعر: -
-

@Model.GanjoorQuotedPoem.RelatedPoetId

-
-

@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetName

-
- سالمرگ شاعر: -
-

@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri

-
- نشانی صفحهٔ شاعر: -
- @Model.GanjoorQuotedPoem.CachedRelatedPoemPoetUrl -
- تصویر شاعر: -
- -
- عنوان شعر: -
-

@Model.GanjoorQuotedPoem.CachedRelatedPoemFullTitle

-
- نشانی شعر: -
- @Model.GanjoorQuotedPoem.CachedRelatedPoemFullUrl -
- یادداشت: -
-

@Model.GanjoorQuotedPoem.Note

-
- - - +
+ +
@Model.GanjoorQuotedPoem.RelatedCoupletVerse1
+
+
+ + +
+
+ +
@Model.GanjoorQuotedPoem.RelatedCoupletVerse2
+
+
+ + +
+
+ +
@Model.GanjoorQuotedPoem.SortOrder
+
+
+ + +
+
+ + +
+
+ +
@Model.GanjoorQuotedPoem.RelatedPoetId - @Model.GanjoorQuotedPoem.CachedRelatedPoemPoetName
+
+
+ +
@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri
+
+
+ + +
+
+ + +
+
+ +
@Model.GanjoorQuotedPoem.CachedRelatedPoemFullTitle
+
+ +
+ +
@Model.GanjoorQuotedPoem.Note
+
+ } diff --git a/GanjooRazor/wwwroot/css/user-panel.css b/GanjooRazor/wwwroot/css/user-panel.css index 83d941d0..77467528 100644 --- a/GanjooRazor/wwwroot/css/user-panel.css +++ b/GanjooRazor/wwwroot/css/user-panel.css @@ -469,6 +469,20 @@ body.up-modal-open { transform: translateY(-2px); } +/* ---------- moderation review-result radio options ---------- */ + +.up-radio-option { + display: flex; + align-items: center; + gap: var(--up-space-1); + padding: 3px 0; +} + +.up-radio-option label { + margin: 0; + cursor: pointer; +} + /* ---------- small utilities ---------- */ .up-mt-0 { margin-top: 0; } @@ -529,6 +543,7 @@ body.up-modal-open { } .up-field--ltr input, +.up-field--ltr textarea, .up-field--ltr .up-field-static { direction: ltr; text-align: left;