docs: #363 bug fix

This commit is contained in:
Hamid Reza Mohammadi 2023-02-12 21:49:07 +03:30
parent 549c325c8f
commit f5a63af7eb
3 changed files with 19 additions and 5 deletions

View File

@ -62,7 +62,12 @@ else
rhyme_letters = null;
}
if (breakFromVIndices.length == 0 && rhythm_new == null && rhyme_letters == null) {
var section_lang = $('#language').val();
if (section_lang == $('#language-old').text()) {
section_lang = null;
}
if (breakFromVIndices.length == 0 && rhythm_new == null && rhyme_letters == null && section_lang == null) {
alert('شما هیچ تغییری در متن نداده‌اید!');
return;
}
@ -81,7 +86,8 @@ else
rhythm: rhythm_new,
rhyme: rhyme_letters,
breakFromVIndices: breakFromVIndices,
note: $('#note').val()
note: $('#note').val(),
lang: section_lang
},
success: function () {
@ -345,7 +351,8 @@ else
<tr>
<td>
<p id="language-old">@Model.LanguageNameFromCode(Model.PoemSection.Language)</p>
@Model.LanguageNameFromCode(Model.PoemSection.Language)
<div id="language-old">@Model.PoemSection.Language</div>
</td>
</tr>

View File

@ -154,6 +154,10 @@ namespace GanjooRazor.Areas.User.Pages
RhythmsAlphabetically = rhythmsByVerseCount.ToArray();
PoemSection = PageInformation.Poem.Sections.Where(s => s.Index == int.Parse(Request.Query["index"])).Single();
if(string.IsNullOrEmpty(PoemSection.Language))
{
PoemSection.Language = "fa-IR";
}
int index = Array.IndexOf(PageInformation.Poem.Sections, PoemSection);
if(index > 0)
@ -183,7 +187,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page();
}
public async Task<IActionResult> OnPostSendSectionCorrectionsAsync(int sectionId, string rhythm, string rhyme, int[] breakFromVIndices, string note)
public async Task<IActionResult> OnPostSendSectionCorrectionsAsync(int sectionId, string rhythm, string rhyme, int[] breakFromVIndices, string note, string lang)
{
using (HttpClient secureClient = new HttpClient())
{
@ -300,7 +304,8 @@ namespace GanjooRazor.Areas.User.Pages
BreakFromVerse8VOrder = breakFromVerse8VOrder,
BreakFromVerse9VOrder = breakFromVerse9VOrder,
BreakFromVerse10VOrder = breakFromVerse10VOrder,
Note = note
Note = note,
Language = lang,
};
HttpResponseMessage response = await secureClient.PostAsync(

View File

@ -883,6 +883,8 @@ namespace RMuseum.Services.Implementation
Date = DateTime.Now,
Reviewed = false,
AffectedThePoem = false,
Language = correction.Language,
LanguageReviewResult = CorrectionReviewResult.NotReviewed,
};
_context.GanjoorPoemSectionCorrections.Add(dbCorrection);
await _context.SaveChangesAsync();