From db9bce70fd0218b199640d19734f0f8a49a96790 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Sun, 4 Jun 2023 09:08:52 +0330 Subject: [PATCH] #383 moderation of poem format suggestions --- .../Areas/Admin/Pages/ReviewEdits.cshtml | 57 +++++++++++++++++++ .../Areas/Admin/Pages/ReviewEdits.cshtml.cs | 17 +++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml index 1e749d23..a522c98c 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml @@ -65,6 +65,11 @@ rhymeReviewResult = $('input[name=rhyme_review_result]:checked').val() } + var poemformatReviewResult = 'DontCare'; + if ($('#poemformat_review_result_Approved').length > 0) { + poemformatReviewResult = $('input[name=poemformat_review_result]:checked').val() + } + var verseReviewResult = []; var versePosReviewResult = []; @@ -141,6 +146,8 @@ verseSummaryResults: verseSummaryResults, verseLanguageReviewResult: verseLanguageReviewResult, verseReviewNotes: verseReviewNotes, + poemformatReviewResult: poemformatReviewResult, + poemformatReviewNote: $('#poemformat_review_note') == null ? null : $('#poemformat_review_note').val(), }, success: function() { location.reload(true); @@ -491,6 +498,56 @@ else } + @if (Model.Correction.PoemFormat != null) + { + + + قالب شعری + + + + متن اولیه + پیشنهاد + + + +

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat?)Model.Correction.OriginalPoemFormat)

+ + +

@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat?)Model.Correction.PoemFormat)

+ + + + + + @if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) + { + + + +
+ + } + else + { + + + +
+ + } +
+ +
+ +
+ +
+ + + + } + @if (Model.Correction.PoemSummary != null) { diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml.cs b/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml.cs index b82dc778..447db0d2 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml.cs +++ b/GanjooRazor/Areas/Admin/Pages/ReviewEdits.cshtml.cs @@ -228,7 +228,9 @@ namespace GanjooRazor.Areas.Admin.Pages string[] versePosReviewResult, string[] verseSummaryResults, string[] verseLanguageReviewResult, - string[] verseReviewNotes + string[] verseReviewNotes, + string poemformatReviewResult, + string poemformatReviewNote ) { using (HttpClient secureClient = new HttpClient()) @@ -308,6 +310,19 @@ namespace GanjooRazor.Areas.Admin.Pages } } + if (Correction.PoemFormat != null) + { + if (poemformatReviewResult == null) + { + return new BadRequestObjectResult("لطفاً تغییر قالب شعری را بازبینی کنید."); + } + else + { + Correction.PoemFormatReviewResult = (CorrectionReviewResult)Enum.Parse(typeof(CorrectionReviewResult), poemformatReviewResult); + Correction.ReviewNote = poemformatReviewNote; + } + } + if (verseReviewResult.Length != Correction.VerseOrderText.Length) { return new BadRequestObjectResult("لطفاً تکلیف بررسی تمام مصرعهای پیشنهادی را مشخص کنید.");