link for editing moderating sections
This commit is contained in:
parent
fbac928a51
commit
cbe93243e7
@ -9,6 +9,10 @@
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<a role="button" href="/Admin/ReviewPartEdits/?deletedUserSections=true" class="pagebutton">پیشنهادهای سیستمی</a>
|
||||
|
||||
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.FatalError))
|
||||
{
|
||||
<p>@Model.FatalError</p>
|
||||
@ -342,9 +346,14 @@ else
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@if(Model.PoemSection != null)
|
||||
{
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a role="button" href=@($"/User/Section?poemId={Model.PoemSection.PoemId}&index={Model.PoemSection.Index}") class="pagebutton" target="_blank">خودم ویرایش کنم</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
}
|
||||
|
||||
@ -37,6 +37,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// deleted user sections
|
||||
/// </summary>
|
||||
public bool DeletedUserSections { get; set; }
|
||||
|
||||
public PoemRelatedImage TextSourceImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -91,11 +96,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FatalError = "";
|
||||
TotalCount = 0;
|
||||
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
|
||||
DeletedUserSections = string.IsNullOrEmpty(Request.Query["deletedUserSections"]) ? false : bool.Parse(Request.Query["deletedUserSections"]);
|
||||
using (HttpClient secureClient = new HttpClient())
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/next?skip={Skip}");
|
||||
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/next?skip={Skip}&deletedUserSections={DeletedUserSections}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
|
||||
@ -161,9 +167,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public IActionResult OnPost()
|
||||
{
|
||||
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
|
||||
DeletedUserSections = string.IsNullOrEmpty(Request.Query["deletedUserSections"]) ? false : bool.Parse(Request.Query["deletedUserSections"]);
|
||||
if (Request.Form["next"].Count == 1)
|
||||
{
|
||||
return Redirect($"/Admin/ReviewPartEdits/?skip={Skip + 1}");
|
||||
return Redirect($"/Admin/ReviewPartEdits/?skip={Skip + 1}&deletedUserSections={DeletedUserSections}");
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user