#186 processing Skip parameter in ReviewEdits
This commit is contained in:
parent
954dd90c1a
commit
a8ba4ade11
@ -186,7 +186,9 @@ else
|
||||
<button type="submit" name="review" id="review" style="width:100%;color:white;background-color:green">بررسی</button>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" name="next" id="next" style="width:100%;color:white;background-color:orange">بعدی</button>
|
||||
<form method="post">
|
||||
<button type="submit" name="next" id="next" style="width:100%;color:white;background-color:orange">بعدی</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@ -56,36 +56,39 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
|
||||
}
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
|
||||
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Correction.PoemId}");
|
||||
pageUrlResponse.EnsureSuccessStatusCode();
|
||||
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
|
||||
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
pageQuery.EnsureSuccessStatusCode();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
|
||||
if(Correction.Title != null)
|
||||
if(Correction != null)
|
||||
{
|
||||
Correction.OriginalTitle = PageInformation.Poem.Title;
|
||||
if (Correction.OriginalTitle == Correction.Title)
|
||||
Correction.Result = CorrectionReviewResult.NotChanged;
|
||||
}
|
||||
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Correction.PoemId}");
|
||||
pageUrlResponse.EnsureSuccessStatusCode();
|
||||
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
|
||||
|
||||
if(Correction.VerseOrderText != null)
|
||||
foreach(var verse in Correction.VerseOrderText)
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
pageQuery.EnsureSuccessStatusCode();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
|
||||
if (Correction.Title != null)
|
||||
{
|
||||
verse.OriginalText = PageInformation.Poem.Verses.Where(v => v.VOrder == verse.VORder).Single().Text;
|
||||
if (verse.OriginalText == verse.Text)
|
||||
verse.Result = CorrectionReviewResult.NotChanged;
|
||||
Correction.OriginalTitle = PageInformation.Poem.Title;
|
||||
if (Correction.OriginalTitle == Correction.Title)
|
||||
Correction.Result = CorrectionReviewResult.NotChanged;
|
||||
}
|
||||
|
||||
if (Correction.Rhythm != null)
|
||||
{
|
||||
Correction.OriginalRhythm = PageInformation.Poem.GanjoorMetre.Rhythm;
|
||||
if (Correction.OriginalRhythm == Correction.Rhythm)
|
||||
Correction.RhythmResult = CorrectionReviewResult.NotChanged;
|
||||
if (Correction.VerseOrderText != null)
|
||||
foreach (var verse in Correction.VerseOrderText)
|
||||
{
|
||||
verse.OriginalText = PageInformation.Poem.Verses.Where(v => v.VOrder == verse.VORder).Single().Text;
|
||||
if (verse.OriginalText == verse.Text)
|
||||
verse.Result = CorrectionReviewResult.NotChanged;
|
||||
}
|
||||
|
||||
if (Correction.Rhythm != null)
|
||||
{
|
||||
Correction.OriginalRhythm = PageInformation.Poem.GanjoorMetre.Rhythm;
|
||||
if (Correction.OriginalRhythm == Correction.Rhythm)
|
||||
Correction.RhythmResult = CorrectionReviewResult.NotChanged;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -94,5 +97,15 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
|
||||
public IActionResult OnPost()
|
||||
{
|
||||
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
|
||||
if (Request.Form["next"].Count == 1)
|
||||
{
|
||||
return Redirect($"/Admin/ReviewEdits/?skip={Skip + 1}");
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user