#467 cat editor
This commit is contained in:
parent
d345dac18b
commit
def19f06b4
@ -12,7 +12,6 @@ using RMuseum.Models.Ganjoor;
|
||||
using static GanjooRazor.Areas.Admin.Pages.ReviewEditsModel;
|
||||
using System.Text;
|
||||
using System;
|
||||
using Org.BouncyCastle.Asn1.Cmp;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
@ -95,6 +94,16 @@ 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/ReviewCatEdits/?skip={Skip + 1}");
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient())
|
||||
|
||||
@ -76,7 +76,7 @@ namespace RMuseum.Services.Implementation
|
||||
|
||||
dbCorrection.AffectedTheCat = true;
|
||||
dbCat.DescriptionHtml = moderation.DescriptionHtml.Replace("ۀ", "هٔ").Replace("ك", "ک");
|
||||
dbCat.Description = Regex.Replace(dbCat.DescriptionHtml, "<.*?>", String.Empty);
|
||||
dbCat.Description = moderation.Description;
|
||||
|
||||
if(dbCat.ParentId == null)
|
||||
{
|
||||
|
||||
@ -47,7 +47,14 @@ namespace RMuseum.Utils
|
||||
string textWithoutTags = Regex.Replace(input, "<.*?>", string.Empty);
|
||||
|
||||
// Decode HTML entities (e.g., & → &)
|
||||
return HttpUtility.HtmlDecode(textWithoutTags);
|
||||
textWithoutTags = HttpUtility.HtmlDecode(textWithoutTags);
|
||||
|
||||
//it seems some codes are not correctly converted:
|
||||
textWithoutTags = textWithoutTags.Replace("‌", "");
|
||||
textWithoutTags = textWithoutTags.Replace("«", "»");
|
||||
textWithoutTags = textWithoutTags.Replace("»", "«");
|
||||
|
||||
return textWithoutTags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user