Rename Ganjoor -> Diwan throughout the code

Projects (GanjooRazor -> DiwanRazor, GanjoorService.sln -> DiwanService.sln), files,
folders, classes, namespaces, settings, API routes (/api/diwan) and DB tables (Diwan*).
External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed
consistently (no pending model changes); requires a fresh database.
Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anas Rashid 2026-10-04 23:49:01 +02:00
parent 24add6c820
commit e8f2306422
1017 changed files with 37325 additions and 37320 deletions

View File

@ -1,7 +1,7 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using System.IO; using System.IO;
namespace GanjooRazor namespace DiwanRazor
{ {
/// <summary> /// <summary>
/// API Root /// API Root

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.BannersModel @model DiwanRazor.Areas.Admin.Pages.BannersModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -46,7 +46,7 @@
<tr id="tr-@banner.Id"> <tr id="tr-@banner.Id">
<td>متن جایگزین: <input type="text" name="alt-@banner.Id" id="alt-@banner.Id" value="@banner.AlternateText" /> </td> <td>متن جایگزین: <input type="text" name="alt-@banner.Id" id="alt-@banner.Id" value="@banner.AlternateText" /> </td>
<td>نشانی مقصد:<input type="text" name="url-@banner.Id" id="url-@banner.Id" style="text-align:left;direction:ltr;" value=@banner.TargetUrl /> </td> <td>نشانی مقصد:<input type="text" name="url-@banner.Id" id="url-@banner.Id" style="text-align:left;direction:ltr;" value=@banner.TargetUrl /> </td>
<td><img src="@($"{GanjooRazor.APIRoot.InternetUrl}/{banner.ImageUrl}")" alt="@banner.AlternateText" width="200" /></td> <td><img src="@($"{DiwanRazor.APIRoot.InternetUrl}/{banner.ImageUrl}")" alt="@banner.AlternateText" width="200" /></td>
@if (banner.Active) @if (banner.Active)
{ {
<td>فعال <input type="checkbox" name="active-@banner.Id" id="active-@banner.Id" checked /> </td> <td>فعال <input type="checkbox" name="active-@banner.Id" id="active-@banner.Id" checked /> </td>

View File

@ -1,16 +1,16 @@
using GanjooRazor.Models; using DiwanRazor.Models;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class BannersModel : PageModel public class BannersModel : PageModel
{ {
@ -29,7 +29,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// banners /// banners
/// </summary> /// </summary>
public GanjoorSiteBannerViewModel[] Banners { get; set; } public DiwanSiteBannerViewModel[] Banners { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
@ -38,9 +38,9 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/banners"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/banners");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -49,7 +49,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
Banners = JsonConvert.DeserializeObject<GanjoorSiteBannerViewModel[]>(await response.Content.ReadAsStringAsync()); Banners = JsonConvert.DeserializeObject<DiwanSiteBannerViewModel[]>(await response.Content.ReadAsStringAsync());
} }
} }
else else
@ -69,11 +69,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPutEditAsync(int id, string alt, string url, bool active) public async Task<IActionResult> OnPutEditAsync(int id, string alt, string url, bool active)
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
GanjoorSiteBannerModifyViewModel model = new GanjoorSiteBannerModifyViewModel() DiwanSiteBannerModifyViewModel model = new DiwanSiteBannerModifyViewModel()
{ {
AlternateText = alt, AlternateText = alt,
TargetUrl = url, TargetUrl = url,
@ -99,9 +99,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/banners?id={id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/banners?id={id}");
@ -122,9 +122,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync(BannerUploadModel Upload) public async Task<IActionResult> OnPostAsync(BannerUploadModel Upload)
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
MultipartFormDataContent form = new MultipartFormDataContent(); MultipartFormDataContent form = new MultipartFormDataContent();

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.CatDelModel @model DiwanRazor.Areas.Admin.Pages.CatDelModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,13 +1,13 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class CatDelModel : PageModel public class CatDelModel : PageModel
{ {
@ -28,7 +28,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// category /// category
/// </summary> /// </summary>
public GanjoorPoetCompleteViewModel Cat { get; set; } public DiwanPoetCompleteViewModel Cat { get; set; }
/// <summary> /// <summary>
@ -42,26 +42,26 @@ namespace GanjooRazor.Areas.Admin.Pages
return Redirect("/"); return Redirect("/");
LastResult = ""; LastResult = "";
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Request.Query["id"]}"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Cat = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorPoetCompleteViewModel>(); Cat = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DiwanPoetCompleteViewModel>();
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/cat/{Request.Query["id"]}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/cat/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.CatTransModel @model DiwanRazor.Areas.Admin.Pages.CatTransModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -3,17 +3,17 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class CatTransModel : PageModel public class CatTransModel : PageModel
{ {
@ -25,7 +25,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// poems /// poems
/// </summary> /// </summary>
public GanjoorDuplicateViewModel[] Poems { get; set; } public DiwanDuplicateViewModel[] Poems { get; set; }
/// <summary> /// <summary>
@ -47,11 +47,11 @@ namespace GanjooRazor.Areas.Admin.Pages
return false; return false;
} }
CatId = int.Parse(Request.Query["id"]); CatId = int.Parse(Request.Query["id"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/duplicates/{CatId}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/duplicates/{CatId}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -59,7 +59,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
Poems = JsonConvert.DeserializeObject<GanjoorDuplicateViewModel[]>(await response.Content.ReadAsStringAsync()); Poems = JsonConvert.DeserializeObject<DiwanDuplicateViewModel[]>(await response.Content.ReadAsStringAsync());
if(!string.IsNullOrEmpty(Request.Query["empty"])) if(!string.IsNullOrEmpty(Request.Query["empty"]))
{ {
@ -89,11 +89,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostFindDuplicatesAsync() public async Task<IActionResult> OnPostFindDuplicatesAsync()
{ {
CatId = int.Parse(Request.Query["id"]); CatId = int.Parse(Request.Query["id"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/duplicates/{CatId}/{DestCatId}?hardTry=true", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/duplicates/{CatId}/{DestCatId}?hardTry=true", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -116,11 +116,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostFinalizeAsync() public async Task<IActionResult> OnPostFinalizeAsync()
{ {
CatId = int.Parse(Request.Query["id"]); CatId = int.Parse(Request.Query["id"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/duplicates/finish/{CatId}/{DestCatId}", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/duplicates/finish/{CatId}/{DestCatId}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -142,11 +142,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/duplicates/{id}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/duplicates/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.CatUtilsModel @model DiwanRazor.Areas.Admin.Pages.CatUtilsModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
@ -317,9 +317,9 @@
@if (poem.MainSections.Length <= 1) @if (poem.MainSections.Length <= 1)
{ {
<td> <td>
@if(poem.MainSections.Length == 1 && @poem.MainSections[0].GanjoorMetre != null) @if(poem.MainSections.Length == 1 && @poem.MainSections[0].DiwanMetre != null)
{ {
@poem.MainSections[0].GanjoorMetre.Rhythm @poem.MainSections[0].DiwanMetre.Rhythm
} }
</td> </td>
<td> <td>
@ -352,9 +352,9 @@
@s.Excerpt @s.Excerpt
</td> </td>
<td> <td>
@if (s.GanjoorMetre != null) @if (s.DiwanMetre != null)
{ {
@s.GanjoorMetre.Rhythm @s.DiwanMetre.Rhythm
} }
</td> </td>
<td> <td>
@ -451,9 +451,9 @@
</td> </td>
<td> <td>
<select id="cat-poem-format"> <select id="cat-poem-format">
@foreach (var poemFormat in System.Enum.GetValues(typeof(RMuseum.Models.Ganjoor.GanjoorPoemFormat))) @foreach (var poemFormat in System.Enum.GetValues(typeof(RMuseum.Models.Diwan.DiwanPoemFormat)))
{ {
<option value="@poemFormat">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option> <option value="@poemFormat">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString((RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat)</option>
} }
</select> </select>
</td> </td>

View File

@ -1,20 +1,20 @@
using GanjooRazor.Pages; using DiwanRazor.Pages;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.IO; using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class CatUtilsModel : GanjoorPageModelBase public class CatUtilsModel : DiwanPageModelBase
{ {
/// <summary> /// <summary>
/// constructor /// constructor
@ -28,21 +28,21 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// category /// category
/// </summary> /// </summary>
public GanjoorPoetCompleteViewModel Cat { get; set; } public DiwanPoetCompleteViewModel Cat { get; set; }
/// <summary> /// <summary>
/// cat page /// cat page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
[BindProperty] [BindProperty]
public GanjoorBatchNamingModel NamingModel { get; set; } public DiwanBatchNamingModel NamingModel { get; set; }
/// <summary> /// <summary>
/// rythm /// rythm
/// </summary> /// </summary>
public GanjoorMetre[] Rhythms { get; set; } public DiwanMetre[] Rhythms { get; set; }
/// <summary> /// <summary>
@ -58,18 +58,18 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// numbering patterns /// numbering patterns
/// </summary> /// </summary>
public GanjoorNumbering[] Numberings { get; set; } public DiwanNumbering[] Numberings { get; set; }
/// <summary> /// <summary>
/// numbering model /// numbering model
/// </summary> /// </summary>
[BindProperty] [BindProperty]
public GanjoorNumbering NumberingModel { get; set; } public DiwanNumbering NumberingModel { get; set; }
public GanjoorLanguage[] Languages { get; set; } public DiwanLanguage[] Languages { get; set; }
[BindProperty] [BindProperty]
public GanjoorCatViewModel CatMeta { get; set; } public DiwanCatViewModel CatMeta { get; set; }
public PoemRelatedImageEx[] PoemRelatedImages { get; set; } public PoemRelatedImageEx[] PoemRelatedImages { get; set; }
@ -82,7 +82,7 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync()); Languages = JsonConvert.DeserializeObject<DiwanLanguage[]>(await response.Content.ReadAsStringAsync());
} }
[BindProperty] [BindProperty]
@ -90,17 +90,17 @@ namespace GanjooRazor.Areas.Admin.Pages
private async Task<bool> GetInformationAsync() private async Task<bool> GetInformationAsync()
{ {
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat?url={Request.Query["url"]}&poems=true&mainSections=true"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/cat?url={Request.Query["url"]}&poems=true&mainSections=true");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(response); LastMessage = await ReadErrorMessageAsync(response);
return false; return false;
} }
Cat = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync()); Cat = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
if (CatMeta == null) if (CatMeta == null)
{ {
CatMeta = new GanjoorCatViewModel() CatMeta = new DiwanCatViewModel()
{ {
Id = Cat.Cat.Id, Id = Cat.Cat.Id,
BookName = Cat.Cat.BookName, BookName = Cat.Cat.BookName,
@ -110,21 +110,21 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={Request.Query["url"]}"); var pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={Request.Query["url"]}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(pageQuery); LastMessage = await ReadErrorMessageAsync(pageQuery);
return false; return false;
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
var rhythmsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms"); var rhythmsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms");
if (!rhythmsResponse.IsSuccessStatusCode) if (!rhythmsResponse.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(rhythmsResponse); LastMessage = await ReadErrorMessageAsync(rhythmsResponse);
return false; return false;
} }
Rhythms = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmsResponse.Content.ReadAsStringAsync()); Rhythms = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmsResponse.Content.ReadAsStringAsync());
var numberings = await _httpClient.GetAsync($"{APIRoot.Url}/api/numberings/cat/{Cat.Cat.Id}"); var numberings = await _httpClient.GetAsync($"{APIRoot.Url}/api/numberings/cat/{Cat.Cat.Id}");
if (!numberings.IsSuccessStatusCode) if (!numberings.IsSuccessStatusCode)
@ -132,11 +132,11 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = await ReadErrorMessageAsync(numberings); LastMessage = await ReadErrorMessageAsync(numberings);
return false; return false;
} }
Numberings = JsonConvert.DeserializeObject<GanjoorNumbering[]>(await numberings.Content.ReadAsStringAsync()); Numberings = JsonConvert.DeserializeObject<DiwanNumbering[]>(await numberings.Content.ReadAsStringAsync());
if (!string.IsNullOrEmpty(Request.Query["images"])) if (!string.IsNullOrEmpty(Request.Query["images"]))
{ {
var images = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Cat.Cat.Id}/images"); var images = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/{Cat.Cat.Id}/images");
if (!images.IsSuccessStatusCode) if (!images.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(images); LastMessage = await ReadErrorMessageAsync(images);
@ -168,7 +168,7 @@ namespace GanjooRazor.Areas.Admin.Pages
await GetInformationAsync(); await GetInformationAsync();
NamingModel = new GanjoorBatchNamingModel() NamingModel = new DiwanBatchNamingModel()
{ {
StartWithNotIncludingSpaces = "شمارهٔ ", StartWithNotIncludingSpaces = "شمارهٔ ",
RemovePreviousPattern = true, RemovePreviousPattern = true,
@ -176,7 +176,7 @@ namespace GanjooRazor.Areas.Admin.Pages
Simulate = true Simulate = true
}; };
NumberingModel = new GanjoorNumbering() NumberingModel = new DiwanNumbering()
{ {
Name = Cat.Cat.Title, Name = Cat.Cat.Title,
StartCatId = Cat.Cat.Id, StartCatId = Cat.Cat.Id,
@ -191,11 +191,11 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
/// <param name="NamingModel"></param> /// <param name="NamingModel"></param>
/// <returns></returns> /// <returns></returns>
public async Task<IActionResult> OnPostAsync(GanjoorBatchNamingModel NamingModel) public async Task<IActionResult> OnPostAsync(DiwanBatchNamingModel NamingModel)
{ {
await GetInformationAsync(); await GetInformationAsync();
NumberingModel = new GanjoorNumbering() NumberingModel = new DiwanNumbering()
{ {
Name = Cat.Cat.Title, Name = Cat.Cat.Title,
StartCatId = Cat.Cat.Id, StartCatId = Cat.Cat.Id,
@ -205,15 +205,15 @@ namespace GanjooRazor.Areas.Admin.Pages
// Full-page form post: re-renders the page with LastMessage on failure rather than // Full-page form post: re-renders the page with LastMessage on failure rather than
// returning a bare error result, so this keeps its own client/session block instead of // returning a bare error result, so this keeps its own client/session block instead of
// going through WithSecureClientAsync (which is for AJAX-style handlers). // going through WithSecureClientAsync (which is for AJAX-style handlers).
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
if (Request.Form["renameSubcats"].Count == 1) if (Request.Form["renameSubcats"].Count == 1)
{ {
foreach (var subCat in Cat.Cat.Children) foreach (var subCat in Cat.Cat.Children)
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/recaptionpoems/{subCat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/recaptionpoems/{subCat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(response); LastMessage = await ReadErrorMessageAsync(response);
@ -227,7 +227,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/recaptionpoems/{Cat.Cat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/recaptionpoems/{Cat.Cat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(response); LastMessage = await ReadErrorMessageAsync(response);
@ -245,12 +245,12 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostNumberingAsync(GanjoorNumbering NumberingModel) public async Task<IActionResult> OnPostNumberingAsync(DiwanNumbering NumberingModel)
{ {
// Same note as OnPostAsync above re: full-page form post. // Same note as OnPostAsync above re: full-page form post.
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/numberings", new StringContent(JsonConvert.SerializeObject(NumberingModel), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/numberings", new StringContent(JsonConvert.SerializeObject(NumberingModel), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -261,7 +261,7 @@ namespace GanjooRazor.Areas.Admin.Pages
await GetInformationAsync(); await GetInformationAsync();
NamingModel = new GanjoorBatchNamingModel() NamingModel = new DiwanBatchNamingModel()
{ {
StartWithNotIncludingSpaces = "شمارهٔ ", StartWithNotIncludingSpaces = "شمارهٔ ",
RemovePreviousPattern = true, RemovePreviousPattern = true,
@ -289,7 +289,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/startassigningrhymes/{id}/{false}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/startassigningrhymes/{id}/{false}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -302,7 +302,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/subcats/startgentoc/{id}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/subcats/startgentoc/{id}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -315,7 +315,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/startassigningrhythms/{id}/{false}?rhythm={rhythm}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/startassigningrhythms/{id}/{false}?rhythm={rhythm}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -328,7 +328,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/{id}/regenrelatedsections", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/{id}/regenrelatedsections", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -341,7 +341,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/language/{id}/{language}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/language/{id}/{language}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -350,11 +350,11 @@ namespace GanjooRazor.Areas.Admin.Pages
}, new OkObjectResult(false)); }, new OkObjectResult(false));
} }
public Task<IActionResult> OnPostSetCategoryPoemFormatAsync(int id, GanjoorPoemFormat format) public Task<IActionResult> OnPostSetCategoryPoemFormatAsync(int id, DiwanPoemFormat format)
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/poemformat/{id}/{format}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/poemformat/{id}/{format}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -395,9 +395,9 @@ namespace GanjooRazor.Areas.Admin.Pages
// Full-page form post (file upload): re-renders the page with LastMessage, so this keeps // Full-page form post (file upload): re-renders the page with LastMessage, so this keeps
// its own client/session block rather than using WithSecureClientAsync. // its own client/session block rather than using WithSecureClientAsync.
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
MultipartFormDataContent form = new MultipartFormDataContent(); MultipartFormDataContent form = new MultipartFormDataContent();
@ -407,7 +407,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var fileContent = stream.ToArray(); var fileContent = stream.ToArray();
form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Cat.Poet.Nickname, SQLiteDb.FileName); form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Cat.Poet.Nickname, SQLiteDb.FileName);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sqlite/import/cat/{Cat.Cat.Id}", form); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/sqlite/import/cat/{Cat.Cat.Id}", form);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(response); LastMessage = await ReadErrorMessageAsync(response);
@ -426,7 +426,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/poem/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/poem/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -439,7 +439,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/reslugpoems/{id}", null); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/reslugpoems/{id}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -448,16 +448,16 @@ namespace GanjooRazor.Areas.Admin.Pages
}, new OkObjectResult(false)); }, new OkObjectResult(false));
} }
public async Task<IActionResult> OnPostUpdateCatMeta(GanjoorCatViewModel CatMeta) public async Task<IActionResult> OnPostUpdateCatMeta(DiwanCatViewModel CatMeta)
{ {
await GetInformationAsync(); await GetInformationAsync();
// Full-page form post: re-renders the page with LastMessage on failure (or redirects on // Full-page form post: re-renders the page with LastMessage on failure (or redirects on
// success), so this keeps its own client/session block rather than using // success), so this keeps its own client/session block rather than using
// WithSecureClientAsync. // WithSecureClientAsync.
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
CatMeta.BookName ??= ""; CatMeta.BookName ??= "";
CatMeta.MapName ??= ""; CatMeta.MapName ??= "";
@ -478,7 +478,7 @@ namespace GanjooRazor.Areas.Admin.Pages
form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), CatMeta.BookName, CatMeta.NewImage.FileName); form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), CatMeta.BookName, CatMeta.NewImage.FileName);
} }
} }
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/extra/{Cat.Cat.Id}", form); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/extra/{Cat.Cat.Id}", form);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = await ReadErrorMessageAsync(response); LastMessage = await ReadErrorMessageAsync(response);
@ -497,7 +497,7 @@ namespace GanjooRazor.Areas.Admin.Pages
// consistent with the rest of this file via WithSecureClientAsync. // consistent with the rest of this file via WithSecureClientAsync.
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/naskban?naskbanUrl={url}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/naskban?naskbanUrl={url}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -510,7 +510,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return WithSecureClientAsync(async secureClient => return WithSecureClientAsync(async secureClient =>
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/source?sourceUrlSlug={tag}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/source?sourceUrlSlug={tag}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
@ -531,7 +531,7 @@ namespace GanjooRazor.Areas.Admin.Pages
}; };
} }
HttpResponseMessage responsePost = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/source/{id}", HttpResponseMessage responsePost = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/source/{id}",
new StringContent(JsonConvert.SerializeObject(source), Encoding.UTF8, "application/json") new StringContent(JsonConvert.SerializeObject(source), Encoding.UTF8, "application/json")
); );
if (!responsePost.IsSuccessStatusCode) if (!responsePost.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.DonationEditModel @model DiwanRazor.Areas.Admin.Pages.DonationEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,13 +1,13 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Accounting.ViewModels; using RMuseum.Models.Accounting.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class DonationEditModel : PageModel public class DonationEditModel : PageModel
{ {
@ -44,7 +44,7 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
var donation = JsonConvert.DeserializeObject<GanjoorDonationViewModel>(await response.Content.ReadAsStringAsync()); var donation = JsonConvert.DeserializeObject<DiwanDonationViewModel>(await response.Content.ReadAsStringAsync());
Donation = new UpdateDateDescriptionViewModel() Donation = new UpdateDateDescriptionViewModel()
{ {
@ -58,9 +58,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Donation), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Donation), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.DonationsModel @model DiwanRazor.Areas.Admin.Pages.DonationsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -4,14 +4,14 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Accounting.ViewModels; using RMuseum.Models.Accounting.ViewModels;
using RMuseum.Utils; using RMuseum.Utils;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class DonationsModel : PageModel public class DonationsModel : PageModel
{ {
@ -39,12 +39,12 @@ namespace GanjooRazor.Areas.Admin.Pages
public string EmailContent { get; set; } public string EmailContent { get; set; }
[BindProperty] [BindProperty]
public GanjoorDonationViewModel Donation { get; set; } public DiwanDonationViewModel Donation { get; set; }
/// <summary> /// <summary>
/// donations /// donations
/// </summary> /// </summary>
public GanjoorDonationViewModel[] Donations { get; set; } public DiwanDonationViewModel[] Donations { get; set; }
/// <summary> /// <summary>
/// show account info /// show account info
@ -60,11 +60,11 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Donations = JsonConvert.DeserializeObject<GanjoorDonationViewModel[]>(await response.Content.ReadAsStringAsync()); Donations = JsonConvert.DeserializeObject<DiwanDonationViewModel[]>(await response.Content.ReadAsStringAsync());
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible"); HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible");
if (!resAccountInfo.IsSuccessStatusCode) if (!resAccountInfo.IsSuccessStatusCode)
@ -87,7 +87,7 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
Donation = new GanjoorDonationViewModel() Donation = new DiwanDonationViewModel()
{ {
RecordDate = DateTime.Now.Date, RecordDate = DateTime.Now.Date,
Unit = "تومان" Unit = "تومان"
@ -101,7 +101,7 @@ namespace GanjooRazor.Areas.Admin.Pages
if(donation != null) if(donation != null)
{ {
int rowNumber = Donations.Length - Array.IndexOf(Donations, donation); int rowNumber = Donations.Length - Array.IndexOf(Donations, donation);
string donorName = GanjoorHtmlTools.StripHtmlTags(donation.DonorName); string donorName = DiwanHtmlTools.StripHtmlTags(donation.DonorName);
if(donorName.StartsWith("آقای")) if(donorName.StartsWith("آقای"))
{ {
donorName = $"جناب {donorName}"; donorName = $"جناب {donorName}";
@ -121,12 +121,12 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync(GanjoorDonationViewModel Donation) public async Task<IActionResult> OnPostAsync(DiwanDonationViewModel Donation)
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
Donation.ImportedRecord = false; Donation.ImportedRecord = false;
@ -159,9 +159,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildPageAsync() public async Task<IActionResult> OnPostRebuildPageAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null);
if(!response.IsSuccessStatusCode) if(!response.IsSuccessStatusCode)
@ -176,9 +176,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.EarlierVersionModel @model DiwanRazor.Areas.Admin.Pages.EarlierVersionModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,12 +1,12 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class EarlierVersionModel : PageModel public class EarlierVersionModel : PageModel
{ {
@ -19,7 +19,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// model /// model
/// </summary> /// </summary>
[BindProperty] [BindProperty]
public GanjoorModifyPageViewModel EarlierVersion { get; set; } public DiwanModifyPageViewModel EarlierVersion { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
@ -29,18 +29,18 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/oldversion/{Request.Query["id"]}"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/oldversion/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
EarlierVersion = JsonConvert.DeserializeObject<GanjoorModifyPageViewModel>(await response.Content.ReadAsStringAsync()); EarlierVersion = JsonConvert.DeserializeObject<DiwanModifyPageViewModel>(await response.Content.ReadAsStringAsync());
} }
else else

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.EditQuotedModel @model DiwanRazor.Areas.Admin.Pages.EditQuotedModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
@ -122,11 +122,11 @@
</p> </p>
@if (Model.GanjoorQuotedPoem != null && Model.Couplets != null) @if (Model.DiwanQuotedPoem != null && Model.Couplets != null)
{ {
<script> <script>
function selectGanjoorPage() { function selectDiwanPage() {
document.getElementById('display-frame').style.display = 'none'; document.getElementById('display-frame').style.display = 'none';
document.getElementById('select-poem').style.display = 'block'; document.getElementById('select-poem').style.display = 'block';
document.getElementById('finalize-select').style.display = 'block'; document.getElementById('finalize-select').style.display = 'block';
@ -142,18 +142,18 @@
var url = currentUrl.substring(currentUrl.indexOf('/', currentUrl.indexOf('//') + 2)); var url = currentUrl.substring(currentUrl.indexOf('/', currentUrl.indexOf('//') + 2));
fetch('@(GanjooRazor.APIRoot.InternetUrl)/api/ganjoor/page?url=' + url) fetch('@(DiwanRazor.APIRoot.InternetUrl)/api/diwan/page?url=' + url)
.then((response) => response.json()) .then((response) => response.json())
.then((json) => { .then((json) => {
upToast(String(json.poem.id)); upToast(String(json.poem.id));
document.getElementById('GanjoorQuotedPoem_RelatedPoemId').value = json.poem.id; document.getElementById('DiwanQuotedPoem_RelatedPoemId').value = json.poem.id;
document.getElementById('GanjoorQuotedPoem_RelatedPoetId').value = json.poem.category.poet.id; document.getElementById('DiwanQuotedPoem_RelatedPoetId').value = json.poem.category.poet.id;
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetName').value = json.poem.category.poet.nickname; document.getElementById('DiwanQuotedPoem_CachedRelatedPoemPoetName').value = json.poem.category.poet.nickname;
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri').value = json.poem.category.poet.deathYearInLHijri.toString(); document.getElementById('DiwanQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri').value = json.poem.category.poet.deathYearInLHijri.toString();
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetUrl').value = json.poem.category.poet.fullUrl; document.getElementById('DiwanQuotedPoem_CachedRelatedPoemPoetUrl').value = json.poem.category.poet.fullUrl;
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetImage').value = json.poem.category.poet.imageUrl; document.getElementById('DiwanQuotedPoem_CachedRelatedPoemPoetImage').value = json.poem.category.poet.imageUrl;
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemFullTitle').value = json.poem.fullTitle; document.getElementById('DiwanQuotedPoem_CachedRelatedPoemFullTitle').value = json.poem.fullTitle;
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemFullUrl').value = json.poem.fullUrl; document.getElementById('DiwanQuotedPoem_CachedRelatedPoemFullUrl').value = json.poem.fullUrl;
var coupletIndices = []; var coupletIndices = [];
var coupletTexts = []; var coupletTexts = [];
@ -170,7 +170,7 @@
} }
} }
var x = document.getElementById("GanjoorQuotedPoem_RelatedCoupletIndex"); var x = document.getElementById("DiwanQuotedPoem_RelatedCoupletIndex");
x.length = 0; x.length = 0;
for (var i = 0; i < coupletIndices.length; i++) { for (var i = 0; i < coupletIndices.length; i++) {
var option = document.createElement("option"); var option = document.createElement("option");
@ -232,15 +232,15 @@
<form method="post" class="up-form"> <form method="post" class="up-form">
@Html.AntiForgeryToken() @Html.AntiForgeryToken()
<p> <p>
بیت مرجع از <a href="/?p=@Model.GanjoorQuotedPoem.PoemId">شعر</a>: بیت مرجع از <a href="/?p=@Model.DiwanQuotedPoem.PoemId">شعر</a>:
<input type="hidden" asp-for="GanjoorQuotedPoem.Id" /> <input type="hidden" asp-for="DiwanQuotedPoem.Id" />
<input type="hidden" asp-for="GanjoorQuotedPoem.PoemId" /> <input type="hidden" asp-for="DiwanQuotedPoem.PoemId" />
<input type="hidden" asp-for="GanjoorQuotedPoem.PoetId" /> <input type="hidden" asp-for="DiwanQuotedPoem.PoetId" />
</p> </p>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_CoupletIndex">بیت</label> <label for="DiwanQuotedPoem_CoupletIndex">بیت</label>
<select asp-for="GanjoorQuotedPoem.CoupletIndex"> <select asp-for="DiwanQuotedPoem.CoupletIndex">
@foreach (var item in Model.Couplets) @foreach (var item in Model.Couplets)
{ {
<option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option> <option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option>
@ -249,37 +249,37 @@
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.CoupletVerse1ShouldBeEmphasized" /> <input asp-for="DiwanQuotedPoem.CoupletVerse1ShouldBeEmphasized" />
<label for="GanjoorQuotedPoem_CoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label> <label for="DiwanQuotedPoem_CoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.CoupletVerse2ShouldBeEmphasized" /> <input asp-for="DiwanQuotedPoem.CoupletVerse2ShouldBeEmphasized" />
<label for="GanjoorQuotedPoem_CoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label> <label for="DiwanQuotedPoem_CoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_PoetId">شاعر مرجع</label> <label for="DiwanQuotedPoem_PoetId">شاعر مرجع</label>
<input asp-for="GanjoorQuotedPoem.PoetId" /> <input asp-for="DiwanQuotedPoem.PoetId" />
</div> </div>
<div class="up-btn-group"> <div class="up-btn-group">
<a onclick="finalizeSelectPage()" class="up-btn up-btn--ghost" role="button" id="finalize-select" style="display:none">انتخاب کردم</a> <a onclick="finalizeSelectPage()" class="up-btn up-btn--ghost" role="button" id="finalize-select" style="display:none">انتخاب کردم</a>
<a onclick="selectGanjoorPage()" class="up-btn up-btn--ghost" role="button" id="display-frame">🔎 گزینش شعر مرتبط</a> <a onclick="selectDiwanPage()" class="up-btn up-btn--ghost" role="button" id="display-frame">🔎 گزینش شعر مرتبط</a>
</div> </div>
<iframe id="select-poem" src="/" height="600" style="display:none;width:100%;margin:auto"></iframe> <iframe id="select-poem" src="/" height="600" style="display:none;width:100%;margin:auto"></iframe>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_RelatedPoemId">شناسهٔ شعر مرتبط</label> <label for="DiwanQuotedPoem_RelatedPoemId">شناسهٔ شعر مرتبط</label>
<input asp-for="GanjoorQuotedPoem.RelatedPoemId" /> <input asp-for="DiwanQuotedPoem.RelatedPoemId" />
</div> </div>
@if (Model.GanjoorQuotedPoem.RelatedPoemId != null) @if (Model.DiwanQuotedPoem.RelatedPoemId != null)
{ {
<p><a href="/?p=@Model.GanjoorQuotedPoem.RelatedPoemId">🔗 مشاهدهٔ شعر مرتبط</a></p> <p><a href="/?p=@Model.DiwanQuotedPoem.RelatedPoemId">🔗 مشاهدهٔ شعر مرتبط</a></p>
} }
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_RelatedCoupletIndex">بیت مرتبط</label> <label for="DiwanQuotedPoem_RelatedCoupletIndex">بیت مرتبط</label>
<select asp-for="GanjoorQuotedPoem.RelatedCoupletIndex"> <select asp-for="DiwanQuotedPoem.RelatedCoupletIndex">
@foreach (var item in Model.RelatedCouplets) @foreach (var item in Model.RelatedCouplets)
{ {
<option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option> <option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option>
@ -288,87 +288,87 @@
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_RelatedCoupletVerse1">مصرع اول مرتبط (خارج از دیوان)</label> <label for="DiwanQuotedPoem_RelatedCoupletVerse1">مصرع اول مرتبط (خارج از دیوان)</label>
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse1" size="65" /> <input asp-for="DiwanQuotedPoem.RelatedCoupletVerse1" size="65" />
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized" /> <input asp-for="DiwanQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized" />
<label for="GanjoorQuotedPoem_RelatedCoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label> <label for="DiwanQuotedPoem_RelatedCoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_RelatedCoupletVerse2">مصرع دوم مرتبط (خارج از دیوان)</label> <label for="DiwanQuotedPoem_RelatedCoupletVerse2">مصرع دوم مرتبط (خارج از دیوان)</label>
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse2" size="65" /> <input asp-for="DiwanQuotedPoem.RelatedCoupletVerse2" size="65" />
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized" /> <input asp-for="DiwanQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized" />
<label for="GanjoorQuotedPoem_RelatedCoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label> <label for="DiwanQuotedPoem_RelatedCoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_SortOrder">ترتیب</label> <label for="DiwanQuotedPoem_SortOrder">ترتیب</label>
<input asp-for="GanjoorQuotedPoem.SortOrder" /> <input asp-for="DiwanQuotedPoem.SortOrder" />
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.IsPriorToRelated" /> <input asp-for="DiwanQuotedPoem.IsPriorToRelated" />
<label for="GanjoorQuotedPoem_IsPriorToRelated">این شعر قدیمی‌تر از شعر مرتبط است</label> <label for="DiwanQuotedPoem_IsPriorToRelated">این شعر قدیمی‌تر از شعر مرتبط است</label>
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.ChosenForMainList" /> <input asp-for="DiwanQuotedPoem.ChosenForMainList" />
<label for="GanjoorQuotedPoem_ChosenForMainList">نمایش در فهرست اصلی</label> <label for="DiwanQuotedPoem_ChosenForMainList">نمایش در فهرست اصلی</label>
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.IndirectQuotation" /> <input asp-for="DiwanQuotedPoem.IndirectQuotation" />
<label for="GanjoorQuotedPoem_IndirectQuotation">مستقیماً ارتباط ندارد</label> <label for="DiwanQuotedPoem_IndirectQuotation">مستقیماً ارتباط ندارد</label>
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.ClaimedByBothPoets" /> <input asp-for="DiwanQuotedPoem.ClaimedByBothPoets" />
<label for="GanjoorQuotedPoem_ClaimedByBothPoets">منتسب به هر دو شاعر</label> <label for="DiwanQuotedPoem_ClaimedByBothPoets">منتسب به هر دو شاعر</label>
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_RelatedPoetId">شاعر</label> <label for="DiwanQuotedPoem_RelatedPoetId">شاعر</label>
<input asp-for="GanjoorQuotedPoem.RelatedPoetId" /> <input asp-for="DiwanQuotedPoem.RelatedPoetId" />
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetName">نام شاعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemPoetName">نام شاعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetName" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemPoetName" />
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri">سالمرگ شاعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri">سالمرگ شاعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri" />
</div> </div>
<div class="up-field up-field--ltr"> <div class="up-field up-field--ltr">
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetUrl">نشانی صفحهٔ شاعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemPoetUrl">نشانی صفحهٔ شاعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetUrl" size="65" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemPoetUrl" size="65" />
</div> </div>
<div class="up-field up-field--ltr"> <div class="up-field up-field--ltr">
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetImage">تصویر شاعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemPoetImage">تصویر شاعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetImage" size="65" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemPoetImage" size="65" />
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_CachedRelatedPoemFullTitle">عنوان شعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemFullTitle">عنوان شعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemFullTitle" size="65" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemFullTitle" size="65" />
</div> </div>
<div class="up-field up-field--ltr"> <div class="up-field up-field--ltr">
<label for="GanjoorQuotedPoem_CachedRelatedPoemFullUrl">نشانی شعر</label> <label for="DiwanQuotedPoem_CachedRelatedPoemFullUrl">نشانی شعر</label>
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemFullUrl" size="65" /> <input asp-for="DiwanQuotedPoem.CachedRelatedPoemFullUrl" size="65" />
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_Note"><span class="up-field-icon" aria-hidden="true">🗒️</span> یادداشت</label> <label for="DiwanQuotedPoem_Note"><span class="up-field-icon" aria-hidden="true">🗒️</span> یادداشت</label>
<textarea asp-for="GanjoorQuotedPoem.Note" rows="4" cols="80" class="editor"></textarea> <textarea asp-for="DiwanQuotedPoem.Note" rows="4" cols="80" class="editor"></textarea>
</div> </div>
<div class="up-check-row"> <div class="up-check-row">
<input asp-for="GanjoorQuotedPoem.Published" /> <input asp-for="DiwanQuotedPoem.Published" />
<label for="GanjoorQuotedPoem_Published">منتشر شده</label> <label for="DiwanQuotedPoem_Published">منتشر شده</label>
</div> </div>
<div class="up-field"> <div class="up-field">
<label for="GanjoorQuotedPoem_SamePoemsQuotedCount">تعداد همسان‌ها</label> <label for="DiwanQuotedPoem_SamePoemsQuotedCount">تعداد همسان‌ها</label>
<input asp-for="GanjoorQuotedPoem.SamePoemsQuotedCount" /> <input asp-for="DiwanQuotedPoem.SamePoemsQuotedCount" />
</div> </div>
<div class="up-form-actions"> <div class="up-form-actions">
@ -380,13 +380,13 @@
<div class="up-btn-group"> <div class="up-btn-group">
@if (Model.ReverseId != null) @if (Model.ReverseId != null)
{ {
<a href="/Admin/EditQuoted/?p=@Model.GanjoorQuotedPoem.RelatedPoemId&id=@Model.ReverseId" class="up-btn up-btn--ghost">🔁 نمایش معکوس</a> <a href="/Admin/EditQuoted/?p=@Model.DiwanQuotedPoem.RelatedPoemId&id=@Model.ReverseId" class="up-btn up-btn--ghost">🔁 نمایش معکوس</a>
} }
else else
{ {
<a role="button" onclick="reverseQuote('@Model.GanjoorQuotedPoem.Id')" class="up-btn up-btn--ghost" title="درج معکوس">🔁 درج معکوس</a> <a role="button" onclick="reverseQuote('@Model.DiwanQuotedPoem.Id')" class="up-btn up-btn--ghost" title="درج معکوس">🔁 درج معکوس</a>
} }
<a role="button" onclick="deleteThisOne('@Model.GanjoorQuotedPoem.Id')" class="up-btn up-btn--danger" title="حذف">🗑 حذف</a> <a role="button" onclick="deleteThisOne('@Model.DiwanQuotedPoem.Id')" class="up-btn up-btn--danger" title="حذف">🗑 حذف</a>
</div> </div>
</form> </form>
</div> </div>

View File

@ -2,18 +2,18 @@
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using System.Text; using System.Text;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class EditQuotedModel : PageModel public class EditQuotedModel : PageModel
{ {
@ -33,23 +33,23 @@ namespace GanjooRazor.Areas.Admin.Pages
_httpClient = httpClient; _httpClient = httpClient;
} }
public GanjoorPoemCompleteViewModel Poem { get; set; } public DiwanPoemCompleteViewModel Poem { get; set; }
public GanjoorPoemCompleteViewModel RelatedPoem { get; set; } public DiwanPoemCompleteViewModel RelatedPoem { get; set; }
public Tuple<int, string>[] Couplets { get; set; } public Tuple<int, string>[] Couplets { get; set; }
public Tuple<int, string>[] RelatedCouplets { get; set; } public Tuple<int, string>[] RelatedCouplets { get; set; }
[BindProperty] [BindProperty]
public GanjoorQuotedPoemViewModel GanjoorQuotedPoem { get; set; } public DiwanQuotedPoemViewModel DiwanQuotedPoem { get; set; }
public GanjoorQuotedPoemViewModel[] AllPoemQuoteds { get; set; } public DiwanQuotedPoemViewModel[] AllPoemQuoteds { get; set; }
public Guid? ReverseId { get; set; } public Guid? ReverseId { get; set; }
public bool DisplayAll { get; set; } public bool DisplayAll { get; set; }
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses) private Tuple<int, string>[] GetCouplets(DiwanVerseViewModel[] verses)
{ {
int coupetIndex = -1; int coupetIndex = -1;
string coupletText = ""; string coupletText = "";
@ -108,13 +108,13 @@ namespace GanjooRazor.Areas.Admin.Pages
private async Task<string> Prepare(int poemId, string id) private async Task<string> Prepare(int poemId, string id)
{ {
LastMessage = ""; LastMessage = "";
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{poemId}"); var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{poemId}");
if (!poemQuery.IsSuccessStatusCode) if (!poemQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
Couplets = GetCouplets(Poem.Verses); Couplets = GetCouplets(Poem.Verses);
RelatedCouplets = []; RelatedCouplets = [];
@ -122,35 +122,35 @@ namespace GanjooRazor.Areas.Admin.Pages
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {
var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/quoted/{id}"); var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/quoted/{id}");
if (!quoteQuery.IsSuccessStatusCode) if (!quoteQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
GanjoorQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>(); DiwanQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<DiwanQuotedPoemViewModel>();
if (GanjoorQuotedPoem.RelatedPoemId != null) if (DiwanQuotedPoem.RelatedPoemId != null)
{ {
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}"); var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{DiwanQuotedPoem.RelatedPoemId}");
if (!relPoemQuery.IsSuccessStatusCode) if (!relPoemQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
RelatedCouplets = GetCouplets(RelatedPoem.Verses); RelatedCouplets = GetCouplets(RelatedPoem.Verses);
var revQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}/quoteds/{GanjoorQuotedPoem.PoemId}"); var revQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{DiwanQuotedPoem.RelatedPoemId}/quoteds/{DiwanQuotedPoem.PoemId}");
if (!revQuery.IsSuccessStatusCode) if (!revQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await revQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await revQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
var revs = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await revQuery.Content.ReadAsStringAsync()); var revs = JsonConvert.DeserializeObject<DiwanQuotedPoemViewModel[]>(await revQuery.Content.ReadAsStringAsync());
var rev = revs.Where(r => r.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex && r.RelatedCoupletIndex == GanjoorQuotedPoem.CoupletIndex).SingleOrDefault(); var rev = revs.Where(r => r.CoupletIndex == DiwanQuotedPoem.RelatedCoupletIndex && r.RelatedCoupletIndex == DiwanQuotedPoem.CoupletIndex).SingleOrDefault();
if (rev != null) if (rev != null)
{ {
ReverseId = rev.Id; ReverseId = rev.Id;
@ -160,7 +160,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
GanjoorQuotedPoem = new GanjoorQuotedPoemViewModel() DiwanQuotedPoem = new DiwanQuotedPoemViewModel()
{ {
PoemId = poemId, PoemId = poemId,
PoetId = Poem.Category.Poet.Id, PoetId = Poem.Category.Poet.Id,
@ -194,13 +194,13 @@ namespace GanjooRazor.Areas.Admin.Pages
}; };
} }
var allQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{poemId}/quoteds"); var allQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{poemId}/quoteds");
if (!allQuery.IsSuccessStatusCode) if (!allQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await allQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await allQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
AllPoemQuoteds = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync()); AllPoemQuoteds = JsonConvert.DeserializeObject<DiwanQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
return LastMessage; return LastMessage;
} }
@ -213,7 +213,7 @@ namespace GanjooRazor.Areas.Admin.Pages
if (!string.IsNullOrEmpty(Request.Query["all"])) if (!string.IsNullOrEmpty(Request.Query["all"]))
{ {
DisplayAll = true; DisplayAll = true;
string url = $"{APIRoot.Url}/api/ganjoor/quoted?published=false"; string url = $"{APIRoot.Url}/api/diwan/quoted?published=false";
if (!string.IsNullOrEmpty(Request.Query["p"])) if (!string.IsNullOrEmpty(Request.Query["p"]))
{ {
url += $"&poetId={Request.Query["p"]}"; url += $"&poetId={Request.Query["p"]}";
@ -227,7 +227,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await allQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await allQuery.Content.ReadAsStringAsync());
} }
AllPoemQuoteds = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync()); AllPoemQuoteds = JsonConvert.DeserializeObject<DiwanQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
@ -237,14 +237,14 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
if (!string.IsNullOrEmpty(Request.Query["id"])) if (!string.IsNullOrEmpty(Request.Query["id"]))
{ {
var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/quoted/{Request.Query["id"]}"); var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/quoted/{Request.Query["id"]}");
if (!quoteQuery.IsSuccessStatusCode) if (!quoteQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
GanjoorQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>(); DiwanQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<DiwanQuotedPoemViewModel>();
poemIdString = GanjoorQuotedPoem.PoemId.ToString(); poemIdString = DiwanQuotedPoem.PoemId.ToString();
} }
else else
{ {
@ -261,39 +261,39 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync(GanjoorQuotedPoemViewModel GanjoorQuotedPoem) public async Task<IActionResult> OnPostAsync(DiwanQuotedPoemViewModel DiwanQuotedPoem)
{ {
try try
{ {
await Prepare(GanjoorQuotedPoem.PoemId, GanjoorQuotedPoem.Id == Guid.Empty ? null : GanjoorQuotedPoem.Id.ToString()); await Prepare(DiwanQuotedPoem.PoemId, DiwanQuotedPoem.Id == Guid.Empty ? null : DiwanQuotedPoem.Id.ToString());
GanjoorQuotedPoem.CoupletVerse1 = Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).Count() < 1 ? "" : Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).ToArray()[0].Text; DiwanQuotedPoem.CoupletVerse1 = Poem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.CoupletIndex).Count() < 1 ? "" : Poem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.CoupletIndex).ToArray()[0].Text;
GanjoorQuotedPoem.CoupletVerse2 = Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).Count() < 2 ? "" : Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).ToArray()[1].Text; DiwanQuotedPoem.CoupletVerse2 = Poem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.CoupletIndex).Count() < 2 ? "" : Poem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.CoupletIndex).ToArray()[1].Text;
if (GanjoorQuotedPoem.RelatedPoemId != null && RelatedPoem == null) if (DiwanQuotedPoem.RelatedPoemId != null && RelatedPoem == null)
{ {
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}"); var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{DiwanQuotedPoem.RelatedPoemId}");
if (!relPoemQuery.IsSuccessStatusCode) if (!relPoemQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
RelatedCouplets = GetCouplets(RelatedPoem.Verses); RelatedCouplets = GetCouplets(RelatedPoem.Verses);
} }
if (GanjoorQuotedPoem.RelatedCoupletIndex != null) if (DiwanQuotedPoem.RelatedCoupletIndex != null)
{ {
GanjoorQuotedPoem.RelatedCoupletVerse1 = RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).Count() < 1 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).ToArray()[0].Text; DiwanQuotedPoem.RelatedCoupletVerse1 = RelatedPoem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.RelatedCoupletIndex).Count() < 1 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.RelatedCoupletIndex).ToArray()[0].Text;
GanjoorQuotedPoem.RelatedCoupletVerse2 = RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).Count() < 2 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).ToArray()[1].Text; DiwanQuotedPoem.RelatedCoupletVerse2 = RelatedPoem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.RelatedCoupletIndex).Count() < 2 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == DiwanQuotedPoem.RelatedCoupletIndex).ToArray()[1].Text;
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var url = $"{APIRoot.Url}/api/ganjoor/quoted"; var url = $"{APIRoot.Url}/api/diwan/quoted";
var payload = new StringContent(JsonConvert.SerializeObject(GanjoorQuotedPoem), Encoding.UTF8, "application/json"); var payload = new StringContent(JsonConvert.SerializeObject(DiwanQuotedPoem), Encoding.UTF8, "application/json");
bool newRecord = GanjoorQuotedPoem.Id == Guid.Empty; bool newRecord = DiwanQuotedPoem.Id == Guid.Empty;
HttpResponseMessage response = HttpResponseMessage response =
newRecord ? newRecord ?
await secureClient.PostAsync(url, payload) : await secureClient.PostAsync(url, payload) :
@ -306,10 +306,10 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
if (newRecord) if (newRecord)
{ {
GanjoorQuotedPoem = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>(); DiwanQuotedPoem = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DiwanQuotedPoemViewModel>();
} }
LastMessage = $"انجام شد. <br /><a href=\"/Admin/EditQuoted/?p={GanjoorQuotedPoem.PoemId}&id={GanjoorQuotedPoem.Id}\">برگشت</a>"; LastMessage = $"انجام شد. <br /><a href=\"/Admin/EditQuoted/?p={DiwanQuotedPoem.PoemId}&id={DiwanQuotedPoem.Id}\">برگشت</a>";
} }
} }
@ -329,11 +329,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(string id) public async Task<IActionResult> OnDeleteAsync(string id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/quoted?id={id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/quoted?id={id}");
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
@ -351,22 +351,22 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostGenerateReverseAsync(string id) public async Task<IActionResult> OnPostGenerateReverseAsync(string id)
{ {
var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/quoted/{id}"); var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/quoted/{id}");
if (!quoteQuery.IsSuccessStatusCode) if (!quoteQuery.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync()));
} }
var quote = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>(); var quote = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<DiwanQuotedPoemViewModel>();
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{quote.PoemId}"); var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{quote.PoemId}");
if (!poemQuery.IsSuccessStatusCode) if (!poemQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync());
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync()));
} }
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
GanjoorQuotedPoemViewModel reverseRelation = new GanjoorQuotedPoemViewModel() DiwanQuotedPoemViewModel reverseRelation = new DiwanQuotedPoemViewModel()
{ {
PoemId = (int)quote.RelatedPoemId, PoemId = (int)quote.RelatedPoemId,
PoetId = (int)quote.RelatedPoetId, PoetId = (int)quote.RelatedPoetId,
@ -377,7 +377,7 @@ namespace GanjooRazor.Areas.Admin.Pages
CachedRelatedPoemPoetDeathYearInLHijri = Poem.Category.Poet.DeathYearInLHijri, CachedRelatedPoemPoetDeathYearInLHijri = Poem.Category.Poet.DeathYearInLHijri,
CachedRelatedPoemPoetName = Poem.Category.Poet.Nickname, CachedRelatedPoemPoetName = Poem.Category.Poet.Nickname,
CachedRelatedPoemPoetUrl = Poem.Category.Poet.FullUrl, CachedRelatedPoemPoetUrl = Poem.Category.Poet.FullUrl,
CachedRelatedPoemPoetImage = $"/api/ganjoor/poet/image{Poem.Category.Poet.FullUrl}.gif", CachedRelatedPoemPoetImage = $"/api/diwan/poet/image{Poem.Category.Poet.FullUrl}.gif",
CachedRelatedPoemFullTitle = Poem.FullTitle, CachedRelatedPoemFullTitle = Poem.FullTitle,
CachedRelatedPoemFullUrl = Poem.FullUrl, CachedRelatedPoemFullUrl = Poem.FullUrl,
SortOrder = 1000, SortOrder = 1000,
@ -399,11 +399,11 @@ namespace GanjooRazor.Areas.Admin.Pages
}; };
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var url = $"{APIRoot.Url}/api/ganjoor/quoted"; var url = $"{APIRoot.Url}/api/diwan/quoted";
var payload = new StringContent(JsonConvert.SerializeObject(reverseRelation), Encoding.UTF8, "application/json"); var payload = new StringContent(JsonConvert.SerializeObject(reverseRelation), Encoding.UTF8, "application/json");
HttpResponseMessage response = HttpResponseMessage response =
@ -416,7 +416,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
reverseRelation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>(); reverseRelation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DiwanQuotedPoemViewModel>();
return new JsonResult($"/Admin/EditQuoted/?p={reverseRelation.PoemId}&id={reverseRelation.Id}"); return new JsonResult($"/Admin/EditQuoted/?p={reverseRelation.PoemId}&id={reverseRelation.Id}");
} }
} }

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ExamineUserModel @model DiwanRazor.Areas.Admin.Pages.ExamineUserModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,12 +1,12 @@
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RSecurityBackend.Models.Auth.ViewModels; using RSecurityBackend.Models.Auth.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ExamineUserModel : PageModel public class ExamineUserModel : PageModel
{ {
@ -23,9 +23,9 @@ namespace GanjooRazor.Areas.Admin.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/"); return Redirect("/");
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}"); var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}");
if (userInfoResponse.IsSuccessStatusCode) if (userInfoResponse.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ExpenseEditModel @model DiwanRazor.Areas.Admin.Pages.ExpenseEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,14 +1,14 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Accounting; using RMuseum.Models.Accounting;
using RMuseum.Models.Accounting.ViewModels; using RMuseum.Models.Accounting.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ExpenseEditModel : PageModel public class ExpenseEditModel : PageModel
{ {
@ -45,7 +45,7 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
var expense = JsonConvert.DeserializeObject<GanjoorExpense>(await response.Content.ReadAsStringAsync()); var expense = JsonConvert.DeserializeObject<DiwanExpense>(await response.Content.ReadAsStringAsync());
Expense = new UpdateDateDescriptionViewModel() Expense = new UpdateDateDescriptionViewModel()
{ {
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/expense/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Expense), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/expense/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Expense), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ExpensesModel @model DiwanRazor.Areas.Admin.Pages.ExpensesModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -2,13 +2,13 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Accounting; using RMuseum.Models.Accounting;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ExpensesModel : PageModel public class ExpensesModel : PageModel
{ {
@ -30,12 +30,12 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public string LastMessage { get; set; } public string LastMessage { get; set; }
[BindProperty] [BindProperty]
public GanjoorExpense Expense { get; set; } public DiwanExpense Expense { get; set; }
/// <summary> /// <summary>
/// donations /// donations
/// </summary> /// </summary>
public GanjoorExpense[] Expenses { get; set; } public DiwanExpense[] Expenses { get; set; }
/// <summary> /// <summary>
/// show account info /// show account info
@ -51,11 +51,11 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Expenses = JsonConvert.DeserializeObject<GanjoorExpense[]>(await response.Content.ReadAsStringAsync()); Expenses = JsonConvert.DeserializeObject<DiwanExpense[]>(await response.Content.ReadAsStringAsync());
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible"); HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible");
if (!resAccountInfo.IsSuccessStatusCode) if (!resAccountInfo.IsSuccessStatusCode)
@ -76,7 +76,7 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
Expense = new GanjoorExpense() Expense = new DiwanExpense()
{ {
ExpenseDate = DateTime.Now.Date, ExpenseDate = DateTime.Now.Date,
Unit = "تومان", Unit = "تومان",
@ -85,12 +85,12 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync(GanjoorExpense Expense) public async Task<IActionResult> OnPostAsync(DiwanExpense Expense)
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/donations/expense", new StringContent(JsonConvert.SerializeObject(Expense), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/donations/expense", new StringContent(JsonConvert.SerializeObject(Expense), Encoding.UTF8, "application/json"));
@ -113,9 +113,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildPageAsync() public async Task<IActionResult> OnPostRebuildPageAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -130,9 +130,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/expense/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/expense/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.KickoutUserModel @model DiwanRazor.Areas.Admin.Pages.KickoutUserModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -2,13 +2,13 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RSecurityBackend.Models.Auth.ViewModels; using RSecurityBackend.Models.Auth.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class KickoutUserModel : PageModel public class KickoutUserModel : PageModel
{ {
@ -27,9 +27,9 @@ namespace GanjooRazor.Areas.Admin.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/"); return Redirect("/");
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}"); var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}");
if (userInfoResponse.IsSuccessStatusCode) if (userInfoResponse.IsSuccessStatusCode)
@ -58,9 +58,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/users/kickout", new StringContent(JsonConvert.SerializeObject(UserCauseViewModel), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/users/kickout", new StringContent(JsonConvert.SerializeObject(UserCauseViewModel), Encoding.UTF8, "application/json"));

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.LocationsModel @model DiwanRazor.Areas.Admin.Pages.LocationsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,28 +1,28 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class LocationsModel : PageModel public class LocationsModel : PageModel
{ {
public string LastMessage { get; set; } public string LastMessage { get; set; }
public GanjoorGeoLocation[] Locations { get; set; } public DiwanGeoLocation[] Locations { get; set; }
[BindProperty] [BindProperty]
public GanjoorGeoLocation Location { get; set; } public DiwanGeoLocation Location { get; set; }
private async Task ReadLocationsAsync() private async Task ReadLocationsAsync()
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -30,7 +30,7 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return; return;
} }
Locations = JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await response.Content.ReadAsStringAsync()); Locations = JsonConvert.DeserializeObject<DiwanGeoLocation[]>(await response.Content.ReadAsStringAsync());
} }
else else
@ -50,12 +50,12 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync(GanjoorGeoLocation Location) public async Task<IActionResult> OnPostAsync(DiwanGeoLocation Location)
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/locations", new StringContent(JsonConvert.SerializeObject(Location), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/locations", new StringContent(JsonConvert.SerializeObject(Location), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -77,9 +77,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/locations/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/locations/{id}");
@ -98,11 +98,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPutEditAsync(int id, string name, double latitude, double longitude) public async Task<IActionResult> OnPutEditAsync(int id, string name, double latitude, double longitude)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
GanjoorGeoLocation model = new GanjoorGeoLocation() DiwanGeoLocation model = new DiwanGeoLocation()
{ {
Id = id, Id = id,
Name = name, Name = name,

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.LongRunningJobsModel @model DiwanRazor.Areas.Admin.Pages.LongRunningJobsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,13 +1,13 @@
using System; using System;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RSecurityBackend.Models.Generic.Db; using RSecurityBackend.Models.Generic.Db;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class LongRunningJobsModel : PageModel public class LongRunningJobsModel : PageModel
{ {
@ -22,9 +22,9 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/rjobs"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/rjobs");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -41,9 +41,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostCleanupJobsAsync() public async Task<IActionResult> OnPostCleanupJobsAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs/cleanup"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs/cleanup");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -61,9 +61,9 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnDeleteAsync(Guid id) public async Task<IActionResult> OnDeleteAsync(Guid id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs?id={id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs?id={id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ModifyPageModel @model DiwanRazor.Areas.Admin.Pages.ModifyPageModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -59,7 +59,7 @@
<textarea asp-for="ModifyModel.HtmlText" tabindex="4" rows="20"></textarea> <textarea asp-for="ModifyModel.HtmlText" tabindex="4" rows="20"></textarea>
</div> </div>
@if (Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoemPage) @if (Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.PoemPage)
{ {
<div class="up-field"> <div class="up-field">
<label>منبع</label> <label>منبع</label>
@ -101,7 +101,7 @@
</div> </div>
} }
@if (Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.CatPage || Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoetPage || Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoemPage) @if (Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.CatPage || Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.PoetPage || Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.PoemPage)
{ {
<div class="up-field"> <div class="up-field">
<label asp-for="ModifyModel.Published">منتشر شده (فعلا استفاده نشده)</label> <label asp-for="ModifyModel.Published">منتشر شده (فعلا استفاده نشده)</label>
@ -113,32 +113,32 @@
</div> </div>
} }
@if (Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.CatPage || Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoetPage) @if (Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.CatPage || Model.PageInformation.DiwanPageType == RMuseum.Models.Diwan.DiwanPageType.PoetPage)
{ {
<div class="up-field"> <div class="up-field">
<label asp-for="ModifyModel.CatType">نوع بخش (فقط بخش‌ها)</label> <label asp-for="ModifyModel.CatType">نوع بخش (فقط بخش‌ها)</label>
<select asp-for="ModifyModel.CatType"> <select asp-for="ModifyModel.CatType">
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.Default">پیش‌فرض</option> <option value="@RMuseum.Models.Diwan.DiwanCatType.Default">پیش‌فرض</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.Book">کتاب</option> <option value="@RMuseum.Models.Diwan.DiwanCatType.Book">کتاب</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.BookPart">بخش</option> <option value="@RMuseum.Models.Diwan.DiwanCatType.BookPart">بخش</option>
</select> </select>
</div> </div>
<div class="up-field"> <div class="up-field">
<label asp-for="ModifyModel.TableOfContentsStyle">نحوهٔ فهرست‌گذاری بخش (فقط بخش‌ها)</label> <label asp-for="ModifyModel.TableOfContentsStyle">نحوهٔ فهرست‌گذاری بخش (فقط بخش‌ها)</label>
<select asp-for="ModifyModel.TableOfContentsStyle"> <select asp-for="ModifyModel.TableOfContentsStyle">
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.Analyse">بر اساس تحلیل بخش</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.Analyse">بر اساس تحلیل بخش</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.OnlyTitles">فقط عناوین</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.OnlyTitles">فقط عناوین</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
</select> </select>
</div> </div>
<div class="up-field"> <div class="up-field">
@ -183,21 +183,21 @@
<form action="?Handler=GenerateCatPage&id=@Model.PageInformation.Id" method="post" class="up-form"> <form action="?Handler=GenerateCatPage&id=@Model.PageInformation.Id" method="post" class="up-form">
@Html.AntiForgeryToken() @Html.AntiForgeryToken()
<div class="up-field"> <div class="up-field">
<label asp-for="GanjoorTOC">تولید فهرست</label> <label asp-for="DiwanTOC">تولید فهرست</label>
<select asp-for="GanjoorTOC"> <select asp-for="DiwanTOC">
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.Analyse">بر اساس تحلیل بخش</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.Analyse">بر اساس تحلیل بخش</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.OnlyTitles">فقط عناوین</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.OnlyTitles">فقط عناوین</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option> <option value="@RMuseum.Models.Diwan.DiwanTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
</select> </select>
</div> </div>
<div class="up-form-actions"> <div class="up-form-actions">

View File

@ -1,11 +1,11 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Auth.ViewModels; using RSecurityBackend.Models.Auth.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -13,7 +13,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ModifyPageModel : PageModel public class ModifyPageModel : PageModel
{ {
@ -39,23 +39,23 @@ namespace GanjooRazor.Areas.Admin.Pages
/// api model /// api model
/// </summary> /// </summary>
[BindProperty] [BindProperty]
public GanjoorModifyPageViewModel ModifyModel { get; set; } public DiwanModifyPageViewModel ModifyModel { get; set; }
/// <summary> /// <summary>
/// rythm /// rythm
/// </summary> /// </summary>
public GanjoorMetre[] Rhythms { get; set; } public DiwanMetre[] Rhythms { get; set; }
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
/// <summary> /// <summary>
/// ganjoor toc /// diwan toc
/// </summary> /// </summary>
[BindProperty] [BindProperty]
public GanjoorTOC GanjoorTOC { get; set; } public DiwanTOC DiwanTOC { get; set; }
/// <summary> /// <summary>
/// last message /// last message
/// </summary> /// </summary>
@ -63,14 +63,14 @@ namespace GanjooRazor.Areas.Admin.Pages
public string DefaultHtmlText { get; set; } public string DefaultHtmlText { get; set; }
private static string _DefHtmlText(GanjoorVerseViewModel[] verses) private static string _DefHtmlText(DiwanVerseViewModel[] verses)
{ {
string htmlText = ""; string htmlText = "";
int coupletIndex = 0; int coupletIndex = 0;
VersePosition position = VersePosition.Right; VersePosition position = VersePosition.Right;
for (int vIndex = 0; vIndex < verses.Length; vIndex++) for (int vIndex = 0; vIndex < verses.Length; vIndex++)
{ {
GanjoorVerseViewModel v = verses[vIndex]; DiwanVerseViewModel v = verses[vIndex];
if (position == VersePosition.Right) if (position == VersePosition.Right)
{ {
coupletIndex++; coupletIndex++;
@ -89,23 +89,23 @@ namespace GanjooRazor.Areas.Admin.Pages
private async Task<bool> PreparePage() private async Task<bool> PreparePage()
{ {
var rhythmResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms"); var rhythmResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms");
if (!rhythmResponse.IsSuccessStatusCode) if (!rhythmResponse.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
return false; return false;
} }
Rhythms = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync()); Rhythms = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
if (Request.Query["id"] == "0") if (Request.Query["id"] == "0")
{ {
ModifyModel = new GanjoorModifyPageViewModel(); ModifyModel = new DiwanModifyPageViewModel();
PageInformation = new GanjoorPageCompleteViewModel(); PageInformation = new DiwanPageCompleteViewModel();
return true; return true;
} }
var pageUrlResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Request.Query["id"]}"); var pageUrlResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={Request.Query["id"]}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -114,20 +114,20 @@ namespace GanjooRazor.Areas.Admin.Pages
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return false; return false;
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
if (PageInformation.Poem != null) if (PageInformation.Poem != null)
{ {
DefaultHtmlText = _DefHtmlText(PageInformation.Poem.Verses); DefaultHtmlText = _DefHtmlText(PageInformation.Poem.Verses);
} }
ModifyModel = new GanjoorModifyPageViewModel() ModifyModel = new DiwanModifyPageViewModel()
{ {
Title = PageInformation.Title, Title = PageInformation.Title,
UrlSlug = PageInformation.UrlSlug, UrlSlug = PageInformation.UrlSlug,
@ -140,14 +140,14 @@ namespace GanjooRazor.Areas.Admin.Pages
NoIndex = PageInformation.NoIndex, NoIndex = PageInformation.NoIndex,
RedirectFromFullUrl = PageInformation.RedirectFromFullUrl, RedirectFromFullUrl = PageInformation.RedirectFromFullUrl,
Language = PageInformation.Poem == null ? null : PageInformation.Poem.Language, Language = PageInformation.Poem == null ? null : PageInformation.Poem.Language,
MixedModeOrder = PageInformation.Poem == null ? (PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.MixedModeOrder : 0) : PageInformation.Poem.MixedModeOrder, MixedModeOrder = PageInformation.Poem == null ? (PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.MixedModeOrder : 0) : PageInformation.Poem.MixedModeOrder,
Published = PageInformation.Poem == null ? (PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Published : true) : PageInformation.Poem.Published, Published = PageInformation.Poem == null ? (PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Published : true) : PageInformation.Poem.Published,
TableOfContentsStyle = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.TableOfContentsStyle : GanjoorTOC.Analyse, TableOfContentsStyle = PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.TableOfContentsStyle : DiwanTOC.Analyse,
CatType = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.CatType : GanjoorCatType.Default, CatType = PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.CatType : DiwanCatType.Default,
Description = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Description : "", Description = PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Description : "",
DescriptionHtml = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.DescriptionHtml : "" DescriptionHtml = PageInformation.DiwanPageType == DiwanPageType.CatPage || PageInformation.DiwanPageType == DiwanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.DescriptionHtml : ""
}; };
GanjoorTOC = ModifyModel.TableOfContentsStyle; DiwanTOC = ModifyModel.TableOfContentsStyle;
return true; return true;
} }
@ -162,7 +162,7 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
return StatusCode(StatusCodes.Status500InternalServerError, "شناسهٔ صفحه مشخص نیست."); return StatusCode(StatusCodes.Status500InternalServerError, "شناسهٔ صفحه مشخص نیست.");
} }
GanjoorTOC = GanjoorTOC.Analyse; DiwanTOC = DiwanTOC.Analyse;
await PreparePage(); await PreparePage();
return Page(); return Page();
@ -170,37 +170,37 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnGetComputeRhymeAsync(int id) public async Task<IActionResult> OnGetComputeRhymeAsync(int id)
{ {
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/analysisrhyme/{id}"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/analysisrhyme/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
} }
var rhyme = JsonConvert.DeserializeObject<GanjooRhymeAnalysisResult>(await response.Content.ReadAsStringAsync()); var rhyme = JsonConvert.DeserializeObject<DiwanRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
return new OkObjectResult(rhyme.Rhyme); return new OkObjectResult(rhyme.Rhyme);
} }
public async Task<IActionResult> OnPostAsync(GanjoorModifyPageViewModel ModifyModel) public async Task<IActionResult> OnPostAsync(DiwanModifyPageViewModel ModifyModel)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
if(Request.Query["id"] == "0") if(Request.Query["id"] == "0")
{ {
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/page", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json")); var response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/page", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
} }
else else
{ {
var newPage = JsonConvert.DeserializeObject<GanjoorPage>(await response.Content.ReadAsStringAsync()); var newPage = JsonConvert.DeserializeObject<DiwanPage>(await response.Content.ReadAsStringAsync());
return Redirect($"/Admin/ModifyPage?id={newPage.Id}&edit=true"); return Redirect($"/Admin/ModifyPage?id={newPage.Id}&edit=true");
} }
} }
else else
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/page/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/page/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -220,12 +220,12 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostGenerateCatPageAsync(GanjoorTOC GanjoorTOC) public async Task<IActionResult> OnPostGenerateCatPageAsync(DiwanTOC DiwanTOC)
{ {
if (!(await PreparePage())) if (!(await PreparePage()))
return Page(); return Page();
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat?url={PageInformation.FullUrl}&poems=true"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/cat?url={PageInformation.FullUrl}&poems=true");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -233,15 +233,15 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var Cat = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync()); var Cat = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
if (Request.Form["directInsert"].Count == 1) if (Request.Form["directInsert"].Count == 1)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var htmlRes = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/toc/{Cat.Cat.Id}/{(int)GanjoorTOC}", null); var htmlRes = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/cat/toc/{Cat.Cat.Id}/{(int)DiwanTOC}", null);
if (!htmlRes.IsSuccessStatusCode) if (!htmlRes.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync());
@ -260,11 +260,11 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var htmlRes = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/toc/{Cat.Cat.Id}/{(int)GanjoorTOC}"); var htmlRes = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/toc/{Cat.Cat.Id}/{(int)DiwanTOC}");
if (!htmlRes.IsSuccessStatusCode) if (!htmlRes.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync());
@ -288,11 +288,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildSitemapAsync() public async Task<IActionResult> OnPostRebuildSitemapAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sitemap", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/sitemap", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -306,11 +306,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildStatsAsync() public async Task<IActionResult> OnPostRebuildStatsAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/rebuild/stats", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/rebuild/stats", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -328,11 +328,11 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnPostRegeneratePublicDataAsync() public async Task<IActionResult> OnPostRegeneratePublicDataAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/publicdata/batchexport", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/publicdata/batchexport", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -346,11 +346,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRefillSectionsCoupletCountsAsync() public async Task<IActionResult> OnPostRefillSectionsCoupletCountsAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/fillsectioncoupletcounts", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/fillsectioncoupletcounts", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -366,11 +366,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildRelatedPagesAsync() public async Task<IActionResult> OnPostRebuildRelatedPagesAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/quoted/pages/generate", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/quoted/pages/generate", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -383,11 +383,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildDigitalSourcesStatsAsync() public async Task<IActionResult> OnPostRebuildDigitalSourcesStatsAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/source/stats/rebuild", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/source/stats/rebuild", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -404,11 +404,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostCleanCacheAsync(int id) public async Task<IActionResult> OnPostCleanCacheAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/cache/{id}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/page/cache/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -421,11 +421,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostRebuildWordCountsAsync(int poetId) public async Task<IActionResult> OnPostRebuildWordCountsAsync(int poetId)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/wordcounts/rebuild/{poetId}", null); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/wordcounts/rebuild/{poetId}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -438,20 +438,20 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostImportNaskbanPaperSourcesAsync(int poetId, string username, string password) public async Task<IActionResult> OnPostImportNaskbanPaperSourcesAsync(int poetId, string username, string password)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
LoginViewModel model = new LoginViewModel() LoginViewModel model = new LoginViewModel()
{ {
Username = username, Username = username,
Password = password, Password = password,
ClientAppName = "GanjooRazor", ClientAppName = "DiwanRazor",
Language = "ur-PK" Language = "ur-PK"
}; };
var stringContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json"); var stringContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/naskban/import/poetbooks/{poetId}", stringContent); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/naskban/import/poetbooks/{poetId}", stringContent);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -466,11 +466,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostImportMuseumPaperSourcesAsync(int poetId) public async Task<IActionResult> OnPostImportMuseumPaperSourcesAsync(int poetId)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/papersources/import/{poetId}", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/papersources/import/{poetId}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PageDelModel @model DiwanRazor.Areas.Admin.Pages.PageDelModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,13 +1,13 @@
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class PageDelModel : PageModel public class PageDelModel : PageModel
{ {
@ -28,7 +28,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
/// <summary> /// <summary>
@ -42,24 +42,24 @@ namespace GanjooRazor.Areas.Admin.Pages
return Redirect("/"); return Redirect("/");
LastResult = ""; LastResult = "";
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={Request.Query["url"]}"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={Request.Query["url"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/cache/{Request.Query["id"]}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/page/cache/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -67,7 +67,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/{Request.Query["id"]}"); response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/page/{Request.Query["id"]}");
if(!response.IsSuccessStatusCode) if(!response.IsSuccessStatusCode)
{ {

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PageHistoryModel @model DiwanRazor.Areas.Admin.Pages.PageHistoryModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{

View File

@ -1,12 +1,12 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class PageHistoryModel : PageModel public class PageHistoryModel : PageModel
{ {
@ -15,7 +15,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public string LastMessage { get; set; } public string LastMessage { get; set; }
public GanjoorPageSnapshotSummaryViewModel[] OlderVersions { get; set; } public DiwanPageSnapshotSummaryViewModel[] OlderVersions { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
@ -23,18 +23,18 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page/oldversions/{Request.Query["id"]}"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page/oldversions/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
OlderVersions = JsonConvert.DeserializeObject<GanjoorPageSnapshotSummaryViewModel[]>(await response.Content.ReadAsStringAsync()); OlderVersions = JsonConvert.DeserializeObject<DiwanPageSnapshotSummaryViewModel[]>(await response.Content.ReadAsStringAsync());
} }
else else

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PoetModel @model DiwanRazor.Areas.Admin.Pages.PoetModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -105,7 +105,7 @@ else
<table> <table>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{Model.Poet.ImageUrl}")" alt="@Model.Poet.Name" /> <img src="@($"{DiwanRazor.APIRoot.InternetUrl}{Model.Poet.ImageUrl}")" alt="@Model.Poet.Name" />
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -3,17 +3,17 @@ using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RMuseum.Services.Implementation.ImportedFromDesktopGanjoor; using RMuseum.Services.Implementation.ImportedFromDesktopDiwan;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class PoetModel : PageModel public class PoetModel : PageModel
{ {
@ -47,7 +47,7 @@ namespace GanjooRazor.Areas.Admin.Pages
[BindProperty] [BindProperty]
public GanjoorPoetViewModel Poet { get; set; } public DiwanPoetViewModel Poet { get; set; }
[BindProperty] [BindProperty]
public IFormFile Image { get; set; } public IFormFile Image { get; set; }
@ -70,26 +70,26 @@ namespace GanjooRazor.Areas.Admin.Pages
private async Task<bool> PreparePoet() private async Task<bool> PreparePoet()
{ {
await ReadLocationsAsync(); await ReadLocationsAsync();
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poet/{Request.Query["id"]}"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poet/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return false; return false;
} }
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync()); var poet = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
Poet = poet.Poet; Poet = poet.Poet;
return true; return true;
} }
public List<GanjoorGeoLocation> Locations { get; set; } public List<DiwanGeoLocation> Locations { get; set; }
private async Task ReadLocationsAsync() private async Task ReadLocationsAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -98,10 +98,10 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Locations = new List<GanjoorGeoLocation>(); Locations = new List<DiwanGeoLocation>();
Locations.Add Locations.Add
( (
new GanjoorGeoLocation() new DiwanGeoLocation()
{ {
Id = 0, Id = 0,
Latitude = 0, Latitude = 0,
@ -110,7 +110,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
); );
Locations.AddRange(JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await response.Content.ReadAsStringAsync())); Locations.AddRange(JsonConvert.DeserializeObject<DiwanGeoLocation[]>(await response.Content.ReadAsStringAsync()));
} }
else else
@ -131,7 +131,7 @@ namespace GanjooRazor.Areas.Admin.Pages
if (string.IsNullOrEmpty(Request.Query["id"])) if (string.IsNullOrEmpty(Request.Query["id"]))
{ {
await ReadLocationsAsync(); await ReadLocationsAsync();
Poet = new GanjoorPoetViewModel() Poet = new DiwanPoetViewModel()
{ {
Nickname = "", Nickname = "",
Name = "", Name = "",
@ -148,26 +148,26 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostEditPoetAsync(GanjoorPoetViewModel Poet) public async Task<IActionResult> OnPostEditPoetAsync(DiwanPoetViewModel Poet)
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
if (Request.Query["id"].ToString() == "0") if (Request.Query["id"].ToString() == "0")
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/poet", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/poet", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync()); var poet = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
var cacheKey1 = $"/api/ganjoor/poets"; var cacheKey1 = $"/api/diwan/poets";
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets)) if (_memoryCache.TryGetValue(cacheKey1, out List<DiwanPoetViewModel> poets))
{ {
_memoryCache.Remove(cacheKey1); _memoryCache.Remove(cacheKey1);
} }
@ -177,21 +177,21 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
else else
{ {
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/poet/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/poet/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
var cacheKey1 = $"/api/ganjoor/poets"; var cacheKey1 = $"/api/diwan/poets";
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets)) if (_memoryCache.TryGetValue(cacheKey1, out List<DiwanPoetViewModel> poets))
{ {
_memoryCache.Remove(cacheKey1); _memoryCache.Remove(cacheKey1);
} }
var cacheKey2 = $"/api/ganjoor/poet/{Request.Query["id"]}"; var cacheKey2 = $"/api/diwan/poet/{Request.Query["id"]}";
if (_memoryCache.TryGetValue(cacheKey2, out GanjoorPoetCompleteViewModel poet)) if (_memoryCache.TryGetValue(cacheKey2, out DiwanPoetCompleteViewModel poet))
{ {
_memoryCache.Remove(cacheKey2); _memoryCache.Remove(cacheKey2);
} }
@ -215,9 +215,9 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
MultipartFormDataContent form = new MultipartFormDataContent(); MultipartFormDataContent form = new MultipartFormDataContent();
@ -227,7 +227,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var fileContent = stream.ToArray(); var fileContent = stream.ToArray();
form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, Image.FileName); form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, Image.FileName);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/poet/image/{Request.Query["id"]}", form); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/poet/image/{Request.Query["id"]}", form);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -251,9 +251,9 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
MultipartFormDataContent form = new MultipartFormDataContent(); MultipartFormDataContent form = new MultipartFormDataContent();
@ -263,7 +263,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var fileContent = stream.ToArray(); var fileContent = stream.ToArray();
form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, SQLiteDb.FileName); form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, SQLiteDb.FileName);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sqlite/import/{Request.Query["id"]}", form); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/sqlite/import/{Request.Query["id"]}", form);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -287,9 +287,9 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
MultipartFormDataContent form = new MultipartFormDataContent(); MultipartFormDataContent form = new MultipartFormDataContent();
@ -299,7 +299,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var fileContent = stream.ToArray(); var fileContent = stream.ToArray();
form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, CorrecionDbModel.Db.FileName); form.Add(new ByteArrayContent(fileContent, 0, fileContent.Length), Poet.Nickname, CorrecionDbModel.Db.FileName);
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sqlite/update/{Request.Query["id"]}?note={CorrecionDbModel.Note}", form); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/sqlite/update/{Request.Query["id"]}?note={CorrecionDbModel.Note}", form);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -316,7 +316,7 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnGetDownloadSqliteDbAsync(int id) public async Task<IActionResult> OnGetDownloadSqliteDbAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
LastResult = ""; LastResult = "";
if(false == await PreparePoet()) if(false == await PreparePoet())
@ -324,9 +324,9 @@ namespace GanjooRazor.Areas.Admin.Pages
return BadRequest(LastResult); return BadRequest(LastResult);
} }
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
var content = await secureClient.GetStreamAsync($"{APIRoot.Url}/api/ganjoor/sqlite/export/{id}"); var content = await secureClient.GetStreamAsync($"{APIRoot.Url}/api/diwan/sqlite/export/{id}");
var contentType = "Application/octet-stream"; var contentType = "Application/octet-stream";
var fileName = $"{GPersianTextSync.Farglisize(Poet.Name)}.gdb"; var fileName = $"{GPersianTextSync.Farglisize(Poet.Name)}.gdb";
return File(content, contentType, fileName); return File(content, contentType, fileName);

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PoetDelModel @model DiwanRazor.Areas.Admin.Pages.PoetDelModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,14 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class PoetDelModel : PageModel public class PoetDelModel : PageModel
{ {
@ -39,11 +39,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public string LastResult { get; set; } public string LastResult { get; set; }
public GanjoorPoetViewModel Poet { get; set; } public DiwanPoetViewModel Poet { get; set; }
private async Task<bool> PreparePoet() private async Task<bool> PreparePoet()
{ {
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poet/{Request.Query["id"]}"); var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/diwan/poet/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
@ -51,7 +51,7 @@ namespace GanjooRazor.Areas.Admin.Pages
return false; return false;
} }
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync()); var poet = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
Poet = poet.Poet; Poet = poet.Poet;
@ -72,25 +72,25 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/poet/{Request.Query["id"]}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/poet/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
var cacheKey1 = $"/api/ganjoor/poets"; var cacheKey1 = $"/api/diwan/poets";
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets)) if (_memoryCache.TryGetValue(cacheKey1, out List<DiwanPoetViewModel> poets))
{ {
_memoryCache.Remove(cacheKey1); _memoryCache.Remove(cacheKey1);
} }
var cacheKey2 = $"/api/ganjoor/poet/{Request.Query["id"]}"; var cacheKey2 = $"/api/diwan/poet/{Request.Query["id"]}";
if (_memoryCache.TryGetValue(cacheKey2, out GanjoorPoetCompleteViewModel poet)) if (_memoryCache.TryGetValue(cacheKey2, out DiwanPoetCompleteViewModel poet))
{ {
_memoryCache.Remove(cacheKey2); _memoryCache.Remove(cacheKey2);
} }

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PoetsModel @model DiwanRazor.Areas.Admin.Pages.PoetsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,16 +1,16 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class PoetsModel : PageModel public class PoetsModel : PageModel
{ {
@ -22,16 +22,16 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// poets /// poets
/// </summary> /// </summary>
public GanjoorPoetViewModel[] Poets { get; set; } public DiwanPoetViewModel[] Poets { get; set; }
public List<GanjoorGeoLocation> Locations { get; set; } public List<DiwanGeoLocation> Locations { get; set; }
private async Task ReadLocationsAsync() private async Task ReadLocationsAsync()
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -40,10 +40,10 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Locations = new List<GanjoorGeoLocation>(); Locations = new List<DiwanGeoLocation>();
Locations.Add Locations.Add
( (
new GanjoorGeoLocation() new DiwanGeoLocation()
{ {
Id = 0, Id = 0,
Latitude = 0, Latitude = 0,
@ -52,7 +52,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
); );
Locations.AddRange(JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await response.Content.ReadAsStringAsync())); Locations.AddRange(JsonConvert.DeserializeObject<DiwanGeoLocation[]>(await response.Content.ReadAsStringAsync()));
} }
else else
@ -70,11 +70,11 @@ namespace GanjooRazor.Areas.Admin.Pages
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poets/secure"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poets/secure");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
@ -83,7 +83,7 @@ namespace GanjooRazor.Areas.Admin.Pages
await ReadLocationsAsync(); await ReadLocationsAsync();
Poets = JsonConvert.DeserializeObject<GanjoorPoetViewModel[]>(await response.Content.ReadAsStringAsync()); Poets = JsonConvert.DeserializeObject<DiwanPoetViewModel[]>(await response.Content.ReadAsStringAsync());
} }
else else
@ -98,11 +98,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostExportAllAsync() public async Task<IActionResult> OnPostExportAllAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sqlite/batchexport", null); var response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/sqlite/batchexport", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -116,11 +116,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<ActionResult> OnPostSavePoetMetaAsync(int id, int birth, int death, int pinorder, bool validbirth, bool validdeath, string birthlocation, string deathlocation) public async Task<ActionResult> OnPostSavePoetMetaAsync(int id, int birth, int death, int pinorder, bool validbirth, bool validdeath, string birthlocation, string deathlocation)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var poet = new GanjoorPoetViewModel() var poet = new DiwanPoetViewModel()
{ {
Id = id, Id = id,
BirthYearInLHijri = birth, BirthYearInLHijri = birth,
@ -131,14 +131,14 @@ namespace GanjooRazor.Areas.Admin.Pages
BirthPlace = birthlocation, BirthPlace = birthlocation,
DeathPlace = deathlocation DeathPlace = deathlocation
}; };
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/poet/{id}", new StringContent(JsonConvert.SerializeObject(poet), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/poet/{id}", new StringContent(JsonConvert.SerializeObject(poet), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
} }
_memoryCache.Remove($"/api/ganjoor/poets"); _memoryCache.Remove($"/api/diwan/poets");
_memoryCache.Remove($"/api/ganjoor/poet/{id}"); _memoryCache.Remove($"/api/diwan/poet/{id}");
return new OkObjectResult(true); return new OkObjectResult(true);
@ -151,11 +151,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostUpdatePeriodsAsync() public async Task<IActionResult> OnPostUpdatePeriodsAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/periods", null); var response = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/periods", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.PublicDataImportModel @model DiwanRazor.Areas.Admin.Pages.PublicDataImportModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -81,7 +81,7 @@
<div> <div>
<label for="location" style="display:block;margin-bottom:4px;">مسیر پوشه یا نشانی:</label> <label for="location" style="display:block;margin-bottom:4px;">مسیر پوشه یا نشانی:</label>
<input type="text" id="location" style="width:100%;" placeholder="C:\ganjoor-public-data یا https://cdn.jsdelivr.net/gh/ganjoor/ganjoor-data@main/" /> <input type="text" id="location" style="width:100%;" placeholder="C:\diwan-public-data یا https://cdn.jsdelivr.net/gh/diwan/diwan-data@main/" />
</div> </div>
<div> <div>

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -6,10 +6,10 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
/// <summary> /// <summary>
/// (Re)build local Ganjoor content from the public data export — local git clone or a URL /// (Re)build local Diwan content from the public data export — local git clone or a URL
/// (e.g. jsDelivr) — mainly meant to make setting up a fork or local dev copy easier than the /// (e.g. jsDelivr) — mainly meant to make setting up a fork or local dev copy easier than the
/// old per-poet SQLite import. /// old per-poet SQLite import.
/// </summary> /// </summary>
@ -43,9 +43,9 @@ namespace GanjooRazor.Areas.Admin.Pages
return BadRequest("مسیر یا نشانی نمی‌تواند خالی باشد."); return BadRequest("مسیر یا نشانی نمی‌تواند خالی باشد.");
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var body = new var body = new
{ {
@ -56,7 +56,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var response = await secureClient.PostAsync var response = await secureClient.PostAsync
( (
$"{APIRoot.Url}/api/ganjoor/publicdata/import", $"{APIRoot.Url}/api/diwan/publicdata/import",
new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json") new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json")
); );

View File

@ -1,6 +1,6 @@
@page @page
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@model GanjooRazor.Areas.Admin.Pages.ReviewCatEditsModel @model DiwanRazor.Areas.Admin.Pages.ReviewCatEditsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -119,39 +119,39 @@
<div class="up-field"> <div class="up-field">
<label>نتیجهٔ بررسی</label> <label>نتیجهٔ بررسی</label>
@if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.Result == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label> <label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label>
</div> </div>
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label> <label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label>
</div> </div>
} }
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_RejectedBecauseWrong" name="description_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="description_review_result_RejectedBecauseWrong" name="description_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="description_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="description_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_RejectedBecauseVariant" name="description_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="description_review_result_RejectedBecauseVariant" name="description_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="description_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="description_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="description_review_result_Rejected" name="description_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="description_review_result_Rejected" name="description_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="description_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="description_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<p class="up-hint up-hint--danger">دلیل را در یادداشت بررسی بنویسید.</p> <p class="up-hint up-hint--danger">دلیل را در یادداشت بررسی بنویسید.</p>
</div> </div>

View File

@ -1,28 +1,28 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq; using System.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using System.Text; using System.Text;
using System; using System;
using RMuseum.Utils; using RMuseum.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using GanjooRazor.Models; using DiwanRazor.Models;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ReviewCatEditsModel : PageModel public class ReviewCatEditsModel : PageModel
{ {
/// <summary> /// <summary>
/// correction /// correction
/// </summary> /// </summary>
public GanjoorCatCorrectionViewModel Correction { get; set; } public DiwanCatCorrectionViewModel Correction { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
/// </summary> /// </summary>
@ -46,7 +46,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
@ -55,11 +55,11 @@ namespace GanjooRazor.Areas.Admin.Pages
FatalError = ""; FatalError = "";
TotalCount = 0; TotalCount = 0;
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/correction/next?skip={Skip}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/correction/next?skip={Skip}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
@ -71,25 +71,25 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
} }
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanCatCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
if (Correction != null) if (Correction != null)
{ {
var catQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Correction.CatId}"); var catQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/{Correction.CatId}");
if (!catQuery.IsSuccessStatusCode) if (!catQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await catQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await catQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
var cat = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await catQuery.Content.ReadAsStringAsync()); var cat = JsonConvert.DeserializeObject<DiwanPoetCompleteViewModel>(await catQuery.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={cat.Cat.FullUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={cat.Cat.FullUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
Links = GanjoorHtmlTools.ExtractLinksWithRegex(Correction.DescriptionHtml); Links = DiwanHtmlTools.ExtractLinksWithRegex(Correction.DescriptionHtml);
Correction.Result = cat.Cat.DescriptionHtml == Correction.DescriptionHtml ? CorrectionReviewResult.NotChanged : CorrectionReviewResult.Approved; Correction.Result = cat.Cat.DescriptionHtml == Correction.DescriptionHtml ? CorrectionReviewResult.NotChanged : CorrectionReviewResult.Approved;
@ -116,17 +116,17 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms) public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/correction/{pms.correctionId}"); var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/correction/{pms.correctionId}");
if (!correctionResponse.IsSuccessStatusCode) if (!correctionResponse.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
} }
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanCatCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
if (Correction.DescriptionHtml != null) if (Correction.DescriptionHtml != null)
{ {
@ -142,7 +142,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/cat/correction/moderate", var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/cat/correction/moderate",
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json" new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
)); ));

View File

@ -1,8 +1,8 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ReviewEditsModel @model DiwanRazor.Areas.Admin.Pages.ReviewEditsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@using RMuseum.Models.Ganjoor @using RMuseum.Models.Diwan
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
ViewData["Title"] = "بازبینی ویرایش‌ها"; ViewData["Title"] = "بازبینی ویرایش‌ها";
@ -375,7 +375,7 @@ else
<tr> <tr>
<td colspan=2> <td colspan=2>
<a role="button" onclick="checkAllNotCorrect()" class="up-btn up-btn--ghost up-btn--sm">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</a> <a role="button" onclick="checkAllNotCorrect()" class="up-btn up-btn--ghost up-btn--sm">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</a>
</td> </td>
</tr> </tr>
@ -447,38 +447,38 @@ else
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.Result == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="title_review_result_NotChanged" name="title_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="title_review_result_NotChanged" name="title_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="title_review_result_NotChanged" name="title_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="title_review_result_NotChanged" name="title_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="title_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="title_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="title_review_result_RejectedBecauseWrong" name="title_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="title_review_result_RejectedBecauseWrong" name="title_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="title_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="title_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="title_review_result_RejectedBecauseVariant" name="title_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="title_review_result_RejectedBecauseVariant" name="title_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="title_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="title_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="title_review_result_Rejected" name="title_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="title_review_result_Rejected" name="title_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="title_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="title_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="title_review_note" name="title_review_note" value="" size="50" /> <input type="text" id="title_review_note" name="title_review_note" value="" size="50" />
</td> </td>
@ -520,38 +520,38 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.RhythmResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="rhythm_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="rhythm_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_RejectedBecauseWrong" name="rhythm_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="rhythm_review_result_RejectedBecauseWrong" name="rhythm_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="rhythm_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="rhythm_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_RejectedBecauseVariant" name="rhythm_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="rhythm_review_result_RejectedBecauseVariant" name="rhythm_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="rhythm_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="rhythm_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_Rejected" name="rhythm_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="rhythm_review_result_Rejected" name="rhythm_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="rhythm_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="rhythm_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
@if (Model.Correction.Title != null) @if (Model.Correction.Title != null)
{ {
@ -587,34 +587,34 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="rhyme_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="rhyme_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_RejectedBecauseWrong" name="rhyme_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="rhyme_review_result_RejectedBecauseWrong" name="rhyme_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="rhyme_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="rhyme_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_RejectedBecauseVariant" name="rhyme_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="rhyme_review_result_RejectedBecauseVariant" name="rhyme_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="rhyme_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="rhyme_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="title_review_note" name="title_review_note" value="" size="50" /> <input type="text" id="title_review_note" name="title_review_note" value="" size="50" />
</td> </td>
@ -658,34 +658,34 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm2_review_result_Approved" name="rhythm2_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="rhythm2_review_result_Approved" name="rhythm2_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="rhythm2_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="rhythm2_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
@if (Model.Correction.Rhythm2Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.Rhythm2Result == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<input type="radio" id="rhythm2_review_result_NotChanged" name="rhythm2_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="rhythm2_review_result_NotChanged" name="rhythm2_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<input type="radio" id="rhythm2_review_result_NotChanged" name="rhythm2_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="rhythm2_review_result_NotChanged" name="rhythm2_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="rhythm2_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="rhythm2_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm2_review_result_RejectedBecauseWrong" name="rhythm2_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="rhythm2_review_result_RejectedBecauseWrong" name="rhythm2_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="rhythm2_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="rhythm2_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm2_review_result_RejectedBecauseVariant" name="rhythm2_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="rhythm2_review_result_RejectedBecauseVariant" name="rhythm2_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="rhythm2_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label> <label for="rhythm2_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_2review_result_RejectedBecauseUnnecessaryChange" name="rhythm2_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseUnnecessaryChange"> <input type="radio" id="rhythm_2review_result_RejectedBecauseUnnecessaryChange" name="rhythm2_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
<label for="rhythm2_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="rhythm2_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm2_review_result_Rejected" name="rhythm2_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="rhythm2_review_result_Rejected" name="rhythm2_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="rhythm2_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="rhythm2_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
@if (Model.Correction.Title != null) @if (Model.Correction.Title != null)
{ {
@ -712,47 +712,47 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<p id="original-poemformat" class="red-color">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p> <p id="original-poemformat" class="red-color">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p>
</td> </td>
<td> <td>
<p id="edited-poemformat" class="green-color">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p> <p id="edited-poemformat" class="green-color">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="poemformat_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="poemformat_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_RejectedBecauseWrong" name="poemformat_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="poemformat_review_result_RejectedBecauseWrong" name="poemformat_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="poemformat_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="poemformat_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_RejectedBecauseVariant" name="poemformat_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="poemformat_review_result_RejectedBecauseVariant" name="poemformat_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Rejected" name="poemformat_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="poemformat_review_result_Rejected" name="poemformat_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="poemformat_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="poemformat_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" size="50" /> <input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" size="50" />
</td> </td>
@ -791,81 +791,81 @@ else
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (Model.Correction.SummaryReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.SummaryReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="poem-summary_review_result_NotChanged" name="poem-summary_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="poem-summary_review_result_NotChanged" name="poem-summary_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="poem-summary_review_result_NotChanged" name="poem-summary_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="poem-summary_review_result_NotChanged" name="poem-summary_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="poem-summary_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="poem-summary_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedBecauseWrong" name="poem-summary_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="poem-summary_review_result_RejectedBecauseWrong" name="poem-summary_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="poem-summary_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="poem-summary_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseInformal" name="poem-summary_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseInformal" name="poem-summary_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseInformal">
<label for="poem-summary_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseArtificial" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseArtificial" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial">
<label for="poem-summary_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable">
<label for="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas">
<label for="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors">
<label for="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseNotBetter" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseNotBetter" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter">
<label for="poem-summary_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase">
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution"> <input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution">
<label for="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label> <label for="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poem-summary_review_result_Rejected" name="poem-summary_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="poem-summary_review_result_Rejected" name="poem-summary_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="poem-summary_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="poem-summary_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="poem-summary_review_note" name="poem-summary_review_note" value="" size="50" /> <input type="text" id="poem-summary_review_note" name="poem-summary_review_note" value="" size="50" />
@ -932,13 +932,13 @@ else
} }
else if (isPersonTag) else if (isPersonTag)
{ {
RMuseum.Models.Ganjoor.ViewModels.PersonGraphSuggestion personGraph = null; RMuseum.Models.Diwan.ViewModels.PersonGraphSuggestion personGraph = null;
string personGraphError = null; string personGraphError = null;
if (geoTag.PersonId == null && !string.IsNullOrEmpty(geoTag.SuggestedPersonGraphJson)) if (geoTag.PersonId == null && !string.IsNullOrEmpty(geoTag.SuggestedPersonGraphJson))
{ {
try try
{ {
personGraph = Newtonsoft.Json.JsonConvert.DeserializeObject<RMuseum.Models.Ganjoor.ViewModels.PersonGraphSuggestion>(geoTag.SuggestedPersonGraphJson); personGraph = Newtonsoft.Json.JsonConvert.DeserializeObject<RMuseum.Models.Diwan.ViewModels.PersonGraphSuggestion>(geoTag.SuggestedPersonGraphJson);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -992,11 +992,11 @@ else
{ {
<p><small>خویشاوندان/وابستگان همراه این پیشنهاد:</small></p> <p><small>خویشاوندان/وابستگان همراه این پیشنهاد:</small></p>
<ul> <ul>
@foreach (var relation in personGraph.Relations ?? new List<RMuseum.Models.Ganjoor.ViewModels.PersonGraphRelationEntry>()) @foreach (var relation in personGraph.Relations ?? new List<RMuseum.Models.Diwan.ViewModels.PersonGraphRelationEntry>())
{ {
var otherNode = personGraph.RelatedPeople.Where(p => p.LocalKey == (relation.Person1 == personGraph.Person.LocalKey ? relation.Person2 : relation.Person1)).FirstOrDefault(); var otherNode = personGraph.RelatedPeople.Where(p => p.LocalKey == (relation.Person1 == personGraph.Person.LocalKey ? relation.Person2 : relation.Person1)).FirstOrDefault();
var otherName = otherNode != null var otherName = otherNode != null
? (otherNode.ExistingPersonId != null ? (Model.People ?? new List<GanjoorRelatedPerson>()).Where(p => p.Id == otherNode.ExistingPersonId).Select(p => p.Name).FirstOrDefault() : otherNode.Name) ? (otherNode.ExistingPersonId != null ? (Model.People ?? new List<DiwanRelatedPerson>()).Where(p => p.Id == otherNode.ExistingPersonId).Select(p => p.Name).FirstOrDefault() : otherNode.Name)
: null; : null;
<li> <li>
<small> <small>
@ -1021,7 +1021,7 @@ else
<label for="geotag@(geoIndex)_person_search">اتصال به نامبردۀ موجود در فهرست (در صورت وجود اشتباه در تشخیص نامبرده):</label> <label for="geotag@(geoIndex)_person_search">اتصال به نامبردۀ موجود در فهرست (در صورت وجود اشتباه در تشخیص نامبرده):</label>
<div class="up-autocomplete-wrap"> <div class="up-autocomplete-wrap">
<input type="text" id="geotag@(geoIndex)_person_search" autocomplete="off" placeholder="نام نامبرده را تایپ کنید..." <input type="text" id="geotag@(geoIndex)_person_search" autocomplete="off" placeholder="نام نامبرده را تایپ کنید..."
value="@(geoTag.PersonId != null ? (Model.People ?? new List<GanjoorRelatedPerson>()).Where(p => p.Id == geoTag.PersonId).Select(p => p.Name).FirstOrDefault() : null)" /> value="@(geoTag.PersonId != null ? (Model.People ?? new List<DiwanRelatedPerson>()).Where(p => p.Id == geoTag.PersonId).Select(p => p.Name).FirstOrDefault() : null)" />
<input type="hidden" id="geotag@(geoIndex)_person_select" name="geotag@(geoIndex)_person_select" value="@(geoTag.PersonId ?? 0)" /> <input type="hidden" id="geotag@(geoIndex)_person_select" name="geotag@(geoIndex)_person_select" value="@(geoTag.PersonId ?? 0)" />
<div id="geotag@(geoIndex)_person_results" class="up-autocomplete-results" style="display:none;"></div> <div id="geotag@(geoIndex)_person_results" class="up-autocomplete-results" style="display:none;"></div>
</div> </div>
@ -1094,7 +1094,7 @@ else
<label for="geotag@(geoIndex)_location_search">اتصال به مکان موجود در فهرست (در صورت وجود اشتباه در تشخیص مکان):</label> <label for="geotag@(geoIndex)_location_search">اتصال به مکان موجود در فهرست (در صورت وجود اشتباه در تشخیص مکان):</label>
<div class="up-autocomplete-wrap"> <div class="up-autocomplete-wrap">
<input type="text" id="geotag@(geoIndex)_location_search" autocomplete="off" placeholder="نام مکان را تایپ کنید..." <input type="text" id="geotag@(geoIndex)_location_search" autocomplete="off" placeholder="نام مکان را تایپ کنید..."
value="@(geoTag.LocationId != null ? (Model.Locations ?? new List<GanjoorGeoLocation>()).Where(l => l.Id == geoTag.LocationId).Select(l => l.Name).FirstOrDefault() : null)" /> value="@(geoTag.LocationId != null ? (Model.Locations ?? new List<DiwanGeoLocation>()).Where(l => l.Id == geoTag.LocationId).Select(l => l.Name).FirstOrDefault() : null)" />
<input type="hidden" id="geotag@(geoIndex)_location_select" name="geotag@(geoIndex)_location_select" value="@(geoTag.LocationId ?? 0)" /> <input type="hidden" id="geotag@(geoIndex)_location_select" name="geotag@(geoIndex)_location_select" value="@(geoTag.LocationId ?? 0)" />
<div id="geotag@(geoIndex)_location_results" class="up-autocomplete-results" style="display:none;"></div> <div id="geotag@(geoIndex)_location_results" class="up-autocomplete-results" style="display:none;"></div>
</div> </div>
@ -1155,20 +1155,20 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="geotag@(geoIndex)_review_result_Approved" name="geotag@(geoIndex)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="geotag@(geoIndex)_review_result_Approved" name="geotag@(geoIndex)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="geotag@(geoIndex)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="geotag@(geoIndex)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="geotag@(geoIndex)_review_result_RejectedBecauseWrong" name="geotag@(geoIndex)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="geotag@(geoIndex)_review_result_RejectedBecauseWrong" name="geotag@(geoIndex)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="geotag@(geoIndex)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="geotag@(geoIndex)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="geotag@(geoIndex)_review_result_RejectedBecauseUnnecessaryChange" name="geotag@(geoIndex)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseUnnecessaryChange"> <input type="radio" id="geotag@(geoIndex)_review_result_RejectedBecauseUnnecessaryChange" name="geotag@(geoIndex)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
<label for="geotag@(geoIndex)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="geotag@(geoIndex)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="geotag@(geoIndex)_review_result_Rejected" name="geotag@(geoIndex)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="geotag@(geoIndex)_review_result_Rejected" name="geotag@(geoIndex)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="geotag@(geoIndex)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="geotag@(geoIndex)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="geotag@(geoIndex)_review_note" name="geotag@(geoIndex)_review_note" value="" size="50" /> <input type="text" id="geotag@(geoIndex)_review_note" name="geotag@(geoIndex)_review_note" value="" size="50" />
</td> </td>
@ -1226,42 +1226,42 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (verse.NewVerseResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (verse.NewVerseResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="verse@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="verse@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseVariant" name="verse@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseVariant" name="verse@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange" name="verse@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseUnnecessaryChange"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange" name="verse@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" /> <input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" />
</td> </td>
@ -1285,45 +1285,45 @@ else
@if (verse.OriginalVersePosition != null) @if (verse.OriginalVersePosition != null)
{ {
<text> <text>
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.OriginalVersePosition)</p> نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Diwan.VersePosition)verse.OriginalVersePosition)</p>
</text> </text>
} }
</td> </td>
<td> <td>
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.VersePosition)</p> نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Diwan.VersePosition)verse.VersePosition)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if(Model.ApproveVersePositionChanges) @if(Model.ApproveVersePositionChanges)
{ {
<input type="radio" id="verse-position@(verse.VORder)_review_result_Approved" name="verse-position@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="verse-position@(verse.VORder)_review_result_Approved" name="verse-position@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
} }
else else
{ {
<input type="radio" id="verse-position@(verse.VORder)_review_result_Approved" name="verse-position@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="verse-position@(verse.VORder)_review_result_Approved" name="verse-position@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
} }
<label for="verse-position@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse-position@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
<br> <br>
@if (verse.VersePositionResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (verse.VersePositionResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<input type="radio" id="verse-position@(verse.VORder)_review_result_NotChanged" name="verse-position@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="verse-position@(verse.VORder)_review_result_NotChanged" name="verse-position@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<input type="radio" id="verse-position@(verse.VORder)_review_result_NotChanged" name="verse-position@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="verse-position@(verse.VORder)_review_result_NotChanged" name="verse-position@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="verse-position@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="verse-position@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-position@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-position@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-position@(verse.VORder)_review_result_Rejected" name="verse-position@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="verse-position@(verse.VORder)_review_result_Rejected" name="verse-position@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="verse-position@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="verse-position@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-position@(verse.VORder)_review_result_NotSuggectedByUser" name="verse-position@(verse.VORder)_review_result" class="radio-bug" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotSuggestedByUser"> <input type="radio" id="verse-position@(verse.VORder)_review_result_NotSuggectedByUser" name="verse-position@(verse.VORder)_review_result" class="radio-bug" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotSuggestedByUser">
<label for="verse-position@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرم‌افزار دیوان</label> <label for="verse-position@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرم‌افزار دیوان</label>
</div> </div>
</td> </td>
@ -1352,57 +1352,57 @@ else
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (verse.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (verse.Result == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="verse@(verse.VORder)_review_result_NotChanged" name="verse@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="verse@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="verse@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseVariant" name="verse@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseVariant" name="verse@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange" name="verse@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseUnnecessaryChange"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange" name="verse@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseOfAbusingPunctuations" name="verse@(verse.VORder)_review_result" class="radio-punctuation" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseOfAbusingPunctuations"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseOfAbusingPunctuations" name="verse@(verse.VORder)_review_result" class="radio-punctuation" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseOfAbusingPunctuations">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseOfAbusingPunctuations">از علائم سجاوندی به طور نامناسب استفاده شده است.</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseOfAbusingPunctuations">از علائم سجاوندی به طور نامناسب استفاده شده است.</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseOfNonStandardCharcaters" name="verse@(verse.VORder)_review_result" class="radio-nonstandard" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseOfNonStandardCharcaters"> <input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseOfNonStandardCharcaters" name="verse@(verse.VORder)_review_result" class="radio-nonstandard" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseOfNonStandardCharcaters">
<label for="verse@(verse.VORder)_review_result_RejectedBecauseOfNonStandardCharcaters">برای هٔ چسبان یا نویسه‌های دیگر از دستور خط فرهنگستان تبعیت نشده است.</label> <label for="verse@(verse.VORder)_review_result_RejectedBecauseOfNonStandardCharcaters">برای هٔ چسبان یا نویسه‌های دیگر از دستور خط فرهنگستان تبعیت نشده است.</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" /> <input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" />
</td> </td>
@ -1438,35 +1438,35 @@ else
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (verse.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (verse.LanguageReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse-language@(verse.VORder)_review_result_NotChanged" name="verse-language@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="verse-language@(verse.VORder)_review_result_NotChanged" name="verse-language@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse-language@(verse.VORder)_review_result_NotChanged" name="verse-language@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="verse-language@(verse.VORder)_review_result_NotChanged" name="verse-language@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="verse-language@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="verse-language@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-language@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-language@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-language@(verse.VORder)_review_result_Rejected" name="verse-language@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="verse-language@(verse.VORder)_review_result_Rejected" name="verse-language@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="verse-language@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="verse-language@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-language@(verse.VORder)_review_result_NotSuggectedByUser" name="verse-language@(verse.VORder)_review_result" class="radio-bug" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotSuggestedByUser"> <input type="radio" id="verse-language@(verse.VORder)_review_result_NotSuggectedByUser" name="verse-language@(verse.VORder)_review_result" class="radio-bug" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotSuggestedByUser">
<label for="verse-language@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرم‌افزار دیوان</label> <label for="verse-language@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرم‌افزار دیوان</label>
</div> </div>
</td> </td>
@ -1500,81 +1500,81 @@ else
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@if (verse.SummaryReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (verse.SummaryReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse-summary@(verse.VORder)_review_result_NotChanged" name="verse-summary@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_NotChanged" name="verse-summary@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label> <label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Approved)</label>
</div> </div>
<br> <br>
<input type="radio" id="verse-summary@(verse.VORder)_review_result_NotChanged" name="verse-summary@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_NotChanged" name="verse-summary@(verse.VORder)_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
} }
<label for="verse-summary@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label><br> <label for="verse-summary@(verse.VORder)_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)</label><br>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-summary@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-summary@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal" name="verse-summary@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal" name="verse-summary@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseInformal">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution">
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label> <label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Rejected" name="verse-summary@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="verse-summary@(verse.VORder)_review_result_Rejected" name="verse-summary@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="verse-summary@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label> <label for="verse-summary@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Diwan.CorrectionReviewResult.Rejected)</label>
</div> </div>
<input type="text" id="verse-summary@(verse.VORder)_review_note" name="verse-summary@(verse.VORder)_review_note" value="" size="50" /> <input type="text" id="verse-summary@(verse.VORder)_review_note" name="verse-summary@(verse.VORder)_review_note" value="" size="50" />

View File

@ -5,24 +5,24 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Models; using DiwanRazor.Models;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ReviewEditsModel : PageModel public class ReviewEditsModel : PageModel
{ {
/// <summary> /// <summary>
/// correction /// correction
/// </summary> /// </summary>
public GanjoorPoemCorrectionViewModel Correction { get; set; } public DiwanPoemCorrectionViewModel Correction { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
/// </summary> /// </summary>
@ -45,15 +45,15 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
public GanjoorMetre GanjoorMetre1 { get; set; } public DiwanMetre DiwanMetre1 { get; set; }
public GanjoorMetre GanjoorMetre2 { get; set; } public DiwanMetre DiwanMetre2 { get; set; }
public string RhymeLetters { get; set; } public string RhymeLetters { get; set; }
public GanjoorLanguage[] Languages { get; set; } public DiwanLanguage[] Languages { get; set; }
public bool ApproveVersePositionChanges { get; set; } public bool ApproveVersePositionChanges { get; set; }
@ -66,7 +66,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// full location catalog, offered as an alternative to a user's new-location suggestion so the /// full location catalog, offered as an alternative to a user's new-location suggestion so the
/// moderator can correct a mistyped/duplicate name by linking it to the existing entry instead /// moderator can correct a mistyped/duplicate name by linking it to the existing entry instead
/// </summary> /// </summary>
public List<GanjoorGeoLocation> Locations { get; set; } public List<DiwanGeoLocation> Locations { get; set; }
/// <summary> /// <summary>
/// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side for the /// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side for the
@ -75,7 +75,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public string AllLocationsJson => public string AllLocationsJson =>
JsonConvert.SerializeObject( JsonConvert.SerializeObject(
(Locations ?? new List<GanjoorGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }), (Locations ?? new List<DiwanGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() } new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
); );
@ -84,7 +84,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// moderator can correct a duplicate/misidentified suggestion by linking it to the existing /// moderator can correct a duplicate/misidentified suggestion by linking it to the existing
/// entry instead - same purpose as Locations above /// entry instead - same purpose as Locations above
/// </summary> /// </summary>
public List<GanjoorRelatedPerson> People { get; set; } public List<DiwanRelatedPerson> People { get; set; }
/// <summary> /// <summary>
/// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only), used /// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only), used
@ -93,7 +93,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public string AllPeopleJson => public string AllPeopleJson =>
JsonConvert.SerializeObject( JsonConvert.SerializeObject(
(People ?? new List<GanjoorRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }), (People ?? new List<DiwanRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() } new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
); );
@ -103,7 +103,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
/// <param name="verses"></param> /// <param name="verses"></param>
/// <returns></returns> /// <returns></returns>
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses) private Tuple<int, string>[] GetCouplets(DiwanVerseViewModel[] verses)
{ {
int coupetIndex = -1; int coupetIndex = -1;
string coupletText = ""; string coupletText = "";
@ -157,7 +157,7 @@ namespace GanjooRazor.Areas.Admin.Pages
return; return;
} }
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync()); Languages = JsonConvert.DeserializeObject<DiwanLanguage[]>(await response.Content.ReadAsStringAsync());
} }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
@ -170,11 +170,11 @@ namespace GanjooRazor.Areas.Admin.Pages
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
OnlyUserCorrections = string.IsNullOrEmpty(Request.Query["onlyUserCorrections"]) ? true : bool.Parse(Request.Query["onlyUserCorrections"]); OnlyUserCorrections = string.IsNullOrEmpty(Request.Query["onlyUserCorrections"]) ? true : bool.Parse(Request.Query["onlyUserCorrections"]);
ApproveVersePositionChanges = string.IsNullOrEmpty(Request.Query["posok"]) ? false : bool.Parse(Request.Query["posok"]); ApproveVersePositionChanges = string.IsNullOrEmpty(Request.Query["posok"]) ? false : bool.Parse(Request.Query["posok"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/correction/next?skip={Skip}&onlyUserCorrections={OnlyUserCorrections}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/correction/next?skip={Skip}&onlyUserCorrections={OnlyUserCorrections}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
@ -190,10 +190,10 @@ namespace GanjooRazor.Areas.Admin.Pages
await ReadLanguagesAsync(secureClient); await ReadLanguagesAsync(secureClient);
Correction = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanPoemCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
if(Correction != null) if(Correction != null)
{ {
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Correction.PoemId}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={Correction.PoemId}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -201,13 +201,13 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
Couplets = GetCouplets(PageInformation.Poem.Verses); Couplets = GetCouplets(PageInformation.Poem.Verses);
@ -219,9 +219,9 @@ namespace GanjooRazor.Areas.Admin.Pages
FatalError = JsonConvert.DeserializeObject<string>(await responseLocations.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await responseLocations.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Locations = new List<GanjoorGeoLocation>(); Locations = new List<DiwanGeoLocation>();
Locations.Add(new GanjoorGeoLocation() { Id = 0, Latitude = 0, Longitude = 0, Name = "" }); Locations.Add(new DiwanGeoLocation() { Id = 0, Latitude = 0, Longitude = 0, Name = "" });
Locations.AddRange(JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync())); Locations.AddRange(JsonConvert.DeserializeObject<DiwanGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync()));
var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people"); var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people");
if (!responsePeople.IsSuccessStatusCode) if (!responsePeople.IsSuccessStatusCode)
@ -229,9 +229,9 @@ namespace GanjooRazor.Areas.Admin.Pages
FatalError = JsonConvert.DeserializeObject<string>(await responsePeople.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await responsePeople.Content.ReadAsStringAsync());
return Page(); return Page();
} }
People = new List<GanjoorRelatedPerson>(); People = new List<DiwanRelatedPerson>();
People.Add(new GanjoorRelatedPerson() { Id = 0, Name = "" }); People.Add(new DiwanRelatedPerson() { Id = 0, Name = "" });
People.AddRange(JsonConvert.DeserializeObject<GanjoorRelatedPerson[]>(await responsePeople.Content.ReadAsStringAsync())); People.AddRange(JsonConvert.DeserializeObject<DiwanRelatedPerson[]>(await responsePeople.Content.ReadAsStringAsync()));
} }
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).Any()) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).Any())
@ -239,12 +239,12 @@ namespace GanjooRazor.Areas.Admin.Pages
RhymeLetters = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).OrderBy(s => s.VerseType).First().RhymeLetters; RhymeLetters = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).OrderBy(s => s.VerseType).First().RhymeLetters;
} }
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Any()) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).Any())
{ {
GanjoorMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).First().GanjoorMetre; DiwanMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).OrderBy(s => s.VerseType).First().DiwanMetre;
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Count() > 1) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).Count() > 1)
{ {
GanjoorMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).ToList()[1].GanjoorMetre; DiwanMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).OrderBy(s => s.VerseType).ToList()[1].DiwanMetre;
} }
} }
@ -298,10 +298,10 @@ namespace GanjooRazor.Areas.Admin.Pages
if (Correction.Rhythm != null) if (Correction.Rhythm != null)
{ {
GanjoorMetre originalMetre = null; DiwanMetre originalMetre = null;
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null && s.VerseType == VersePoemSectionType.First).Any()) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null && s.VerseType == VersePoemSectionType.First).Any())
{ {
originalMetre = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.VerseType == VersePoemSectionType.First && s.GanjoorMetre != null).OrderBy(s => s.VerseType).First().GanjoorMetre; originalMetre = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.VerseType == VersePoemSectionType.First && s.DiwanMetre != null).OrderBy(s => s.VerseType).First().DiwanMetre;
} }
Correction.OriginalRhythm = originalMetre == null ? null : originalMetre.Rhythm; Correction.OriginalRhythm = originalMetre == null ? null : originalMetre.Rhythm;
if (Correction.OriginalRhythm == Correction.Rhythm) if (Correction.OriginalRhythm == Correction.Rhythm)
@ -310,10 +310,10 @@ namespace GanjooRazor.Areas.Admin.Pages
if (Correction.Rhythm2 != null) if (Correction.Rhythm2 != null)
{ {
GanjoorMetre originalMetre2 = null; DiwanMetre originalMetre2 = null;
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null && s.VerseType == VersePoemSectionType.Second).Any()) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null && s.VerseType == VersePoemSectionType.Second).Any())
{ {
originalMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null && s.VerseType == VersePoemSectionType.Second).OrderBy(s => s.VerseType).First().GanjoorMetre; originalMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null && s.VerseType == VersePoemSectionType.Second).OrderBy(s => s.VerseType).First().DiwanMetre;
} }
Correction.OriginalRhythm2 = originalMetre2 == null ? null : originalMetre2.Rhythm; Correction.OriginalRhythm2 = originalMetre2 == null ? null : originalMetre2.Rhythm;
if (Correction.OriginalRhythm2 == Correction.Rhythm2) if (Correction.OriginalRhythm2 == Correction.Rhythm2)
@ -345,17 +345,17 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms) public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/correction/{pms.correctionId}"); var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/correction/{pms.correctionId}");
if (!correctionResponse.IsSuccessStatusCode) if (!correctionResponse.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
} }
Correction = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
if (Correction.Title != null) if (Correction.Title != null)
{ {
@ -615,7 +615,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
} }
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/correction/moderate", var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/correction/moderate",
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json" new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
)); ));
@ -641,7 +641,7 @@ namespace GanjooRazor.Areas.Admin.Pages
// OnPostDeletePoemCorrectionsAsync in Editor.cshtml.cs for the same // OnPostDeletePoemCorrectionsAsync in Editor.cshtml.cs for the same
// pattern). Guard against it not being one - e.g. an HTML error page // pattern). Guard against it not being one - e.g. an HTML error page
// from a proxy/host in front of the API - so that doesn't throw an // from a proxy/host in front of the API - so that doesn't throw an
// unhandled exception here and surface as GanjooRazor's own generic HTML // unhandled exception here and surface as DiwanRazor's own generic HTML
// error page, which is unreadable and leaves the real error only in the // error page, which is unreadable and leaves the real error only in the
// Windows Event Log. // Windows Event Log.
err = JsonConvert.DeserializeObject<string>(err); err = JsonConvert.DeserializeObject<string>(err);

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ReviewPartEditsModel @model DiwanRazor.Areas.Admin.Pages.ReviewPartEditsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
@ -275,34 +275,34 @@ else
<p class="green-color">@Model.Correction.Rhythm</p> <p class="green-color">@Model.Correction.Rhythm</p>
</div> </div>
<div class="up-field"> <div class="up-field">
@if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.RhythmResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="rhythm_review_result_Approved">تأیید می‌شود</label> <label for="rhythm_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
<label for="rhythm_review_result_NotChanged">تغییری نکرده</label> <label for="rhythm_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="rhythm_review_result_Approved">تأیید می‌شود</label> <label for="rhythm_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="rhythm_review_result_NotChanged" name="rhythm_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
<label for="rhythm_review_result_NotChanged">تغییری نکرده</label> <label for="rhythm_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_RejectedBecauseWrong" name="rhythm_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="rhythm_review_result_RejectedBecauseWrong" name="rhythm_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="rhythm_review_result_RejectedBecauseWrong">درست نیست</label> <label for="rhythm_review_result_RejectedBecauseWrong">درست نیست</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhythm_review_result_RejectedBecauseVariant" name="rhythm_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="rhythm_review_result_RejectedBecauseVariant" name="rhythm_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="rhythm_review_result_Rejected">به دلیل دیگری رد می‌شود</label> <label for="rhythm_review_result_Rejected">به دلیل دیگری رد می‌شود</label>
</div> </div>
<input type="text" id="title_review_note" name="title_review_note" value="" placeholder="یادداشت بررسی" /> <input type="text" id="title_review_note" name="title_review_note" value="" placeholder="یادداشت بررسی" />
@ -325,34 +325,34 @@ else
<p class="green-color">@Model.Correction.RhymeLetters</p> <p class="green-color">@Model.Correction.RhymeLetters</p>
</div> </div>
<div class="up-field"> <div class="up-field">
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="rhyme_review_result_Approved">تأیید می‌شود</label> <label for="rhyme_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
<label for="rhyme_review_result_NotChanged">تغییری نکرده</label> <label for="rhyme_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="rhyme_review_result_Approved">تأیید می‌شود</label> <label for="rhyme_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="rhyme_review_result_NotChanged" name="rhyme_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
<label for="rhyme_review_result_NotChanged">تغییری نکرده</label> <label for="rhyme_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_RejectedBecauseWrong" name="rhyme_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="rhyme_review_result_RejectedBecauseWrong" name="rhyme_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="rhyme_review_result_RejectedBecauseWrong">درست نیست</label> <label for="rhyme_review_result_RejectedBecauseWrong">درست نیست</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="rhyme_review_result_RejectedBecauseVariant" name="rhyme_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="rhyme_review_result_RejectedBecauseVariant" name="rhyme_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="rhyme_review_result_Rejected">به دلیل دیگری رد می‌شود</label> <label for="rhyme_review_result_Rejected">به دلیل دیگری رد می‌شود</label>
</div> </div>
<input type="text" id="title_review_note" name="title_review_note" value="" placeholder="یادداشت بررسی" /> <input type="text" id="title_review_note" name="title_review_note" value="" placeholder="یادداشت بررسی" />
@ -371,38 +371,38 @@ else
<p id="edited-language" class="green-color">@Model.Correction.Language</p> <p id="edited-language" class="green-color">@Model.Correction.Language</p>
</div> </div>
<div class="up-field"> <div class="up-field">
@if (Model.Correction.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.LanguageReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_Approved" name="language_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="language_review_result_Approved" name="language_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="language_review_result_Approved">تأیید می‌شود</label> <label for="language_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_NotChanged" name="language_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="language_review_result_NotChanged" name="language_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
<label for="language_review_result_NotChanged">تغییری نکرده</label> <label for="language_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_Approved" name="language_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="language_review_result_Approved" name="language_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="language_review_result_Approved">تأیید می‌شود</label> <label for="language_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_NotChanged" name="language_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="language_review_result_NotChanged" name="language_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
<label for="language_review_result_NotChanged">تغییری نکرده</label> <label for="language_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_RejectedBecauseWrong" name="language_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="language_review_result_RejectedBecauseWrong" name="language_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="language_review_result_RejectedBecauseWrong">درست نیست</label> <label for="language_review_result_RejectedBecauseWrong">درست نیست</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_RejectedBecauseVariant" name="language_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="language_review_result_RejectedBecauseVariant" name="language_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="language_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="language_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="language_review_result_Rejected" name="language_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="language_review_result_Rejected" name="language_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="language_review_result_Rejected">به دلیل دیگری رد می‌شود</label> <label for="language_review_result_Rejected">به دلیل دیگری رد می‌شود</label>
</div> </div>
<input type="text" id="language_review_note" name="language_review_note" value="" placeholder="یادداشت بررسی" /> <input type="text" id="language_review_note" name="language_review_note" value="" placeholder="یادداشت بررسی" />
@ -414,45 +414,45 @@ else
<h2 class="up-card__title">قالب شعری</h2> <h2 class="up-card__title">قالب شعری</h2>
<div class="up-field"> <div class="up-field">
<label>متن اولیه</label> <label>متن اولیه</label>
<p id="original-poemformat" class="red-color">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p> <p id="original-poemformat" class="red-color">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>پیشنهاد</label> <label>پیشنهاد</label>
<p id="edited-poemformat" class="green-color">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p> <p id="edited-poemformat" class="green-color">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p>
</div> </div>
<div class="up-field"> <div class="up-field">
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged) @if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged)
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved"> <input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved">
<label for="poemformat_review_result_Approved">تأیید می‌شود</label> <label for="poemformat_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged" checked="checked"> <input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged" checked="checked">
<label for="poemformat_review_result_NotChanged">تغییری نکرده</label> <label for="poemformat_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
else else
{ {
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved" checked="checked"> <input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Approved" checked="checked">
<label for="poemformat_review_result_Approved">تأیید می‌شود</label> <label for="poemformat_review_result_Approved">تأیید می‌شود</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged"> <input type="radio" id="poemformat_review_result_NotChanged" name="poemformat_review_result" class="radio-notchanged" value="@RMuseum.Models.Diwan.CorrectionReviewResult.NotChanged">
<label for="poemformat_review_result_NotChanged">تغییری نکرده</label> <label for="poemformat_review_result_NotChanged">تغییری نکرده</label>
</div> </div>
} }
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_RejectedBecauseWrong" name="poemformat_review_result" class="radio-notcorrect" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong"> <input type="radio" id="poemformat_review_result_RejectedBecauseWrong" name="poemformat_review_result" class="radio-notcorrect" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseWrong">
<label for="poemformat_review_result_RejectedBecauseWrong">درست نیست</label> <label for="poemformat_review_result_RejectedBecauseWrong">درست نیست</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_RejectedBecauseVariant" name="poemformat_review_result" class="radio-variant" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseVariant"> <input type="radio" id="poemformat_review_result_RejectedBecauseVariant" name="poemformat_review_result" class="radio-variant" value="@RMuseum.Models.Diwan.CorrectionReviewResult.RejectedBecauseVariant">
<label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label> <label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقه‌ای یا بی دلیل است</label>
</div> </div>
<div class="up-radio-option"> <div class="up-radio-option">
<input type="radio" id="poemformat_review_result_Rejected" name="poemformat_review_result" class="radio-rejected" value="@RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected"> <input type="radio" id="poemformat_review_result_Rejected" name="poemformat_review_result" class="radio-rejected" value="@RMuseum.Models.Diwan.CorrectionReviewResult.Rejected">
<label for="poemformat_review_result_Rejected">به دلیل دیگری رد می‌شود</label> <label for="poemformat_review_result_Rejected">به دلیل دیگری رد می‌شود</label>
</div> </div>
<input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" placeholder="یادداشت بررسی" /> <input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" placeholder="یادداشت بررسی" />

View File

@ -3,24 +3,24 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System.Collections.Generic; using System.Collections.Generic;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ReviewPartEditsModel : PageModel public class ReviewPartEditsModel : PageModel
{ {
/// <summary> /// <summary>
/// correction /// correction
/// </summary> /// </summary>
public GanjoorPoemSectionCorrectionViewModel Correction { get; set; } public DiwanPoemSectionCorrectionViewModel Correction { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
/// </summary> /// </summary>
@ -46,32 +46,32 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
/// <summary> /// <summary>
/// poem section /// poem section
/// </summary> /// </summary>
public GanjoorPoemSection PoemSection { get; set; } public DiwanPoemSection PoemSection { get; set; }
/// <summary> /// <summary>
/// verses /// verses
/// </summary> /// </summary>
public List<GanjoorVerseViewModel> Verses { get; set; } public List<DiwanVerseViewModel> Verses { get; set; }
/// <summary> /// <summary>
/// rhythms alphabetically /// rhythms alphabetically
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsAlphabetically { get; set; } public DiwanMetre[] RhythmsAlphabetically { get; set; }
/// <summary> /// <summary>
/// rhythms by frequency /// rhythms by frequency
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsByVerseCount { get; set; } public DiwanMetre[] RhythmsByVerseCount { get; set; }
private List<GanjoorVerseViewModel> _FilterSectionVerses(GanjoorPoemSection section, GanjoorVerseViewModel[] verses) private List<DiwanVerseViewModel> _FilterSectionVerses(DiwanPoemSection section, DiwanVerseViewModel[] verses)
{ {
List<GanjoorVerseViewModel> sectionVerses = new List<GanjoorVerseViewModel>(); List<DiwanVerseViewModel> sectionVerses = new List<DiwanVerseViewModel>();
foreach (GanjoorVerseViewModel verse in verses) foreach (DiwanVerseViewModel verse in verses)
{ {
switch (section.VerseType) switch (section.VerseType)
{ {
@ -106,11 +106,11 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = 0; TotalCount = 0;
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
DeletedUserSections = string.IsNullOrEmpty(Request.Query["deletedUserSections"]) ? false : bool.Parse(Request.Query["deletedUserSections"]); DeletedUserSections = string.IsNullOrEmpty(Request.Query["deletedUserSections"]) ? false : bool.Parse(Request.Query["deletedUserSections"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/next?skip={Skip}&deletedUserSections={DeletedUserSections}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/section/correction/next?skip={Skip}&deletedUserSections={DeletedUserSections}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
@ -122,18 +122,18 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
} }
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanPoemSectionCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
if (Correction != null) if (Correction != null)
{ {
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/{Correction.SectionId}"); var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/section/{Correction.SectionId}");
if (!sectionResponse.IsSuccessStatusCode) if (!sectionResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PoemSection = JsonConvert.DeserializeObject<GanjoorPoemSection>(await sectionResponse.Content.ReadAsStringAsync()); PoemSection = JsonConvert.DeserializeObject<DiwanPoemSection>(await sectionResponse.Content.ReadAsStringAsync());
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={PoemSection.PoemId}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={PoemSection.PoemId}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -141,13 +141,13 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any()) if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any())
{ {
@ -156,7 +156,7 @@ namespace GanjooRazor.Areas.Admin.Pages
if (Correction.Rhythm != null) if (Correction.Rhythm != null)
{ {
Correction.OriginalRhythm = PoemSection.GanjoorMetre == null ? null : PoemSection.GanjoorMetre.Rhythm; Correction.OriginalRhythm = PoemSection.DiwanMetre == null ? null : PoemSection.DiwanMetre.Rhythm;
if (Correction.OriginalRhythm == Correction.Rhythm) if (Correction.OriginalRhythm == Correction.Rhythm)
Correction.RhythmResult = CorrectionReviewResult.NotChanged; Correction.RhythmResult = CorrectionReviewResult.NotChanged;
} }
@ -166,23 +166,23 @@ namespace GanjooRazor.Areas.Admin.Pages
if (DeletedUserSections) if (DeletedUserSections)
{ {
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true"); var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms?sortOnVerseCount=true");
if (!rhythmResponse.IsSuccessStatusCode) if (!rhythmResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync()); RhythmsByVerseCount = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount); List<DiwanMetre> rhythmsByVerseCount = new List<DiwanMetre>(RhythmsByVerseCount);
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm)); rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "null" Rhythm = "null"
} }
); );
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "" Rhythm = ""
} }
@ -222,17 +222,17 @@ namespace GanjooRazor.Areas.Admin.Pages
string poemformatReviewNote, string poemformatReviewNote,
string reviewNote) string reviewNote)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/{correctionId}"); var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/section/correction/{correctionId}");
if (!correctionResponse.IsSuccessStatusCode) if (!correctionResponse.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
} }
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
int? breakFromVerse1VOrder = null; int? breakFromVerse1VOrder = null;
int? breakFromVerse2VOrder = null; int? breakFromVerse2VOrder = null;
@ -247,15 +247,15 @@ namespace GanjooRazor.Areas.Admin.Pages
if (breakFromVIndices.Length > 0) if (breakFromVIndices.Length > 0)
{ {
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/{Correction.SectionId}"); var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/section/{Correction.SectionId}");
if (!sectionResponse.IsSuccessStatusCode) if (!sectionResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PoemSection = JsonConvert.DeserializeObject<GanjoorPoemSection>(await sectionResponse.Content.ReadAsStringAsync()); PoemSection = JsonConvert.DeserializeObject<DiwanPoemSection>(await sectionResponse.Content.ReadAsStringAsync());
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={PoemSection.PoemId}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={PoemSection.PoemId}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -263,13 +263,13 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
Verses = _FilterSectionVerses(PoemSection, PageInformation.Poem.Verses); Verses = _FilterSectionVerses(PoemSection, PageInformation.Poem.Verses);
@ -392,7 +392,7 @@ namespace GanjooRazor.Areas.Admin.Pages
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/section/moderate", var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/section/moderate",
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json" new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
)); ));
@ -429,18 +429,18 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostSuggestRhythmAsync(int sectionId, int correctionId, string rhythm) public async Task<IActionResult> OnPostSuggestRhythmAsync(int sectionId, int correctionId, string rhythm)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/{correctionId}"); var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/section/correction/{correctionId}");
if (!correctionResponse.IsSuccessStatusCode) if (!correctionResponse.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
} }
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
Correction.RhythmResult = CorrectionReviewResult.Rejected; Correction.RhythmResult = CorrectionReviewResult.Rejected;
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/section/moderate", var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/diwan/section/moderate",
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json" new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
)); ));
if (!moderationResponse.IsSuccessStatusCode) if (!moderationResponse.IsSuccessStatusCode)
@ -450,14 +450,14 @@ namespace GanjooRazor.Areas.Admin.Pages
if(!string.IsNullOrEmpty(rhythm)) if(!string.IsNullOrEmpty(rhythm))
{ {
GanjoorPoemSectionCorrectionViewModel correction = new GanjoorPoemSectionCorrectionViewModel() DiwanPoemSectionCorrectionViewModel correction = new DiwanPoemSectionCorrectionViewModel()
{ {
SectionId = sectionId, SectionId = sectionId,
Rhythm = rhythm, Rhythm = rhythm,
}; };
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/section/correction", $"{APIRoot.Url}/api/diwan/section/correction",
new StringContent(JsonConvert.SerializeObject(correction), new StringContent(JsonConvert.SerializeObject(correction),
Encoding.UTF8, Encoding.UTF8,
"application/json")); "application/json"));

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ReviewPersonEditsModel @model DiwanRazor.Areas.Admin.Pages.ReviewPersonEditsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{

View File

@ -4,18 +4,18 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
/// <summary> /// <summary>
/// moderator review queue for pending GanjoorPersonEditSuggestion entries - counterpart of /// moderator review queue for pending DiwanPersonEditSuggestion entries - counterpart of
/// ReviewEdits.cshtml for poem corrections, but much simpler: one suggestion, one overall /// ReviewEdits.cshtml for poem corrections, but much simpler: one suggestion, one overall
/// Result, no per-field branching. /// Result, no per-field branching.
/// </summary> /// </summary>
@ -24,7 +24,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// the pending suggestion currently shown /// the pending suggestion currently shown
/// </summary> /// </summary>
public GanjoorPersonEditSuggestion Suggestion { get; set; } public DiwanPersonEditSuggestion Suggestion { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
@ -46,7 +46,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// DeathLocationId into names for the before/after diff (the suggestion's own Suggested* /// DeathLocationId into names for the before/after diff (the suggestion's own Suggested*
/// locations already arrive populated via the backend's Include) /// locations already arrive populated via the backend's Include)
/// </summary> /// </summary>
public List<GanjoorGeoLocation> Locations { get; set; } public List<DiwanGeoLocation> Locations { get; set; }
public string LocationName(int? id) public string LocationName(int? id)
{ {
@ -101,9 +101,9 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = 0; TotalCount = 0;
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var locationsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/locations"); var locationsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
if (!locationsResponse.IsSuccessStatusCode) if (!locationsResponse.IsSuccessStatusCode)
@ -111,7 +111,7 @@ namespace GanjooRazor.Areas.Admin.Pages
FatalError = JsonConvert.DeserializeObject<string>(await locationsResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await locationsResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Locations = JsonConvert.DeserializeObject<List<GanjoorGeoLocation>>(await locationsResponse.Content.ReadAsStringAsync()); Locations = JsonConvert.DeserializeObject<List<DiwanGeoLocation>>(await locationsResponse.Content.ReadAsStringAsync());
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/editsuggestions/next?skip={Skip}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/editsuggestions/next?skip={Skip}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
@ -126,7 +126,7 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount;
} }
Suggestion = JsonConvert.DeserializeObject<GanjoorPersonEditSuggestion>(await nextResponse.Content.ReadAsStringAsync()); Suggestion = JsonConvert.DeserializeObject<DiwanPersonEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
@ -147,9 +147,9 @@ namespace GanjooRazor.Areas.Admin.Pages
return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید."); return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید.");
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var moderation = new PersonEditSuggestionModerationViewModel() var moderation = new PersonEditSuggestionModerationViewModel()
{ {

View File

@ -1,8 +1,8 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.ReviewPersonRelationEditsModel @model DiwanRazor.Areas.Admin.Pages.ReviewPersonRelationEditsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@using RMuseum.Models.Ganjoor @using RMuseum.Models.Diwan
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
ViewData["Title"] = "بازبینی پیشنهادهای نسبت‌های خویشاوندی"; ViewData["Title"] = "بازبینی پیشنهادهای نسبت‌های خویشاوندی";

View File

@ -3,18 +3,18 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
/// <summary> /// <summary>
/// moderator review queue for pending GanjoorPersonRelationEditSuggestion entries - counterpart /// moderator review queue for pending DiwanPersonRelationEditSuggestion entries - counterpart
/// of ReviewPersonEdits.cshtml, but for kinship edges (Add/Modify/Remove) rather than a person's /// of ReviewPersonEdits.cshtml, but for kinship edges (Add/Modify/Remove) rather than a person's
/// own fields. /// own fields.
/// </summary> /// </summary>
@ -23,7 +23,7 @@ namespace GanjooRazor.Areas.Admin.Pages
/// <summary> /// <summary>
/// the pending suggestion currently shown /// the pending suggestion currently shown
/// </summary> /// </summary>
public GanjoorPersonRelationEditSuggestion Suggestion { get; set; } public DiwanPersonRelationEditSuggestion Suggestion { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = 0; TotalCount = 0;
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/relationeditsuggestions/next?skip={Skip}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/relationeditsuggestions/next?skip={Skip}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
@ -76,7 +76,7 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount;
} }
Suggestion = JsonConvert.DeserializeObject<GanjoorPersonRelationEditSuggestion>(await nextResponse.Content.ReadAsStringAsync()); Suggestion = JsonConvert.DeserializeObject<DiwanPersonRelationEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
@ -97,9 +97,9 @@ namespace GanjooRazor.Areas.Admin.Pages
return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید."); return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید.");
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var moderation = new PersonEditSuggestionModerationViewModel() var moderation = new PersonEditSuggestionModerationViewModel()
{ {

View File

@ -1,6 +1,6 @@
@page @page
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@model GanjooRazor.Areas.Admin.Pages.ReviewQuotedsModel @model DiwanRazor.Areas.Admin.Pages.ReviewQuotedsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";
@ -14,7 +14,7 @@
{ {
<div class="up-alert up-alert--danger">@Model.FatalError</div> <div class="up-alert up-alert--danger">@Model.FatalError</div>
} }
else if (Model.GanjoorQuotedPoem == null) else if (Model.DiwanQuotedPoem == null)
{ {
<partial name="_EmptyState" model="@("پیشنهادی وجود ندارد.")" /> <partial name="_EmptyState" model="@("پیشنهادی وجود ندارد.")" />
} }
@ -24,7 +24,7 @@ else
<p class="up-hint">تعداد کل: @Model.TotalCount</p> <p class="up-hint">تعداد کل: @Model.TotalCount</p>
<div class="up-field"> <div class="up-field">
<label>پیشنهاد دهنده</label> <label>پیشنهاد دهنده</label>
<div class="up-field-static"><a href="/user/edits/?allusers=1&userid=@Model.GanjoorQuotedPoem.SuggestedById" target="_blank">@Model.SuggestedBy.NickName</a></div> <div class="up-field-static"><a href="/user/edits/?allusers=1&userid=@Model.DiwanQuotedPoem.SuggestedById" target="_blank">@Model.SuggestedBy.NickName</a></div>
</div> </div>
<form method="post" class="up-form"> <form method="post" class="up-form">
@ -46,38 +46,38 @@ else
</div> </div>
<div class="up-card"> <div class="up-card">
<h2 class="up-card__title">بیت مرجع از <a href="/?p=@Model.GanjoorQuotedPoem.PoemId">شعر</a></h2> <h2 class="up-card__title">بیت مرجع از <a href="/?p=@Model.DiwanQuotedPoem.PoemId">شعر</a></h2>
@if (Model.GanjoorQuotedPoem.CoupletIndex != null && Model.GanjoorQuotedPoem.CoupletIndex != -1) @if (Model.DiwanQuotedPoem.CoupletIndex != null && Model.DiwanQuotedPoem.CoupletIndex != -1)
{ {
<p>@($"{(Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.Couplets[(int)Model.GanjoorQuotedPoem.CoupletIndex].Item2}")</p> <p>@($"{(Model.Couplets[(int)Model.DiwanQuotedPoem.CoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.Couplets[(int)Model.DiwanQuotedPoem.CoupletIndex].Item2}")</p>
} }
<div class="up-field"> <div class="up-field">
<label>مصرع اول مهم است</label> <label>مصرع اول مهم است</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.CoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.CoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>مصرع دوم مهم است</label> <label>مصرع دوم مهم است</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.CoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.CoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>شاعر مرجع</label> <label>شاعر مرجع</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.PoetId</div> <div class="up-field-static">@Model.DiwanQuotedPoem.PoetId</div>
</div> </div>
@if (Model.GanjoorQuotedPoem.RelatedPoemId != null) @if (Model.DiwanQuotedPoem.RelatedPoemId != null)
{ {
<p><a href="/?p=@Model.GanjoorQuotedPoem.RelatedPoemId" class="up-btn up-btn--ghost up-btn--sm">مشاهدهٔ شعر مرتبط</a></p> <p><a href="/?p=@Model.DiwanQuotedPoem.RelatedPoemId" class="up-btn up-btn--ghost up-btn--sm">مشاهدهٔ شعر مرتبط</a></p>
} }
<div class="up-field"> <div class="up-field">
<label>بیت مرتبط</label> <label>بیت مرتبط</label>
@if (Model.GanjoorQuotedPoem.RelatedCoupletIndex != null && Model.GanjoorQuotedPoem.RelatedCoupletIndex != -1) @if (Model.DiwanQuotedPoem.RelatedCoupletIndex != null && Model.DiwanQuotedPoem.RelatedCoupletIndex != -1)
{ {
if (Model.GanjoorQuotedPoem.RelatedCoupletIndex < Model.RelatedCouplets.Length) if (Model.DiwanQuotedPoem.RelatedCoupletIndex < Model.RelatedCouplets.Length)
{ {
<p>@($"{(Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.RelatedCouplets[(int)Model.GanjoorQuotedPoem.RelatedCoupletIndex].Item2}")</p> <p>@($"{(Model.RelatedCouplets[(int)Model.DiwanQuotedPoem.RelatedCoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.RelatedCouplets[(int)Model.DiwanQuotedPoem.RelatedCoupletIndex].Item2}")</p>
} }
else else
{ {
@ -88,59 +88,59 @@ else
<div class="up-field"> <div class="up-field">
<label>مصرع اول مرتبط (خارج از دیوان)</label> <label>مصرع اول مرتبط (خارج از دیوان)</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedCoupletVerse1</div> <div class="up-field-static">@Model.DiwanQuotedPoem.RelatedCoupletVerse1</div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>مصرع اول مهم است</label> <label>مصرع اول مهم است</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>مصرع دوم مرتبط (خارج از دیوان)</label> <label>مصرع دوم مرتبط (خارج از دیوان)</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedCoupletVerse2</div> <div class="up-field-static">@Model.DiwanQuotedPoem.RelatedCoupletVerse2</div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>مصرع دوم مهم است</label> <label>مصرع دوم مهم است</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>ترتیب</label> <label>ترتیب</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.SortOrder</div> <div class="up-field-static">@Model.DiwanQuotedPoem.SortOrder</div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>این شعر قدیمی‌تر از شعر مرتبط است</label> <label>این شعر قدیمی‌تر از شعر مرتبط است</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.IsPriorToRelated ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.IsPriorToRelated ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>منتسب به هر دو شاعر</label> <label>منتسب به هر دو شاعر</label>
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.ClaimedByBothPoets ? "checked=\"checked\"" : "") /> <input type="checkbox" disabled @(Model.DiwanQuotedPoem.ClaimedByBothPoets ? "checked=\"checked\"" : "") />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>شاعر</label> <label>شاعر</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedPoetId - @Model.GanjoorQuotedPoem.CachedRelatedPoemPoetName</div> <div class="up-field-static">@Model.DiwanQuotedPoem.RelatedPoetId - @Model.DiwanQuotedPoem.CachedRelatedPoemPoetName</div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>سالمرگ شاعر</label> <label>سالمرگ شاعر</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri</div> <div class="up-field-static">@Model.DiwanQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri</div>
</div> </div>
<div class="up-field up-field--ltr"> <div class="up-field up-field--ltr">
<label>نشانی صفحهٔ شاعر</label> <label>نشانی صفحهٔ شاعر</label>
<div class="up-field-static"><a href="@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetUrl">@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetUrl</a></div> <div class="up-field-static"><a href="@Model.DiwanQuotedPoem.CachedRelatedPoemPoetUrl">@Model.DiwanQuotedPoem.CachedRelatedPoemPoetUrl</a></div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>تصویر شاعر</label> <label>تصویر شاعر</label>
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{Model.GanjoorQuotedPoem.CachedRelatedPoemPoetImage}")" style="max-width:200px;" /> <img src="@($"{DiwanRazor.APIRoot.InternetUrl}{Model.DiwanQuotedPoem.CachedRelatedPoemPoetImage}")" style="max-width:200px;" />
</div> </div>
<div class="up-field"> <div class="up-field">
<label>عنوان شعر</label> <label>عنوان شعر</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.CachedRelatedPoemFullTitle</div> <div class="up-field-static">@Model.DiwanQuotedPoem.CachedRelatedPoemFullTitle</div>
</div> </div>
<div class="up-field up-field--ltr"> <div class="up-field up-field--ltr">
<label>نشانی شعر</label> <label>نشانی شعر</label>
<div class="up-field-static"><a href="@Model.GanjoorQuotedPoem.CachedRelatedPoemFullUrl">@Model.GanjoorQuotedPoem.CachedRelatedPoemFullUrl</a></div> <div class="up-field-static"><a href="@Model.DiwanQuotedPoem.CachedRelatedPoemFullUrl">@Model.DiwanQuotedPoem.CachedRelatedPoemFullUrl</a></div>
</div> </div>
<div class="up-field"> <div class="up-field">
<label>یادداشت</label> <label>یادداشت</label>
<div class="up-field-static">@Model.GanjoorQuotedPoem.Note</div> <div class="up-field-static">@Model.DiwanQuotedPoem.Note</div>
</div> </div>
</div> </div>
} }

View File

@ -1,20 +1,20 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq; using System.Linq;
using System; using System;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.Text; using System.Text;
using RMuseum.Models.Auth.ViewModel; using RMuseum.Models.Auth.ViewModel;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class ReviewQuotedsModel : PageModel public class ReviewQuotedsModel : PageModel
{ {
@ -22,12 +22,12 @@ namespace GanjooRazor.Areas.Admin.Pages
/// moderation model /// moderation model
/// </summary> /// </summary>
[BindProperty] [BindProperty]
public GanjoorQuotedPoemModerationViewModel ModerationModel { get; set; } public DiwanQuotedPoemModerationViewModel ModerationModel { get; set; }
/// <summary> /// <summary>
/// suggestion /// suggestion
/// </summary> /// </summary>
public GanjoorQuotedPoemViewModel GanjoorQuotedPoem { get; set; } public DiwanQuotedPoemViewModel DiwanQuotedPoem { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
/// </summary> /// </summary>
@ -47,13 +47,13 @@ namespace GanjooRazor.Areas.Admin.Pages
public Tuple<int, string>[] RelatedCouplets { get; set; } public Tuple<int, string>[] RelatedCouplets { get; set; }
public GanjoorPoemCompleteViewModel Poem { get; set; } public DiwanPoemCompleteViewModel Poem { get; set; }
public GanjoorPoemCompleteViewModel RelatedPoem { get; set; } public DiwanPoemCompleteViewModel RelatedPoem { get; set; }
public GanjoorUserPublicProfile SuggestedBy { get; set; } public DiwanUserPublicProfile SuggestedBy { get; set; }
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses) private Tuple<int, string>[] GetCouplets(DiwanVerseViewModel[] verses)
{ {
int coupetIndex = -1; int coupetIndex = -1;
string coupletText = ""; string coupletText = "";
@ -112,11 +112,11 @@ namespace GanjooRazor.Areas.Admin.Pages
TotalCount = 0; TotalCount = 0;
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
RelatedCouplets = []; RelatedCouplets = [];
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/quoted/suggestion/next?skip={Skip}"); var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/quoted/suggestion/next?skip={Skip}");
if (!nextResponse.IsSuccessStatusCode) if (!nextResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
@ -128,38 +128,38 @@ namespace GanjooRazor.Areas.Admin.Pages
{ {
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
} }
GanjoorQuotedPoem = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel>(await nextResponse.Content.ReadAsStringAsync()); DiwanQuotedPoem = JsonConvert.DeserializeObject<DiwanQuotedPoemViewModel>(await nextResponse.Content.ReadAsStringAsync());
if(GanjoorQuotedPoem != null) if(DiwanQuotedPoem != null)
{ {
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/user/profile/{GanjoorQuotedPoem.SuggestedById}"); var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/user/profile/{DiwanQuotedPoem.SuggestedById}");
if (!responseUserProfile.IsSuccessStatusCode) if (!responseUserProfile.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync());
return Page(); return Page();
} }
SuggestedBy = JsonConvert.DeserializeObject<GanjoorUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync()); SuggestedBy = JsonConvert.DeserializeObject<DiwanUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
var poemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.PoemId}"); var poemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{DiwanQuotedPoem.PoemId}");
if (!poemQuery.IsSuccessStatusCode) if (!poemQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
Couplets = GetCouplets(Poem.Verses); Couplets = GetCouplets(Poem.Verses);
if (GanjoorQuotedPoem.RelatedPoemId != null) if (DiwanQuotedPoem.RelatedPoemId != null)
{ {
var relPoemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}"); var relPoemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{DiwanQuotedPoem.RelatedPoemId}");
if (!relPoemQuery.IsSuccessStatusCode) if (!relPoemQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>(); RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DiwanPoemCompleteViewModel>();
RelatedCouplets = GetCouplets(RelatedPoem.Verses); RelatedCouplets = GetCouplets(RelatedPoem.Verses);
@ -167,9 +167,9 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
ModerationModel = new GanjoorQuotedPoemModerationViewModel() ModerationModel = new DiwanQuotedPoemModerationViewModel()
{ {
Id = GanjoorQuotedPoem.Id, Id = DiwanQuotedPoem.Id,
Approved = true, Approved = true,
ReviewNote = "" ReviewNote = ""
}; };
@ -184,16 +184,16 @@ namespace GanjooRazor.Areas.Admin.Pages
return Page(); return Page();
} }
public async Task<IActionResult> OnPostAsync(GanjoorQuotedPoemModerationViewModel ModerationModel) public async Task<IActionResult> OnPostAsync(DiwanQuotedPoemModerationViewModel ModerationModel)
{ {
FatalError = ""; FatalError = "";
try try
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var url = $"{APIRoot.Url}/api/ganjoor/quoted/moderate"; var url = $"{APIRoot.Url}/api/diwan/quoted/moderate";
var payload = new StringContent(JsonConvert.SerializeObject(ModerationModel), Encoding.UTF8, "application/json"); var payload = new StringContent(JsonConvert.SerializeObject(ModerationModel), Encoding.UTF8, "application/json");
HttpResponseMessage response = await secureClient.PutAsync(url, payload); HttpResponseMessage response = await secureClient.PutAsync(url, payload);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.RolesModel @model DiwanRazor.Areas.Admin.Pages.RolesModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -9,7 +9,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class RolesModel : PageModel public class RolesModel : PageModel
{ {
@ -25,9 +25,9 @@ namespace GanjooRazor.Areas.Admin.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/"); return Redirect("/");
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles");
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
@ -53,9 +53,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnPostNewRoleAsync(string name, string description) public async Task<IActionResult> OnPostNewRoleAsync(string name, string description)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var newRole = new { name = name, description = description }; var newRole = new { name = name, description = description };
@ -72,9 +72,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnDeleteRoleAsync(string roleName) public async Task<IActionResult> OnDeleteRoleAsync(string roleName)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/roles/{roleName}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/roles/{roleName}");
@ -90,9 +90,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnGetPermissionsAsync(string roleName) public async Task<IActionResult> OnGetPermissionsAsync(string roleName)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles/permissions/{roleName}"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles/permissions/{roleName}");
@ -109,9 +109,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnPutPermissionsAsync(string roleName) public async Task<IActionResult> OnPutPermissionsAsync(string roleName)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
string body; string body;

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.SectionDelModel @model DiwanRazor.Areas.Admin.Pages.SectionDelModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,11 +1,11 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class SectionDelModel : PageModel public class SectionDelModel : PageModel
@ -43,11 +43,11 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastResult = ""; LastResult = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/section/{Request.Query["poemId"]}/{Request.Query["sectionIndex"]}/{true}"); HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/section/{Request.Query["poemId"]}/{Request.Query["sectionIndex"]}/{true}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.TransferMeterModel @model DiwanRazor.Areas.Admin.Pages.TransferMeterModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{

View File

@ -1,26 +1,26 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class TransferMeterModel : PageModel public class TransferMeterModel : PageModel
{ {
/// <summary> /// <summary>
/// rhythms alphabetically /// rhythms alphabetically
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsAlphabetically { get; set; } public DiwanMetre[] RhythmsAlphabetically { get; set; }
/// <summary> /// <summary>
/// rhythms by frequency /// rhythms by frequency
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsByVerseCount { get; set; } public DiwanMetre[] RhythmsByVerseCount { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
@ -52,28 +52,28 @@ namespace GanjooRazor.Areas.Admin.Pages
InitialSourceMeter = Request.Query["m"]; InitialSourceMeter = Request.Query["m"];
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true"); var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms?sortOnVerseCount=true");
if (!rhythmResponse.IsSuccessStatusCode) if (!rhythmResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync()); RhythmsByVerseCount = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount); List<DiwanMetre> rhythmsByVerseCount = new List<DiwanMetre>(RhythmsByVerseCount);
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm)); rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "null" Rhythm = "null"
} }
); );
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "" Rhythm = ""
} }
@ -81,7 +81,7 @@ namespace GanjooRazor.Areas.Admin.Pages
RhythmsAlphabetically = rhythmsByVerseCount.ToArray(); RhythmsAlphabetically = rhythmsByVerseCount.ToArray();
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Request.Query["id"]}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={Request.Query["id"]}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -89,7 +89,7 @@ namespace GanjooRazor.Areas.Admin.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
@ -106,23 +106,23 @@ namespace GanjooRazor.Areas.Admin.Pages
public async Task<IActionResult> OnPostAsync(string rhythm, string rhythm2) public async Task<IActionResult> OnPostAsync(string rhythm, string rhythm2)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true"); var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms?sortOnVerseCount=true");
if (!rhythmResponse.IsSuccessStatusCode) if (!rhythmResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
return new BadRequestObjectResult(FatalError); return new BadRequestObjectResult(FatalError);
} }
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync()); RhythmsByVerseCount = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
var sourceMeter = RhythmsByVerseCount.Where(m => m.Rhythm == rhythm).Single(); var sourceMeter = RhythmsByVerseCount.Where(m => m.Rhythm == rhythm).Single();
var destMeter = RhythmsByVerseCount.Where(m => m.Rhythm == rhythm2).Single(); var destMeter = RhythmsByVerseCount.Where(m => m.Rhythm == rhythm2).Single();
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/prosody/transfer/{sourceMeter.Id}/{destMeter.Id}", null); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/prosody/transfer/{sourceMeter.Id}/{destMeter.Id}", null);
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));

View File

@ -1,5 +1,5 @@
@page @page
@model GanjooRazor.Areas.Admin.Pages.UsersModel @model DiwanRazor.Areas.Admin.Pages.UsersModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_AdminLayout"; Layout = "_AdminLayout";

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
@ -13,7 +13,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Admin.Pages namespace DiwanRazor.Areas.Admin.Pages
{ {
public class UsersModel : PageModel public class UsersModel : PageModel
{ {
@ -46,9 +46,9 @@ namespace GanjooRazor.Areas.Admin.Pages
FilterByEmail = filterByEmail; FilterByEmail = filterByEmail;
FilterByNickName = filterByNickName; FilterByNickName = filterByNickName;
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var url = $"{APIRoot.Url}/api/users?PageNumber={PageNumber}&PageSize={PageSize}"; var url = $"{APIRoot.Url}/api/users?PageNumber={PageNumber}&PageSize={PageSize}";
if (!string.IsNullOrEmpty(FilterByEmail)) if (!string.IsNullOrEmpty(FilterByEmail))
@ -139,9 +139,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnGetRolesAsync(Guid id) public async Task<IActionResult> OnGetRolesAsync(Guid id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}/roles"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}/roles");
@ -158,9 +158,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnGetAllRolesAsync() public async Task<IActionResult> OnGetAllRolesAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles");
@ -177,9 +177,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnPostAddRoleAsync(Guid id, string role) public async Task<IActionResult> OnPostAddRoleAsync(Guid id, string role)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/users/{id}/roles/{Uri.EscapeDataString(role)}", null); var response = await secureClient.PostAsync($"{APIRoot.Url}/api/users/{id}/roles/{Uri.EscapeDataString(role)}", null);
@ -195,9 +195,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnDeleteRoleAsync(Guid id, string role) public async Task<IActionResult> OnDeleteRoleAsync(Guid id, string role)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/users/{id}/roles/{Uri.EscapeDataString(role)}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/users/{id}/roles/{Uri.EscapeDataString(role)}");
@ -213,9 +213,9 @@ namespace GanjooRazor.Areas.Admin.Pages
/// </summary> /// </summary>
public async Task<IActionResult> OnPostToggleStatusAsync(Guid id, bool active) public async Task<IActionResult> OnPostToggleStatusAsync(Guid id, bool active)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (!await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید."); return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}"); var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}");

View File

@ -1,11 +1,11 @@
@page @page
@model GanjooRazor.Areas.User.Pages.AllPoemSectionsModel @model DiwanRazor.Areas.User.Pages.AllPoemSectionsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "همهٔ قطعات شعر"; ViewData["Title"] = "همهٔ قطعات شعر";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@ -47,7 +47,7 @@ else
@foreach (var poemSection in Model.PoemSections) @foreach (var poemSection in Model.PoemSections)
{ {
<div class="up-card"> <div class="up-card">
@if (poemSection.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem) @if (poemSection.SectionType == RMuseum.Models.Diwan.PoemSectionType.WholePoem)
{ {
<h2 class="up-card__title"> <h2 class="up-card__title">
<a href="/User/Section?poemId=@poemSection.PoemId&index=@poemSection.Index" role="button" class="up-btn up-btn--sm up-btn--ghost"> <a href="/User/Section?poemId=@poemSection.PoemId&index=@poemSection.Index" role="button" class="up-btn up-btn--sm up-btn--ghost">
@ -80,7 +80,7 @@ else
<div class="up-field-row"> <div class="up-field-row">
<div class="up-field"> <div class="up-field">
<label><span class="up-field-icon" aria-hidden="true">🎵</span> وزن</label> <label><span class="up-field-icon" aria-hidden="true">🎵</span> وزن</label>
<p class="up-field-static">@(poemSection.GanjoorMetre == null ? "تعیین نشده" : poemSection.GanjoorMetre.Rhythm)</p> <p class="up-field-static">@(poemSection.DiwanMetre == null ? "تعیین نشده" : poemSection.DiwanMetre.Rhythm)</p>
</div> </div>
<div class="up-field"> <div class="up-field">
<label><span class="up-field-icon" aria-hidden="true">🔤</span> حروف قافیه</label> <label><span class="up-field-icon" aria-hidden="true">🔤</span> حروف قافیه</label>
@ -88,9 +88,9 @@ else
</div> </div>
</div> </div>
@if (poemSection.GanjoorMetre != null && !string.IsNullOrEmpty(poemSection.RhymeLetters) && Model.CanEdit) @if (poemSection.DiwanMetre != null && !string.IsNullOrEmpty(poemSection.RhymeLetters) && Model.CanEdit)
{ {
<a role="button" id="rebuild-related-@poemSection.Id" class="up-btn up-btn--danger up-btn--block" onclick="rebuildRelatedSections(@poemSection.Id, @poemSection.GanjoorMetreId, '@poemSection.RhymeLetters')">🔁 بازسازی مرتبط‌ها</a> <a role="button" id="rebuild-related-@poemSection.Id" class="up-btn up-btn--danger up-btn--block" onclick="rebuildRelatedSections(@poemSection.Id, @poemSection.DiwanMetreId, '@poemSection.RhymeLetters')">🔁 بازسازی مرتبط‌ها</a>
} }
</div> </div>
} }

View File

@ -1,13 +1,13 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class AllPoemSectionsModel : PageModel public class AllPoemSectionsModel : PageModel
{ {
@ -16,7 +16,7 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public string FatalError { get; set; } public string FatalError { get; set; }
public GanjoorPoemSection[] PoemSections { get; set; } public DiwanPoemSection[] PoemSections { get; set; }
/// <summary> /// <summary>
/// can edit /// can edit
@ -28,17 +28,17 @@ namespace GanjooRazor.Areas.User.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/"); return Redirect("/");
CanEdit = Request.Cookies["CanEdit"] == "True"; CanEdit = Request.Cookies["CanEdit"] == "True";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var sectionsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/sections/{Request.Query["id"]}"); var sectionsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/sections/{Request.Query["id"]}");
if (!sectionsResponse.IsSuccessStatusCode) if (!sectionsResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await sectionsResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await sectionsResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PoemSections = JsonConvert.DeserializeObject<GanjoorPoemSection[]>(await sectionsResponse.Content.ReadAsStringAsync()); PoemSections = JsonConvert.DeserializeObject<DiwanPoemSection[]>(await sectionsResponse.Content.ReadAsStringAsync());
} }
} }
return Page(); return Page();
@ -47,12 +47,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostRebuildRelatedSectionsAsync(int meterId, string rhyming) public async Task<IActionResult> OnPostRebuildRelatedSectionsAsync(int meterId, string rhyming)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/sections/updaterelated?metreId={meterId}&rhyme={rhyming}", $"{APIRoot.Url}/api/diwan/sections/updaterelated?metreId={meterId}&rhyme={rhyming}",
null null
); );
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.AwaitingCommentsModel @model DiwanRazor.Areas.User.Pages.AwaitingCommentsModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "حاشیه‌های در انتظار تأیید"; ViewData["Title"] = "حاشیه‌های در انتظار تأیید";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,11 +1,11 @@
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -14,7 +14,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class AwaitingCommentsModel : PageModel public class AwaitingCommentsModel : PageModel
{ {
@ -26,7 +26,7 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// comments /// comments
/// </summary> /// </summary>
public List<GanjoorCommentFullViewModel> Comments { get; set; } public List<DiwanCommentFullViewModel> Comments { get; set; }
/// <summary> /// <summary>
/// pagination links /// pagination links
@ -43,8 +43,8 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var responseKeepFirstTimeUsersComments = await secureClient.GetAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments"); var responseKeepFirstTimeUsersComments = await secureClient.GetAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments");
@ -61,14 +61,14 @@ namespace GanjooRazor.Areas.User.Pages
{ {
pageNumber = int.Parse(Request.Query["page"]); pageNumber = int.Parse(Request.Query["page"]);
} }
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/comments/awaiting?PageNumber={pageNumber}&PageSize=20"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/comments/awaiting?PageNumber={pageNumber}&PageSize=20");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCommentFullViewModel>>(); Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DiwanCommentFullViewModel>>();
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))
@ -150,11 +150,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteCommentAsync(int id) public async Task<IActionResult> OnDeleteCommentAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/comment/awaiting/delete?id={id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/comment/awaiting/delete?id={id}");
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
@ -172,11 +172,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPutApproveAsync(int id) public async Task<IActionResult> OnPutApproveAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/comment/awaiting/publish", new StringContent(JsonConvert.SerializeObject(id), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/comment/awaiting/publish", new StringContent(JsonConvert.SerializeObject(id), Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -192,9 +192,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostStopKeepingAsync() public async Task<IActionResult> OnPostStopKeepingAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments", new StringContent(JsonConvert.SerializeObject(false.ToString()), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments", new StringContent(JsonConvert.SerializeObject(false.ToString()), Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
@ -212,9 +212,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostStartKeepingAsync() public async Task<IActionResult> OnPostStartKeepingAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments", new StringContent(JsonConvert.SerializeObject(true.ToString()), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/options/global/KeepFirstTimeUsersComments", new StringContent(JsonConvert.SerializeObject(true.ToString()), Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.CatEditorModel @model DiwanRazor.Areas.User.Pages.CatEditorModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایشگر متن بخش"; ViewData["Title"] = "ویرایشگر متن بخش";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,28 +1,28 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System; using System;
using RMuseum.Utils; using RMuseum.Utils;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class CatEditorModel : PageModel public class CatEditorModel : PageModel
{ {
/// <summary> /// <summary>
/// my last edit /// my last edit
/// </summary> /// </summary>
public GanjoorCatCorrectionViewModel MyLastEdit { get; set; } public DiwanCatCorrectionViewModel MyLastEdit { get; set; }
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
/// <summary> /// <summary>
/// fatal error /// fatal error
/// </summary> /// </summary>
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
public int CatId { get; set; } public int CatId { get; set; }
[BindProperty] [BindProperty]
public GanjoorCatCorrectionViewModel Correction { get; set; } public DiwanCatCorrectionViewModel Correction { get; set; }
/// <summary> /// <summary>
/// get /// get
@ -46,11 +46,11 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
FatalError = Request.Query["FatalError"]; FatalError = Request.Query["FatalError"];
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Request.Query["id"]}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={Request.Query["id"]}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -58,30 +58,30 @@ namespace GanjooRazor.Areas.User.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
CatId = PageInformation.PoetOrCat.Cat.Id; CatId = PageInformation.PoetOrCat.Cat.Id;
var editResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/correction/last/{CatId}"); var editResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/cat/correction/last/{CatId}");
if (!editResponse.IsSuccessStatusCode) if (!editResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
MyLastEdit = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync()); MyLastEdit = JsonConvert.DeserializeObject<DiwanCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
if (MyLastEdit != null) if (MyLastEdit != null)
{ {
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync()); Correction = JsonConvert.DeserializeObject<DiwanCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
} }
else else
{ {
Correction = new GanjoorCatCorrectionViewModel() Correction = new DiwanCatCorrectionViewModel()
{ {
CatId = CatId, CatId = CatId,
DescriptionHtml = PageInformation.PoetOrCat.Cat.DescriptionHtml, DescriptionHtml = PageInformation.PoetOrCat.Cat.DescriptionHtml,
@ -100,12 +100,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostDeleteCatCorrectionAsync(int catid) public async Task<IActionResult> OnPostDeleteCatCorrectionAsync(int catid)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync( HttpResponseMessage response = await secureClient.DeleteAsync(
$"{APIRoot.Url}/api/ganjoor/cat/correction/{catid}"); $"{APIRoot.Url}/api/diwan/cat/correction/{catid}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
@ -122,13 +122,13 @@ namespace GanjooRazor.Areas.User.Pages
{ {
try try
{ {
Correction.Description = GanjoorHtmlTools.StripHtmlTags(Correction.DescriptionHtml); Correction.Description = DiwanHtmlTools.StripHtmlTags(Correction.DescriptionHtml);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/cat/correction", $"{APIRoot.Url}/api/diwan/cat/correction",
new StringContent(JsonConvert.SerializeObject(Correction), new StringContent(JsonConvert.SerializeObject(Correction),
Encoding.UTF8, Encoding.UTF8,
"application/json")); "application/json"));

View File

@ -1,11 +1,11 @@
@page @page
@model GanjooRazor.Areas.User.Pages.CatEditsModel @model DiwanRazor.Areas.User.Pages.CatEditsModel
@using RMuseum.Models.Ganjoor @using RMuseum.Models.Diwan
@using RMuseum.Services.Implementation @using RMuseum.Services.Implementation
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایش‌های بخشهای من"; ViewData["Title"] = "ویرایش‌های بخشهای من";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,18 +1,18 @@
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq; using System.Linq;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class CatEditsModel : PageModel public class CatEditsModel : PageModel
{ {
@ -39,7 +39,7 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// Corrections /// Corrections
/// </summary> /// </summary>
public List<GanjoorCatCorrectionViewModel> Corrections { get; set; } public List<DiwanCatCorrectionViewModel> Corrections { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
@ -47,8 +47,8 @@ namespace GanjooRazor.Areas.User.Pages
CanEdit = Request.Cookies["CanEdit"] == "True"; CanEdit = Request.Cookies["CanEdit"] == "True";
AllUsersEdits = false; AllUsersEdits = false;
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
{ {
int pageNumber = 1; int pageNumber = 1;
@ -56,14 +56,14 @@ namespace GanjooRazor.Areas.User.Pages
{ {
pageNumber = int.Parse(Request.Query["page"]); pageNumber = int.Parse(Request.Query["page"]);
} }
string url = $"{APIRoot.Url}/api/ganjoor/cat/corrections/mine?PageNumber={pageNumber}&PageSize=20"; string url = $"{APIRoot.Url}/api/diwan/cat/corrections/mine?PageNumber={pageNumber}&PageSize=20";
if (CanEdit) if (CanEdit)
{ {
AllUsersEdits = Request.Query["AllUsers"] == "1"; AllUsersEdits = Request.Query["AllUsers"] == "1";
if (AllUsersEdits) if (AllUsersEdits)
{ {
url = $"{APIRoot.Url}/api/ganjoor/cat/corrections/all?PageNumber={pageNumber}&PageSize=20"; url = $"{APIRoot.Url}/api/diwan/cat/corrections/all?PageNumber={pageNumber}&PageSize=20";
} }
} }
var response = await secureClient.GetAsync(url); var response = await secureClient.GetAsync(url);
@ -73,7 +73,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCatCorrectionViewModel>>(); Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DiwanCatCorrectionViewModel>>();
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.DeleteAccountModel @model DiwanRazor.Areas.User.Pages.DeleteAccountModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "حذف حساب کاربری"; ViewData["Title"] = "حذف حساب کاربری";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
@ -10,7 +10,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class DeleteAccountModel : PageModel public class DeleteAccountModel : PageModel
{ {
@ -54,9 +54,9 @@ namespace GanjooRazor.Areas.User.Pages
{ {
Step1 = true; Step1 = true;
FatalError = ""; FatalError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
deleteViewModel.CallbackUrl = $"{_configuration["SiteUrl"]}/User/DeleteAccount"; deleteViewModel.CallbackUrl = $"{_configuration["SiteUrl"]}/User/DeleteAccount";
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
@ -89,9 +89,9 @@ namespace GanjooRazor.Areas.User.Pages
{ {
FatalError = ""; FatalError = "";
Step1 = false; Step1 = false;
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync( HttpResponseMessage response = await secureClient.DeleteAsync(
$"{APIRoot.Url}/api/users/selfdelete/finalize/{secret}" $"{APIRoot.Url}/api/users/selfdelete/finalize/{secret}"

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.EditorModel @model DiwanRazor.Areas.User.Pages.EditorModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایشگر"; ViewData["Title"] = "ویرایشگر";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@ -118,9 +118,9 @@
// ---------- geo/date tag AND person (شخصیت) tag suggestions ---------- // ---------- geo/date tag AND person (شخصیت) tag suggestions ----------
// Both kinds are staged client-side (until the main save) in this ONE combined array, and both // Both kinds are staged client-side (until the main save) in this ONE combined array, and both
// are sent to the server as one flat GanjoorPoemGeoDateTagCorrection[] (pcs.geoDateTags) - that // are sent to the server as one flat DiwanPoemGeoDateTagCorrection[] (pcs.geoDateTags) - that
// part of the data model is shared, on purpose (see the doc comment on // part of the data model is shared, on purpose (see the doc comment on
// GanjoorPoemGeoDateTagCorrection.SuggestedPersonGraphJson). But a geo/date tag and a person tag // DiwanPoemGeoDateTagCorrection.SuggestedPersonGraphJson). But a geo/date tag and a person tag
// mean unrelated things to a reader ("this couplet refers to this place/time" vs "this couplet // mean unrelated things to a reader ("this couplet refers to this place/time" vs "this couplet
// refers to this person"), so the UI never mixes them in one row: every staged/loaded item here // refers to this person"), so the UI never mixes them in one row: every staged/loaded item here
// carries a client-only "_uiKind" field ('geo' or 'person', added by _getSuggestionUiKind for // carries a client-only "_uiKind" field ('geo' or 'person', added by _getSuggestionUiKind for
@ -139,7 +139,7 @@
// the _uiKind of a "delete this existing tag" suggestion loaded from a saved-but-unsubmitted // the _uiKind of a "delete this existing tag" suggestion loaded from a saved-but-unsubmitted
// draft, which otherwise carries nothing but the id being deleted // draft, which otherwise carries nothing but the id being deleted
var allExistingGeoDateTags = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject( var allExistingGeoDateTags = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(
(Model.PoemGeoDateTags ?? Array.Empty<RMuseum.Models.Ganjoor.PoemGeoDateTag>()).Select(t => new { id = t.Id, personId = t.PersonId }))); (Model.PoemGeoDateTags ?? Array.Empty<RMuseum.Models.Diwan.PoemGeoDateTag>()).Select(t => new { id = t.Id, personId = t.PersonId })));
// Works out whether a staged/loaded suggestion is a geo/date tag or a person (شخصیت) tag, for the // Works out whether a staged/loaded suggestion is a geo/date tag or a person (شخصیت) tag, for the
// two render functions to filter on. New items always set _uiKind themselves when pushed; this // two render functions to filter on. New items always set _uiKind themselves when pushed; this
@ -541,7 +541,7 @@
return true; return true;
} }
// Builds the SuggestedPersonGraphJson payload (see GanjoorPoemGeoDateTagCorrection's doc // Builds the SuggestedPersonGraphJson payload (see DiwanPoemGeoDateTagCorrection's doc
// comment for the exact shape) from the "new person" panel and its relatives-list rows. // comment for the exact shape) from the "new person" panel and its relatives-list rows.
// Returns null (with an error toast) if the panel is open but something required is missing; // Returns null (with an error toast) if the panel is open but something required is missing;
// the caller is expected to have already checked the panel is actually meant to be used. // the caller is expected to have already checked the panel is actually meant to be used.
@ -1427,10 +1427,10 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<p class="red-color"> @RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.MyLastEdit.OriginalPoemFormat)</p> <p class="red-color"> @RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.MyLastEdit.OriginalPoemFormat)</p>
</td> </td>
<td> <td>
<p class="green-color"> @RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.MyLastEdit.PoemFormat)</p> <p class="green-color"> @RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.MyLastEdit.PoemFormat)</p>
</td> </td>
</tr> </tr>
} }
@ -1493,12 +1493,12 @@ else
@if (verse.OriginalVersePosition != null) @if (verse.OriginalVersePosition != null)
{ {
<text> <text>
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.OriginalVersePosition)</p> نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Diwan.VersePosition)verse.OriginalVersePosition)</p>
</text> </text>
} }
</td> </td>
<td> <td>
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.VersePosition)</p> نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Diwan.VersePosition)verse.VersePosition)</p>
</td> </td>
</tr> </tr>
} }
@ -1872,7 +1872,7 @@ else
<select id="versepostion-@($"{verse.VOrder}")" name="versepostion-@($"{verse.VOrder}")"> <select id="versepostion-@($"{verse.VOrder}")" name="versepostion-@($"{verse.VOrder}")">
@if (Model.MyLastEdit != null && Model.MyLastEdit.VerseOrderText != null && Model.MyLastEdit.VerseOrderText.Where(v => v.VORder == verse.VOrder && v.VersePosition != null).Any()) @if (Model.MyLastEdit != null && Model.MyLastEdit.VerseOrderText != null && Model.MyLastEdit.VerseOrderText.Where(v => v.VORder == verse.VOrder && v.VersePosition != null).Any())
{ {
@foreach (var verseposition in RMuseum.Models.Ganjoor.VersePositionHelper.VersePositions) @foreach (var verseposition in RMuseum.Models.Diwan.VersePositionHelper.VersePositions)
if (verseposition.VersePosition == Model.MyLastEdit.VerseOrderText.Where(v => v.VORder == verse.VOrder).First().VersePosition) if (verseposition.VersePosition == Model.MyLastEdit.VerseOrderText.Where(v => v.VORder == verse.VOrder).First().VersePosition)
{ {
<option value="@verseposition.VersePosition" selected>@verseposition.Text</option> <option value="@verseposition.VersePosition" selected>@verseposition.Text</option>
@ -1884,7 +1884,7 @@ else
} }
else else
{ {
@foreach (var verseposition in RMuseum.Models.Ganjoor.VersePositionHelper.VersePositions) @foreach (var verseposition in RMuseum.Models.Diwan.VersePositionHelper.VersePositions)
if (verseposition.VersePosition == verse.VersePosition) if (verseposition.VersePosition == verse.VersePosition)
{ {
<option value="@verseposition.VersePosition" selected>@verseposition.Text</option> <option value="@verseposition.VersePosition" selected>@verseposition.Text</option>
@ -1958,7 +1958,7 @@ else
<div class="up-btn-group"> <div class="up-btn-group">
<a role="button" href="#savecorrections" class="up-btn up-btn--sm up-btn--save-jump up-btn--block">⬇ رفتن به ذخیره</a> <a role="button" href="#savecorrections" class="up-btn up-btn--sm up-btn--save-jump up-btn--block">⬇ رفتن به ذخیره</a>
@if (Model.ShowAdminOps && verse.VOrder > 1 && verse.VersePosition != RMuseum.Models.Ganjoor.VersePosition.Left) @if (Model.ShowAdminOps && verse.VOrder > 1 && verse.VersePosition != RMuseum.Models.Diwan.VersePosition.Left)
{ {
<a role="button" id="breakpoem-@verse.VOrder" class="up-btn up-btn--sm up-btn--danger" onclick="breakPoem(@Model.PageInformation.Poem.Id, @verse.VOrder, '@verse.Text')">✂️ شکستن از اینجا</a> <a role="button" id="breakpoem-@verse.VOrder" class="up-btn up-btn--sm up-btn--danger" onclick="breakPoem(@Model.PageInformation.Poem.Id, @verse.VOrder, '@verse.Text')">✂️ شکستن از اینجا</a>
} }
@ -1979,7 +1979,7 @@ else
<div class="up-field"> <div class="up-field">
<label>وزن فعلی</label> <label>وزن فعلی</label>
<p id="rhythm-old" class="up-field-static">@(Model.GanjoorMetre1 == null ? "" : Model.GanjoorMetre1.Rhythm)</p> <p id="rhythm-old" class="up-field-static">@(Model.DiwanMetre1 == null ? "" : Model.DiwanMetre1.Rhythm)</p>
</div> </div>
<div class="up-alert up-alert--warning"> <div class="up-alert up-alert--warning">
@ -2009,7 +2009,7 @@ else
} }
else else
{ {
if (Model.GanjoorMetre1 != null && Model.GanjoorMetre1.Rhythm == rhythm.Rhythm) if (Model.DiwanMetre1 != null && Model.DiwanMetre1.Rhythm == rhythm.Rhythm)
{ {
<option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option> <option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option>
} }
@ -2091,7 +2091,7 @@ else
</div> </div>
<div id="secondr3" class="up-field" style="display:none"> <div id="secondr3" class="up-field" style="display:none">
<label>وزن دوم فعلی</label> <label>وزن دوم فعلی</label>
<p id="rhythm-old2" class="up-field-static">@(Model.GanjoorMetre2 == null ? "" : Model.GanjoorMetre2.Rhythm)</p> <p id="rhythm-old2" class="up-field-static">@(Model.DiwanMetre2 == null ? "" : Model.DiwanMetre2.Rhythm)</p>
</div> </div>
<div id="secondr4" class="up-field" style="display:none"> <div id="secondr4" class="up-field" style="display:none">
<label for="select-search2"><span class="up-field-icon" aria-hidden="true">🎵</span> جستجوی وزن (دوم)</label> <label for="select-search2"><span class="up-field-icon" aria-hidden="true">🎵</span> جستجوی وزن (دوم)</label>
@ -2115,7 +2115,7 @@ else
} }
else else
{ {
if (Model.GanjoorMetre2 != null && Model.GanjoorMetre2.Rhythm == rhythm.Rhythm) if (Model.DiwanMetre2 != null && Model.DiwanMetre2.Rhythm == rhythm.Rhythm)
{ {
<option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option> <option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option>
} }
@ -2135,7 +2135,7 @@ else
<div class="up-field"> <div class="up-field">
<label>قالب شعری فعلی</label> <label>قالب شعری فعلی</label>
<p class="up-field-static"> <p class="up-field-static">
@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.PoemFormat) @RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(Model.PoemFormat)
<span id="poemformat-old" class="hidden-recitation">@Model.PoemFormat</span> <span id="poemformat-old" class="hidden-recitation">@Model.PoemFormat</span>
</p> </p>
</div> </div>
@ -2143,19 +2143,19 @@ else
<div class="up-field"> <div class="up-field">
<label for="poemformat"><span class="up-field-icon" aria-hidden="true">📐</span> قالب شعری</label> <label for="poemformat"><span class="up-field-icon" aria-hidden="true">📐</span> قالب شعری</label>
<select id="poemformat"> <select id="poemformat">
@foreach (var poemFormat in System.Enum.GetValues(typeof(RMuseum.Models.Ganjoor.GanjoorPoemFormat))) @foreach (var poemFormat in System.Enum.GetValues(typeof(RMuseum.Models.Diwan.DiwanPoemFormat)))
{ {
@if (Model.MyLastEdit != null && (Model.MyLastEdit.PoemFormat == (RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)) @if (Model.MyLastEdit != null && (Model.MyLastEdit.PoemFormat == (RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat))
{ {
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option> <option value="@poemFormat" selected>@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString((RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat)</option>
} }
else if (Model.PoemFormat == (RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat) else if (Model.PoemFormat == (RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat)
{ {
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option> <option value="@poemFormat" selected>@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString((RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat)</option>
} }
else else
{ {
<option value="@poemFormat">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option> <option value="@poemFormat">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString((RMuseum.Models.Diwan.DiwanPoemFormat)poemFormat)</option>
} }
} }
@ -2244,9 +2244,9 @@ else
@for (int verseIndex = 0; verseIndex < Model.PageInformation.Poem.Verses.Length; verseIndex++) @for (int verseIndex = 0; verseIndex < Model.PageInformation.Poem.Verses.Length; verseIndex++)
{ {
@if ( @if (
Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Right Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Diwan.VersePosition.Right
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.CenteredVerse1 || Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Diwan.VersePosition.CenteredVerse1
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Paragraph || Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Diwan.VersePosition.Paragraph
) )
{ {
var summaryCoupletNumber = Model.GetVerseCoupletNumber(Model.PageInformation.Poem.Verses[verseIndex]); var summaryCoupletNumber = Model.GetVerseCoupletNumber(Model.PageInformation.Poem.Verses[verseIndex]);
@ -2258,7 +2258,7 @@ else
</p> </p>
<div class="up-field"> <div class="up-field">
<label>متن</label> <label>متن</label>
@if (Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Paragraph) @if (Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Diwan.VersePosition.Paragraph)
{ {
<p class="up-field-static">@Model.PageInformation.Poem.Verses[verseIndex].Text</p> <p class="up-field-static">@Model.PageInformation.Poem.Verses[verseIndex].Text</p>
} }
@ -2270,9 +2270,9 @@ else
(nIndex == verseIndex (nIndex == verseIndex
|| ||
( (
Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.Right Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Diwan.VersePosition.Right
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.CenteredVerse1 && Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Diwan.VersePosition.CenteredVerse1
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.Paragraph && Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Diwan.VersePosition.Paragraph
)) ))
; nIndex++) ; nIndex++)
{ {
@ -2336,26 +2336,26 @@ else
} }
</div> </div>
@if (Model.PageInformation.Poem.Sections.Count(s => s.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Ganjoor.VersePoemSectionType.First) > 1) @if (Model.PageInformation.Poem.Sections.Count(s => s.SectionType == RMuseum.Models.Diwan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Diwan.VersePoemSectionType.First) > 1)
{ {
<div class="up-card" id="poem-sections"> <div class="up-card" id="poem-sections">
<h2 class="up-card__title">قطعات</h2> <h2 class="up-card__title">قطعات</h2>
@foreach (var poemSetion in Model.PageInformation.Poem.Sections.Where(s => s.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Ganjoor.VersePoemSectionType.First).ToList()) @foreach (var poemSetion in Model.PageInformation.Poem.Sections.Where(s => s.SectionType == RMuseum.Models.Diwan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Diwan.VersePoemSectionType.First).ToList())
{ {
<div class="up-verse-row"> <div class="up-verse-row">
<a href="/User/Section?poemId=@poemSetion.PoemId&index=@poemSetion.Index" role="button" class="up-btn up-btn--sm up-btn--ghost"> <a href="/User/Section?poemId=@poemSetion.PoemId&index=@poemSetion.Index" role="button" class="up-btn up-btn--sm up-btn--ghost">
🧩 قطعهٔ @(poemSetion.Number.ToPersianNumbers()): 🧩 قطعهٔ @(poemSetion.Number.ToPersianNumbers()):
</a> </a>
<p>@Html.Raw(poemSetion.HtmlText)</p> <p>@Html.Raw(poemSetion.HtmlText)</p>
<p class="up-hint">وزن: @(poemSetion.GanjoorMetre == null ? "تعیین نشده" : poemSetion.GanjoorMetre.Rhythm)</p> <p class="up-hint">وزن: @(poemSetion.DiwanMetre == null ? "تعیین نشده" : poemSetion.DiwanMetre.Rhythm)</p>
</div> </div>
} }
</div> </div>
} }
else else
if (Model.PageInformation.Poem.Sections.Count(s => s.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Ganjoor.VersePoemSectionType.First) == 1) if (Model.PageInformation.Poem.Sections.Count(s => s.SectionType == RMuseum.Models.Diwan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Diwan.VersePoemSectionType.First) == 1)
{ {
foreach (var poemSetion in Model.PageInformation.Poem.Sections.Where(s => s.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Ganjoor.VersePoemSectionType.First).ToList()) foreach (var poemSetion in Model.PageInformation.Poem.Sections.Where(s => s.SectionType == RMuseum.Models.Diwan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Diwan.VersePoemSectionType.First).ToList())
{ {
<p id="poem-sections"> <p id="poem-sections">
<a href="/User/Section?poemId=@poemSetion.PoemId&index=@poemSetion.Index" role="button" class="up-btn up-btn--ghost"> <a href="/User/Section?poemId=@poemSetion.PoemId&index=@poemSetion.Index" role="button" class="up-btn up-btn--ghost">
@ -2414,13 +2414,13 @@ else
{ {
<p class="up-btn-group-label">ابزارهای مدیریتی</p> <p class="up-btn-group-label">ابزارهای مدیریتی</p>
<div class="up-btn-group"> <div class="up-btn-group">
@if (Model.GanjoorMetre1 != null && !string.IsNullOrEmpty(Model.RhymeLetters)) @if (Model.DiwanMetre1 != null && !string.IsNullOrEmpty(Model.RhymeLetters))
{ {
<a role="button" onclick="updateRelatedSections(@Model.GanjoorMetre1.Id, '@Model.RhymeLetters')" class="up-btn up-btn--ghost">🔁 هم‌آهنگ‌های وزن اول</a> <a role="button" onclick="updateRelatedSections(@Model.DiwanMetre1.Id, '@Model.RhymeLetters')" class="up-btn up-btn--ghost">🔁 هم‌آهنگ‌های وزن اول</a>
} }
@if (Model.GanjoorMetre2 != null && !string.IsNullOrEmpty(Model.RhymeLetters)) @if (Model.DiwanMetre2 != null && !string.IsNullOrEmpty(Model.RhymeLetters))
{ {
<a role="button" onclick="updateRelatedSections(@Model.GanjoorMetre2.Id, '@Model.RhymeLetters')" class="up-btn up-btn--ghost">🔁 هم‌آهنگ‌های وزن دوم</a> <a role="button" onclick="updateRelatedSections(@Model.DiwanMetre2.Id, '@Model.RhymeLetters')" class="up-btn up-btn--ghost">🔁 هم‌آهنگ‌های وزن دوم</a>
} }
<a role="button" onclick="updateCoupletIndices(@Model.PageInformation.Poem.Id)" class="up-btn up-btn--ghost">🔢 تصحیح اندیس‌های ابیات</a> <a role="button" onclick="updateCoupletIndices(@Model.PageInformation.Poem.Id)" class="up-btn up-btn--ghost">🔢 تصحیح اندیس‌های ابیات</a>
<a role="button" onclick="regenerateSections(@Model.PageInformation.Poem.Id)" class="up-btn up-btn--ghost">♻️ قطعه‌بندی مجدد</a> <a role="button" onclick="regenerateSections(@Model.PageInformation.Poem.Id)" class="up-btn up-btn--ghost">♻️ قطعه‌بندی مجدد</a>
@ -2620,7 +2620,7 @@ else
<a role="button" class="up-btn up-btn--ghost" onclick="addGeoDateTagSuggestion()">➕ افزودن به فهرست پیشنهادها</a> <a role="button" class="up-btn up-btn--ghost" onclick="addGeoDateTagSuggestion()">➕ افزودن به فهرست پیشنهادها</a>
</div> </div>
@* شخصیت (person) tags use the same GanjoorPoemGeoDateTagCorrection structure as the geo/date @* شخصیت (person) tags use the same DiwanPoemGeoDateTagCorrection structure as the geo/date
tags above (see the JS comment above geoDateTagSuggestions), but a couplet referring to a tags above (see the JS comment above geoDateTagSuggestions), but a couplet referring to a
place/time and a couplet referring to a person are unrelated claims, so this is its own card place/time and a couplet referring to a person are unrelated claims, so this is its own card
with its own "existing tags" table, its own pending list, and its own add button - a with its own "existing tags" table, its own pending list, and its own add button - a

View File

@ -4,22 +4,22 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class EditorModel : PageModel public class EditorModel : PageModel
{ {
/// <summary> /// <summary>
/// my last edit /// my last edit
/// </summary> /// </summary>
public GanjoorPoemCorrectionViewModel MyLastEdit { get; set; } public DiwanPoemCorrectionViewModel MyLastEdit { get; set; }
/// <summary> /// <summary>
/// camelCase JSON of MyLastEdit.GeoDateTags, pre-serialized here (rather than inline in the .cshtml /// camelCase JSON of MyLastEdit.GeoDateTags, pre-serialized here (rather than inline in the .cshtml
@ -29,14 +29,14 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public string MyLastEditGeoDateTagsJson => public string MyLastEditGeoDateTagsJson =>
JsonConvert.SerializeObject( JsonConvert.SerializeObject(
MyLastEdit?.GeoDateTags ?? Array.Empty<GanjoorPoemGeoDateTagCorrection>(), MyLastEdit?.GeoDateTags ?? Array.Empty<DiwanPoemGeoDateTagCorrection>(),
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() } new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
); );
/// <summary> /// <summary>
/// page /// page
/// </summary> /// </summary>
public GanjoorPageCompleteViewModel PageInformation { get; set; } public DiwanPageCompleteViewModel PageInformation { get; set; }
/// <summary> /// <summary>
/// couplets (for the geo/date tag suggestion couplet-selection dropdown), same shape as SuggestQuoted's /// couplets (for the geo/date tag suggestion couplet-selection dropdown), same shape as SuggestQuoted's
@ -46,12 +46,12 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// rhythms alphabetically /// rhythms alphabetically
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsAlphabetically { get; set; } public DiwanMetre[] RhythmsAlphabetically { get; set; }
/// <summary> /// <summary>
/// rhythms by frequency /// rhythms by frequency
/// </summary> /// </summary>
public GanjoorMetre[] RhythmsByVerseCount { get; set; } public DiwanMetre[] RhythmsByVerseCount { get; set; }
public bool CanAssignRhythms { get; set; } public bool CanAssignRhythms { get; set; }
@ -60,12 +60,12 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public string FatalError { get; set; } public string FatalError { get; set; }
public string GetVersePosition(GanjoorVerseViewModel verse) public string GetVersePosition(DiwanVerseViewModel verse)
{ {
return VersePositionHelper.GetVersePositionString(verse.VersePosition); return VersePositionHelper.GetVersePositionString(verse.VersePosition);
} }
public int GetVerseCoupletNumber(GanjoorVerseViewModel verse) public int GetVerseCoupletNumber(DiwanVerseViewModel verse)
{ {
int n = 1; int n = 1;
VersePosition pre = VersePosition.Right; VersePosition pre = VersePosition.Right;
@ -125,16 +125,16 @@ namespace GanjooRazor.Areas.User.Pages
public PoemRelatedImage TextSourceImage { get; set; } public PoemRelatedImage TextSourceImage { get; set; }
public GanjoorMetre GanjoorMetre1 { get; set; } public DiwanMetre DiwanMetre1 { get; set; }
public GanjoorMetre GanjoorMetre2 { get; set; } public DiwanMetre DiwanMetre2 { get; set; }
public string RhymeLetters { get; set; } public string RhymeLetters { get; set; }
/// <summary> /// <summary>
/// valid for whole poem sections /// valid for whole poem sections
/// </summary> /// </summary>
public GanjoorPoemFormat? PoemFormat { get; set; } public DiwanPoemFormat? PoemFormat { get; set; }
/// <summary> /// <summary>
/// can edit /// can edit
@ -150,7 +150,7 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// locations /// locations
/// </summary> /// </summary>
public List<GanjoorGeoLocation> Locations { get; set; } public List<DiwanGeoLocation> Locations { get; set; }
/// <summary> /// <summary>
/// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side to warn /// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side to warn
@ -161,14 +161,14 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public string AllLocationsJson => public string AllLocationsJson =>
JsonConvert.SerializeObject( JsonConvert.SerializeObject(
(Locations ?? new List<GanjoorGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }), (Locations ?? new List<DiwanGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() } new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
); );
/// <summary> /// <summary>
/// people (for the geo/date/person tag's person picker) /// people (for the geo/date/person tag's person picker)
/// </summary> /// </summary>
public List<GanjoorRelatedPerson> People { get; set; } public List<DiwanRelatedPerson> People { get; set; }
/// <summary> /// <summary>
/// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only - enough to /// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only - enough to
@ -177,7 +177,7 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public string AllPeopleJson => public string AllPeopleJson =>
JsonConvert.SerializeObject( JsonConvert.SerializeObject(
(People ?? new List<GanjoorRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }), (People ?? new List<DiwanRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() } new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
); );
@ -187,7 +187,7 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public PoemGeoDateTag[] PoemGeoDateTags { get; set; } public PoemGeoDateTag[] PoemGeoDateTags { get; set; }
public GanjoorLanguage[] Languages { get; set; } public DiwanLanguage[] Languages { get; set; }
private async Task ReadLanguagesAsync(HttpClient secureClient) private async Task ReadLanguagesAsync(HttpClient secureClient)
{ {
@ -198,7 +198,7 @@ namespace GanjooRazor.Areas.User.Pages
return; return;
} }
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync()); Languages = JsonConvert.DeserializeObject<DiwanLanguage[]>(await response.Content.ReadAsStringAsync());
} }
/// <summary> /// <summary>
@ -207,7 +207,7 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
/// <param name="verses"></param> /// <param name="verses"></param>
/// <returns></returns> /// <returns></returns>
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses) private Tuple<int, string>[] GetCouplets(DiwanVerseViewModel[] verses)
{ {
int coupetIndex = -1; int coupetIndex = -1;
string coupletText = ""; string coupletText = "";
@ -275,38 +275,38 @@ namespace GanjooRazor.Areas.User.Pages
Couplets = Array.Empty<Tuple<int, string>>(); Couplets = Array.Empty<Tuple<int, string>>();
ShowAdminOps = CanEdit && Request.Query["admin"] == "1"; ShowAdminOps = CanEdit && Request.Query["admin"] == "1";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var editResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/correction/last/{Request.Query["id"]}"); var editResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/correction/last/{Request.Query["id"]}");
if (!editResponse.IsSuccessStatusCode) if (!editResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
MyLastEdit = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync()); MyLastEdit = JsonConvert.DeserializeObject<DiwanPoemCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true"); var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/rhythms?sortOnVerseCount=true");
if (!rhythmResponse.IsSuccessStatusCode) if (!rhythmResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
return Page(); return Page();
} }
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync()); RhythmsByVerseCount = JsonConvert.DeserializeObject<DiwanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount); List<DiwanMetre> rhythmsByVerseCount = new List<DiwanMetre>(RhythmsByVerseCount);
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm)); rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "null" Rhythm = "null"
} }
); );
rhythmsByVerseCount.Insert(0, new GanjoorMetre() rhythmsByVerseCount.Insert(0, new DiwanMetre()
{ {
Rhythm = "" Rhythm = ""
} }
@ -314,7 +314,7 @@ namespace GanjooRazor.Areas.User.Pages
RhythmsAlphabetically = rhythmsByVerseCount.ToArray(); RhythmsAlphabetically = rhythmsByVerseCount.ToArray();
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Request.Query["id"]}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={Request.Query["id"]}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -322,13 +322,13 @@ namespace GanjooRazor.Areas.User.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return Page(); return Page();
} }
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
Couplets = GetCouplets(PageInformation.Poem.Verses); Couplets = GetCouplets(PageInformation.Poem.Verses);
@ -337,12 +337,12 @@ namespace GanjooRazor.Areas.User.Pages
RhymeLetters = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).OrderBy(s => s.VerseType).First().RhymeLetters; RhymeLetters = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && !string.IsNullOrEmpty(s.RhymeLetters)).OrderBy(s => s.VerseType).First().RhymeLetters;
} }
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Any()) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).Any())
{ {
GanjoorMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).First().GanjoorMetre; DiwanMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).OrderBy(s => s.VerseType).First().DiwanMetre;
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Count() > 1) if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).Count() > 1)
{ {
GanjoorMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).ToList()[1].GanjoorMetre; DiwanMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DiwanMetre != null).OrderBy(s => s.VerseType).ToList()[1].DiwanMetre;
} }
} }
@ -352,7 +352,7 @@ namespace GanjooRazor.Areas.User.Pages
} }
else else
{ {
PoemFormat = GanjoorPoemFormat.Unknown; PoemFormat = DiwanPoemFormat.Unknown;
} }
if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any()) if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any())
@ -388,10 +388,10 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
Locations = new List<GanjoorGeoLocation>(); Locations = new List<DiwanGeoLocation>();
Locations.Add Locations.Add
( (
new GanjoorGeoLocation() new DiwanGeoLocation()
{ {
Id = 0, Id = 0,
Latitude = 0, Latitude = 0,
@ -400,7 +400,7 @@ namespace GanjooRazor.Areas.User.Pages
} }
); );
Locations.AddRange(JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync())); Locations.AddRange(JsonConvert.DeserializeObject<DiwanGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync()));
var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people"); var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people");
if (!responsePeople.IsSuccessStatusCode) if (!responsePeople.IsSuccessStatusCode)
@ -409,10 +409,10 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
People = JsonConvert.DeserializeObject<List<GanjoorRelatedPerson>>(await responsePeople.Content.ReadAsStringAsync()); People = JsonConvert.DeserializeObject<List<DiwanRelatedPerson>>(await responsePeople.Content.ReadAsStringAsync());
var tagsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{PageInformation.Id}/geotag"); var tagsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/{PageInformation.Id}/geotag");
if (!tagsResponse.IsSuccessStatusCode) if (!tagsResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await tagsResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await tagsResponse.Content.ReadAsStringAsync());
@ -431,12 +431,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostDeletePoemCorrectionsAsync(int poemid) public async Task<IActionResult> OnPostDeletePoemCorrectionsAsync(int poemid)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync( HttpResponseMessage response = await secureClient.DeleteAsync(
$"{APIRoot.Url}/api/ganjoor/poem/correction/{poemid}"); $"{APIRoot.Url}/api/diwan/poem/correction/{poemid}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
string rawError = await response.Content.ReadAsStringAsync(); string rawError = await response.Content.ReadAsStringAsync();
@ -478,7 +478,7 @@ namespace GanjooRazor.Areas.User.Pages
public string[] verseLanguages { get; set; } public string[] verseLanguages { get; set; }
public string note { get; set; } public string note { get; set; }
public bool hideMyName { get; set; } public bool hideMyName { get; set; }
public RMuseum.Models.Ganjoor.GanjoorPoemGeoDateTagCorrection[] geoDateTags { get; set; } public RMuseum.Models.Diwan.DiwanPoemGeoDateTagCorrection[] geoDateTags { get; set; }
} }
public async Task<IActionResult> OnPostSendPoemCorrectionsAsync([FromBody] PoemCorrectionStructure pcs) public async Task<IActionResult> OnPostSendPoemCorrectionsAsync([FromBody] PoemCorrectionStructure pcs)
@ -487,14 +487,14 @@ namespace GanjooRazor.Areas.User.Pages
{ {
if (pcs == null) if (pcs == null)
{ {
return new BadRequestObjectResult("خطای پیش‌بینی نشده: لطفاً نشانی این شعر را به ganjoor@ganjoor.net ارسال بفرمایید تا بررسی بیشتری انجام شود."); return new BadRequestObjectResult("خطای پیش‌بینی نشده: لطفاً نشانی این شعر را به diwan@ganjoor.net ارسال بفرمایید تا بررسی بیشتری انجام شود.");
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={pcs.poemid}"); var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/pageurl?id={pcs.poemid}");
if (!pageUrlResponse.IsSuccessStatusCode) if (!pageUrlResponse.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
@ -502,16 +502,16 @@ namespace GanjooRazor.Areas.User.Pages
} }
var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync()); var pageUrl = JsonConvert.DeserializeObject<string>(await pageUrlResponse.Content.ReadAsStringAsync());
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}"); var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/page?url={pageUrl}");
if (!pageQuery.IsSuccessStatusCode) if (!pageQuery.IsSuccessStatusCode)
{ {
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync()); FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
return new BadRequestObjectResult(FatalError); return new BadRequestObjectResult(FatalError);
} }
var pageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>(); var pageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DiwanPageCompleteViewModel>();
string title = null; string title = null;
List<GanjoorVerseVOrderText> vOrderTexts = new List<GanjoorVerseVOrderText>(); List<DiwanVerseVOrderText> vOrderTexts = new List<DiwanVerseVOrderText>();
List<VersePosition?> versePositions = new List<VersePosition?>(); List<VersePosition?> versePositions = new List<VersePosition?>();
foreach (var versePosition in pcs.versePositions) foreach (var versePosition in pcs.versePositions)
{ {
@ -546,7 +546,7 @@ namespace GanjooRazor.Areas.User.Pages
{ {
vOrderTexts.Add vOrderTexts.Add
( (
new GanjoorVerseVOrderText() new DiwanVerseVOrderText()
{ {
VORder = vOrder, VORder = vOrder,
Text = verseText, Text = verseText,
@ -593,7 +593,7 @@ namespace GanjooRazor.Areas.User.Pages
} }
vOrderTexts.Add vOrderTexts.Add
( (
new GanjoorVerseVOrderText() new DiwanVerseVOrderText()
{ {
VORder = vOrder, VORder = vOrder,
Text = null, Text = null,
@ -624,7 +624,7 @@ namespace GanjooRazor.Areas.User.Pages
GanjoorPoemCorrectionViewModel correction = new GanjoorPoemCorrectionViewModel() DiwanPoemCorrectionViewModel correction = new DiwanPoemCorrectionViewModel()
{ {
PoemId = pcs.poemid, PoemId = pcs.poemid,
Title = title, Title = title,
@ -632,7 +632,7 @@ namespace GanjooRazor.Areas.User.Pages
Rhythm = pcs.rhythm, Rhythm = pcs.rhythm,
Rhythm2 = pcs.rhythm2, Rhythm2 = pcs.rhythm2,
RhymeLetters = pcs.rhyme, RhymeLetters = pcs.rhyme,
PoemFormat = string.IsNullOrEmpty(pcs.format) ? (GanjoorPoemFormat?)null : (GanjoorPoemFormat)Enum.Parse(typeof(GanjoorPoemFormat), pcs.format), PoemFormat = string.IsNullOrEmpty(pcs.format) ? (DiwanPoemFormat?)null : (DiwanPoemFormat)Enum.Parse(typeof(DiwanPoemFormat), pcs.format),
PoemSummary = poemSummary, PoemSummary = poemSummary,
Note = pcs.note, Note = pcs.note,
HideMyName = pcs.hideMyName, HideMyName = pcs.hideMyName,
@ -640,7 +640,7 @@ namespace GanjooRazor.Areas.User.Pages
}; };
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/poem/correction", $"{APIRoot.Url}/api/diwan/poem/correction",
new StringContent(JsonConvert.SerializeObject(correction), new StringContent(JsonConvert.SerializeObject(correction),
Encoding.UTF8, Encoding.UTF8,
"application/json")); "application/json"));
@ -666,12 +666,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostBreakPoemAsync(int poemId, int vOrder) public async Task<IActionResult> OnPostBreakPoemAsync(int poemId, int vOrder)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/poem/break", $"{APIRoot.Url}/api/diwan/poem/break",
new StringContent(JsonConvert.SerializeObject new StringContent(JsonConvert.SerializeObject
( (
new PoemVerseOrder() new PoemVerseOrder()
@ -697,12 +697,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostUpdateRelatedSectionsAsync(int meterId, string rhyme) public async Task<IActionResult> OnPostUpdateRelatedSectionsAsync(int meterId, string rhyme)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/sections/updaterelated?metreId={meterId}&rhyme={rhyme}", $"{APIRoot.Url}/api/diwan/sections/updaterelated?metreId={meterId}&rhyme={rhyme}",
null null
); );
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -720,12 +720,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostRefillCoupletIndicesAsync(int id) public async Task<IActionResult> OnPostRefillCoupletIndicesAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/refillcoupletindices/{id}", $"{APIRoot.Url}/api/diwan/refillcoupletindices/{id}",
null null
); );
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -743,12 +743,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostRegeneratePoemSectionsAsync(int id) public async Task<IActionResult> OnPostRegeneratePoemSectionsAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/poem/{id}/sections/regenerate", $"{APIRoot.Url}/api/diwan/poem/{id}/sections/regenerate",
null null
); );
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -769,16 +769,16 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnGetComputeRhymeAsync(int id) public async Task<IActionResult> OnGetComputeRhymeAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/analysisrhyme/{id}"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/poem/analysisrhyme/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
} }
var rhyme = JsonConvert.DeserializeObject<GanjooRhymeAnalysisResult>(await response.Content.ReadAsStringAsync()); var rhyme = JsonConvert.DeserializeObject<DiwanRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
return new OkObjectResult(rhyme.Rhyme); return new OkObjectResult(rhyme.Rhyme);
} }
else else
@ -791,12 +791,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostNewGeoDateTagAsync(int poemId, int locationId, string year, int month, string day, bool verifiedDate, bool ignoreInCategory) public async Task<IActionResult> OnPostNewGeoDateTagAsync(int poemId, int locationId, string year, int month, string day, bool verifiedDate, bool ignoreInCategory)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/poem/geotag", $"{APIRoot.Url}/api/diwan/poem/geotag",
new StringContent(JsonConvert.SerializeObject( new StringContent(JsonConvert.SerializeObject(
new PoemGeoDateTag() new PoemGeoDateTag()
{ {
@ -827,12 +827,12 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteGeoDateTagAsync(int id) public async Task<IActionResult> OnDeleteGeoDateTagAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.DeleteAsync( HttpResponseMessage response = await secureClient.DeleteAsync(
$"{APIRoot.Url}/api/ganjoor/poem/geotag/{id}" $"{APIRoot.Url}/api/diwan/poem/geotag/{id}"
); );
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
@ -849,14 +849,14 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostSaveMetaAsync(int poemId, bool noindex, string redirectfromurl, int mixedmodeorder) public async Task<IActionResult> OnPostSaveMetaAsync(int poemId, bool noindex, string redirectfromurl, int mixedmodeorder)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PutAsync( HttpResponseMessage response = await secureClient.PutAsync(
$"{APIRoot.Url}/api/ganjoor/poem/adminedit/{poemId}", $"{APIRoot.Url}/api/diwan/poem/adminedit/{poemId}",
new StringContent(JsonConvert.SerializeObject( new StringContent(JsonConvert.SerializeObject(
new GanjoorModifyPageViewModel() new DiwanModifyPageViewModel()
{ {
NoIndex = noindex, NoIndex = noindex,
RedirectFromFullUrl = redirectfromurl, RedirectFromFullUrl = redirectfromurl,

View File

@ -1,12 +1,12 @@
@page @page
@model GanjooRazor.Areas.User.Pages.EditsModel @model DiwanRazor.Areas.User.Pages.EditsModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@using RMuseum.Models.Ganjoor @using RMuseum.Models.Diwan
@using GanjooRazor.Utils @using DiwanRazor.Utils
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایش‌های من"; ViewData["Title"] = "ویرایش‌های من";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@ -255,10 +255,10 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<p style="color:red">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(correction.OriginalPoemFormat)</p> <p style="color:red">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(correction.OriginalPoemFormat)</p>
</td> </td>
<td> <td>
<p style="color:green">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(correction.PoemFormat)</p> <p style="color:green">@RMuseum.Services.Implementation.DiwanPoemFormatConvertor.GetString(correction.PoemFormat)</p>
</td> </td>
<td> <td>
<partial name="_ReviewResultBadge" model="correction.PoemFormatReviewResult" /> <partial name="_ReviewResultBadge" model="correction.PoemFormatReviewResult" />
@ -483,11 +483,11 @@ else
<td> <td>
@if (verse.OriginalVersePosition != null) @if (verse.OriginalVersePosition != null)
{ {
<p>تبدیل نوع مصرع از @RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((VersePosition)verse.OriginalVersePosition)</p> <p>تبدیل نوع مصرع از @RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((VersePosition)verse.OriginalVersePosition)</p>
} }
</td> </td>
<td> <td>
<p style="color:orange">تبدیل نوع مصرع به @RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((VersePosition)verse.VersePosition)</p> <p style="color:orange">تبدیل نوع مصرع به @RMuseum.Models.Diwan.VersePositionHelper.GetVersePositionString((VersePosition)verse.VersePosition)</p>
</td> </td>
<td> <td>
<partial name="_ReviewResultBadge" model="verse.VersePositionResult" /> <partial name="_ReviewResultBadge" model="verse.VersePositionResult" />

View File

@ -5,18 +5,18 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Auth.ViewModel; using RMuseum.Models.Auth.ViewModel;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class EditsModel : PageModel public class EditsModel : PageModel
{ {
@ -45,14 +45,14 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public Guid? filteredUserId { get; set; } public Guid? filteredUserId { get; set; }
public GanjoorUserPublicProfile Profile { get; set; } public DiwanUserPublicProfile Profile { get; set; }
/// <summary> /// <summary>
/// Corrections /// Corrections
/// </summary> /// </summary>
public List<GanjoorPoemCorrectionViewModel> Corrections { get; set; } public List<DiwanPoemCorrectionViewModel> Corrections { get; set; }
public GanjoorLanguage[] Languages { get; set; } public DiwanLanguage[] Languages { get; set; }
private async Task ReadLanguagesAsync(HttpClient secureClient) private async Task ReadLanguagesAsync(HttpClient secureClient)
{ {
@ -63,7 +63,7 @@ namespace GanjooRazor.Areas.User.Pages
return; return;
} }
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync()); Languages = JsonConvert.DeserializeObject<DiwanLanguage[]>(await response.Content.ReadAsStringAsync());
} }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
@ -72,8 +72,8 @@ namespace GanjooRazor.Areas.User.Pages
CanEdit = Request.Cookies["CanEdit"] == "True"; CanEdit = Request.Cookies["CanEdit"] == "True";
AllUsersEdits = false; AllUsersEdits = false;
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
{ {
int pageNumber = 1; int pageNumber = 1;
@ -81,26 +81,26 @@ namespace GanjooRazor.Areas.User.Pages
{ {
pageNumber = int.Parse(Request.Query["page"]); pageNumber = int.Parse(Request.Query["page"]);
} }
string url = $"{APIRoot.Url}/api/ganjoor/corrections/mine?PageNumber={pageNumber}&PageSize=20"; string url = $"{APIRoot.Url}/api/diwan/corrections/mine?PageNumber={pageNumber}&PageSize=20";
if (CanEdit) if (CanEdit)
{ {
AllUsersEdits = Request.Query["AllUsers"] == "1"; AllUsersEdits = Request.Query["AllUsers"] == "1";
if (AllUsersEdits) if (AllUsersEdits)
{ {
url = $"{APIRoot.Url}/api/ganjoor/corrections/all?PageNumber={pageNumber}&PageSize=20"; url = $"{APIRoot.Url}/api/diwan/corrections/all?PageNumber={pageNumber}&PageSize=20";
} }
filteredUserId = string.IsNullOrEmpty(Request.Query["UserId"]) ? null : Guid.Parse(Request.Query["UserId"]); filteredUserId = string.IsNullOrEmpty(Request.Query["UserId"]) ? null : Guid.Parse(Request.Query["UserId"]);
if (filteredUserId != null) if (filteredUserId != null)
{ {
url += $"&userId={filteredUserId}"; url += $"&userId={filteredUserId}";
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/user/profile/{filteredUserId}"); var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/user/profile/{filteredUserId}");
if (!responseUserProfile.IsSuccessStatusCode) if (!responseUserProfile.IsSuccessStatusCode)
{ {
LastError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync()); LastError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Profile = JsonConvert.DeserializeObject<GanjoorUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync()); Profile = JsonConvert.DeserializeObject<DiwanUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
} }
} }
var response = await secureClient.GetAsync(url); var response = await secureClient.GetAsync(url);
@ -110,7 +110,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorPoemCorrectionViewModel>>(); Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DiwanPoemCorrectionViewModel>>();
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))
@ -205,18 +205,18 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostRollBackCorrectionAsync(int correctionId) public async Task<IActionResult> OnPostRollBackCorrectionAsync(int correctionId)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/correction/{correctionId}"); var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/correction/{correctionId}");
if (!correctionResponse.IsSuccessStatusCode) if (!correctionResponse.IsSuccessStatusCode)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
} }
var currentCorrection = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync()); var currentCorrection = JsonConvert.DeserializeObject<DiwanPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
GanjoorPoemCorrectionViewModel correction = new GanjoorPoemCorrectionViewModel(); DiwanPoemCorrectionViewModel correction = new DiwanPoemCorrectionViewModel();
correction.PoemId = currentCorrection.PoemId; correction.PoemId = currentCorrection.PoemId;
if (currentCorrection.Title != null && currentCorrection.Result == CorrectionReviewResult.Approved) if (currentCorrection.Title != null && currentCorrection.Result == CorrectionReviewResult.Approved)
{ {
@ -224,7 +224,7 @@ namespace GanjooRazor.Areas.User.Pages
correction.Title = currentCorrection.OriginalTitle; correction.Title = currentCorrection.OriginalTitle;
} }
List<GanjoorVerseVOrderText> vOrderTexts = new List<GanjoorVerseVOrderText>(); List<DiwanVerseVOrderText> vOrderTexts = new List<DiwanVerseVOrderText>();
if (currentCorrection.VerseOrderText != null) if (currentCorrection.VerseOrderText != null)
{ {
@ -241,7 +241,7 @@ namespace GanjooRazor.Areas.User.Pages
) )
{ {
vOrderTexts.Add( vOrderTexts.Add(
new GanjoorVerseVOrderText() new DiwanVerseVOrderText()
{ {
VORder = verseOrderText.VORder, VORder = verseOrderText.VORder,
OriginalText = verseOrderText.Text, OriginalText = verseOrderText.Text,
@ -284,7 +284,7 @@ namespace GanjooRazor.Areas.User.Pages
if (currentCorrection.GeoDateTags != null) if (currentCorrection.GeoDateTags != null)
{ {
var geoDateTagsRollback = new List<GanjoorPoemGeoDateTagCorrection>(); var geoDateTagsRollback = new List<DiwanPoemGeoDateTagCorrection>();
foreach (var geoTag in currentCorrection.GeoDateTags.Where(g => g.Result == CorrectionReviewResult.Approved)) foreach (var geoTag in currentCorrection.GeoDateTags.Where(g => g.Result == CorrectionReviewResult.Approved))
{ {
// PersonId (if the deleted tag was a person tag) is part of what got snapshotted // PersonId (if the deleted tag was a person tag) is part of what got snapshotted
@ -297,7 +297,7 @@ namespace GanjooRazor.Areas.User.Pages
// the original request deleted an existing tag - undo that by re-adding a tag with // the original request deleted an existing tag - undo that by re-adding a tag with
// the same data, which was snapshotted onto this same record when it was approved // the same data, which was snapshotted onto this same record when it was approved
// (LocationId/LunarYear/etc. are otherwise unused for a pure delete-request) // (LocationId/LunarYear/etc. are otherwise unused for a pure delete-request)
geoDateTagsRollback.Add(new GanjoorPoemGeoDateTagCorrection() geoDateTagsRollback.Add(new DiwanPoemGeoDateTagCorrection()
{ {
CoupletIndex = geoTag.CoupletIndex, CoupletIndex = geoTag.CoupletIndex,
MarkForDelete = false, MarkForDelete = false,
@ -314,7 +314,7 @@ namespace GanjooRazor.Areas.User.Pages
{ {
// the original request added a new tag - undo that by requesting deletion of the // the original request added a new tag - undo that by requesting deletion of the
// live tag it produced (its id was recorded onto ExistingTagId when approved) // live tag it produced (its id was recorded onto ExistingTagId when approved)
geoDateTagsRollback.Add(new GanjoorPoemGeoDateTagCorrection() geoDateTagsRollback.Add(new DiwanPoemGeoDateTagCorrection()
{ {
CoupletIndex = geoTag.CoupletIndex, CoupletIndex = geoTag.CoupletIndex,
MarkForDelete = true, MarkForDelete = true,
@ -337,7 +337,7 @@ namespace GanjooRazor.Areas.User.Pages
} }
HttpResponseMessage response = await secureClient.PostAsync( HttpResponseMessage response = await secureClient.PostAsync(
$"{APIRoot.Url}/api/ganjoor/poem/correction", $"{APIRoot.Url}/api/diwan/poem/correction",
new StringContent(JsonConvert.SerializeObject(correction), new StringContent(JsonConvert.SerializeObject(correction),
Encoding.UTF8, Encoding.UTF8,
"application/json")); "application/json"));

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.FAQCatEditModel @model DiwanRazor.Areas.User.Pages.FAQCatEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایش دسته‌بندی"; ViewData["Title"] = "ویرایش دسته‌بندی";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -8,7 +8,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class FAQCatEditModel : PageModel public class FAQCatEditModel : PageModel
{ {
@ -22,7 +22,7 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastMessage = ""; LastMessage = "";
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}")) if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
{ {
LastMessage = "شما به این بخش دسترسی ندارید."; LastMessage = "شما به این بخش دسترسی ندارید.";
@ -31,9 +31,9 @@ namespace GanjooRazor.Areas.User.Pages
if(!string.IsNullOrWhiteSpace(Request.Query["id"])) if(!string.IsNullOrWhiteSpace(Request.Query["id"]))
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure/{Request.Query["id"]}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -57,9 +57,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = HttpResponseMessage response =
Category.Id == 0 ? Category.Id == 0 ?
await secureClient.PostAsync($"{APIRoot.Url}/api/faq/cat", new StringContent(JsonConvert.SerializeObject(Category), Encoding.UTF8, "application/json")) await secureClient.PostAsync($"{APIRoot.Url}/api/faq/cat", new StringContent(JsonConvert.SerializeObject(Category), Encoding.UTF8, "application/json"))

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.FAQItemEditModel @model DiwanRazor.Areas.User.Pages.FAQItemEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایش پرسش"; ViewData["Title"] = "ویرایش پرسش";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@if (!string.IsNullOrEmpty(Model.LastMessage)) @if (!string.IsNullOrEmpty(Model.LastMessage))

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -8,7 +8,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class FAQItemEditModel : PageModel public class FAQItemEditModel : PageModel
{ {
@ -22,7 +22,7 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastMessage = ""; LastMessage = "";
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}")) if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
{ {
LastMessage = "شما به این بخش دسترسی ندارید."; LastMessage = "شما به این بخش دسترسی ندارید.";
@ -31,9 +31,9 @@ namespace GanjooRazor.Areas.User.Pages
if (!string.IsNullOrWhiteSpace(Request.Query["id"])) if (!string.IsNullOrWhiteSpace(Request.Query["id"]))
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/secure/{Request.Query["id"]}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/secure/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -64,9 +64,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = HttpResponseMessage response =
Question.Id == 0 ? Question.Id == 0 ?
await secureClient.PostAsync($"{APIRoot.Url}/api/faq", new StringContent(JsonConvert.SerializeObject(Question), Encoding.UTF8, "application/json")) await secureClient.PostAsync($"{APIRoot.Url}/api/faq", new StringContent(JsonConvert.SerializeObject(Question), Encoding.UTF8, "application/json"))

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.FAQItemsModel @model DiwanRazor.Areas.User.Pages.FAQItemsModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "پرسش‌های متداول"; ViewData["Title"] = "پرسش‌های متداول";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,4 +1,4 @@
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -8,7 +8,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class FAQItemsModel : PageModel public class FAQItemsModel : PageModel
{ {
@ -26,7 +26,7 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastMessage = ""; LastMessage = "";
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}")) if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
{ {
LastMessage = "شما به این بخش دسترسی ندارید."; LastMessage = "شما به این بخش دسترسی ندارید.";
@ -35,9 +35,9 @@ namespace GanjooRazor.Areas.User.Pages
CatId = 0; CatId = 0;
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -72,9 +72,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/faq/cat/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/faq/cat/{id}");
@ -93,9 +93,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnGetCategoryItemsAsync(int id) public async Task<IActionResult> OnGetCategoryItemsAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/items/secure?catId={id}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/items/secure?catId={id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -115,9 +115,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteItemAsync(int id) public async Task<IActionResult> OnDeleteItemAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/faq/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/faq/{id}");

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.FinalizeImagesModel @model DiwanRazor.Areas.User.Pages.FinalizeImagesModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "نهایی‌سازی تصاویر پیشنهادی"; ViewData["Title"] = "نهایی‌سازی تصاویر پیشنهادی";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@ -22,7 +22,7 @@
else else
{ {
<div class="up-card"> <div class="up-card">
<p><a href="@Model.MainImage.GanjoorUrl" target="_blank">@Model.MainImage.GanjoorTitle</a></p> <p><a href="@Model.MainImage.DiwanUrl" target="_blank">@Model.MainImage.DiwanTitle</a></p>
<div style="display:flex;gap:var(--up-space-3);flex-wrap:wrap;"> <div style="display:flex;gap:var(--up-space-3);flex-wrap:wrap;">
<div> <div>

View File

@ -1,15 +1,15 @@
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Models.MuseumLink; using DiwanRazor.Models.MuseumLink;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.GanjoorIntegration.ViewModels; using RMuseum.Models.DiwanIntegration.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class FinalizeImagesModel : PageModel public class FinalizeImagesModel : PageModel
{ {
@ -28,9 +28,9 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public int TotalCount { get; set; } public int TotalCount { get; set; }
public GanjoorLinkViewModel MainImage { get; set; } public DiwanLinkViewModel MainImage { get; set; }
public GanjoorLinkViewModel PreviouslyLinkedImage { get; set; } public DiwanLinkViewModel PreviouslyLinkedImage { get; set; }
[BindProperty] [BindProperty]
public ImageLinkFinalizeModel ImageLinkFinalizeModel { get; set; } public ImageLinkFinalizeModel ImageLinkFinalizeModel { get; set; }
@ -44,11 +44,11 @@ namespace GanjooRazor.Areas.User.Pages
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
MainImage = null; MainImage = null;
PreviouslyLinkedImage = null; PreviouslyLinkedImage = null;
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var imageResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/artifacts/ganjoor/nextunsychedimage?skip={Skip}"); var imageResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/artifacts/diwan/nextunsychedimage?skip={Skip}");
if (!imageResponse.IsSuccessStatusCode) if (!imageResponse.IsSuccessStatusCode)
{ {
LastError = await imageResponse.Content.ReadAsStringAsync(); LastError = await imageResponse.Content.ReadAsStringAsync();
@ -61,7 +61,7 @@ namespace GanjooRazor.Areas.User.Pages
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount; TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
} }
var images = JsonConvert.DeserializeObject<GanjoorLinkViewModel[]>(await imageResponse.Content.ReadAsStringAsync()); var images = JsonConvert.DeserializeObject<DiwanLinkViewModel[]>(await imageResponse.Content.ReadAsStringAsync());
if(images != null) if(images != null)
{ {
@ -97,11 +97,11 @@ namespace GanjooRazor.Areas.User.Pages
{ {
LastError = ""; LastError = "";
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var imageResponse = await secureClient.PutAsync($"{APIRoot.Url}/api/artifacts/ganjoor/sync/{ImageLinkFinalizeModel.Id}/{ImageLinkFinalizeModel.DisplayOnPage}", null); var imageResponse = await secureClient.PutAsync($"{APIRoot.Url}/api/artifacts/diwan/sync/{ImageLinkFinalizeModel.Id}/{ImageLinkFinalizeModel.DisplayOnPage}", null);
if (!imageResponse.IsSuccessStatusCode) if (!imageResponse.IsSuccessStatusCode)
{ {
LastError = await imageResponse.Content.ReadAsStringAsync(); LastError = await imageResponse.Content.ReadAsStringAsync();

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.HistoryModel @model DiwanRazor.Areas.User.Pages.HistoryModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ادامهٔ مطالعه"; ViewData["Title"] = "ادامهٔ مطالعه";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,12 +1,12 @@
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -16,7 +16,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class HistoryModel : PageModel public class HistoryModel : PageModel
{ {
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// history items /// history items
/// </summary> /// </summary>
public List<GanjoorUserBookmarkViewModel> HistoryItems { get; set; } public List<DiwanUserBookmarkViewModel> HistoryItems { get; set; }
/// <summary> /// <summary>
/// tracking is enabled /// tracking is enabled
@ -45,8 +45,8 @@ namespace GanjooRazor.Areas.User.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"])) if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/"); return Redirect("/");
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/options/KeepHistory"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/options/KeepHistory");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -85,7 +85,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
HistoryItems = JArray.Parse(await responseHistoryItems.Content.ReadAsStringAsync()).ToObject<List<GanjoorUserBookmarkViewModel>>(); HistoryItems = JArray.Parse(await responseHistoryItems.Content.ReadAsStringAsync()).ToObject<List<DiwanUserBookmarkViewModel>>();
string paginnationMetadata = responseHistoryItems.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = responseHistoryItems.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))
@ -168,9 +168,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteHistoryItem(Guid id) public async Task<IActionResult> OnDeleteHistoryItem(Guid id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/tracking/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/tracking/{id}");
@ -190,9 +190,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostStopTracking() public async Task<IActionResult> OnPostStopTracking()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/tracking", new StringContent(JsonConvert.SerializeObject(false), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/tracking", new StringContent(JsonConvert.SerializeObject(false), Encoding.UTF8, "application/json"));
@ -225,9 +225,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostStartTracking() public async Task<IActionResult> OnPostStartTracking()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/tracking", new StringContent(JsonConvert.SerializeObject(true), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/tracking", new StringContent(JsonConvert.SerializeObject(true), Encoding.UTF8, "application/json"));

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.Panel.Pages.IndexModel @model DiwanRazor.Areas.Panel.Pages.IndexModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "پیشخان کاربر"; ViewData["Title"] = "پیشخان کاربر";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,5 +1,5 @@
using GanjooRazor.Models.User; using DiwanRazor.Models.User;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -8,7 +8,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GanjooRazor.Areas.Panel.Pages namespace DiwanRazor.Areas.Panel.Pages
{ {
public class IndexModel : PageModel public class IndexModel : PageModel
{ {
@ -48,9 +48,9 @@ namespace GanjooRazor.Areas.Panel.Pages
private async Task _PreparePage() private async Task _PreparePage()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Cookies["UserId"]}"); var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Cookies["UserId"]}");
if (userInfoResponse.IsSuccessStatusCode) if (userInfoResponse.IsSuccessStatusCode)
@ -90,9 +90,9 @@ namespace GanjooRazor.Areas.Panel.Pages
{ {
LastError = ""; LastError = "";
PasswordChanged = ""; PasswordChanged = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var isAdminResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/isadmin?userId={Request.Cookies["UserId"]}"); var isAdminResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/isadmin?userId={Request.Cookies["UserId"]}");
if (isAdminResponse.IsSuccessStatusCode) if (isAdminResponse.IsSuccessStatusCode)
@ -134,9 +134,9 @@ namespace GanjooRazor.Areas.Panel.Pages
LastError = "گذرواژهٔ جدید با گذرواژهٔ کنونی یکسان است."; LastError = "گذرواژهٔ جدید با گذرواژهٔ کنونی یکسان است.";
return Page(); return Page();
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var changePassResp = await secureClient.PostAsync($"{APIRoot.Url}/api/users/setmypassword", var changePassResp = await secureClient.PostAsync($"{APIRoot.Url}/api/users/setmypassword",
new StringContent(JsonConvert.SerializeObject new StringContent(JsonConvert.SerializeObject

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.LanguageEditModel @model DiwanRazor.Areas.User.Pages.LanguageEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "ویرایش زبان یا نویسش"; ViewData["Title"] = "ویرایش زبان یا نویسش";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@if (!string.IsNullOrEmpty(Model.LastMessage)) @if (!string.IsNullOrEmpty(Model.LastMessage))

View File

@ -1,19 +1,19 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Auth.Memory; using RMuseum.Models.Auth.Memory;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class LanguageEditModel : PageModel public class LanguageEditModel : PageModel
{ {
[BindProperty] [BindProperty]
public GanjoorLanguage Language { get; set; } public DiwanLanguage Language { get; set; }
public string LastMessage { get; set; } public string LastMessage { get; set; }
@ -23,16 +23,16 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastMessage = ""; LastMessage = "";
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.GanjoorEntityShortName}-{RMuseumSecurableItem.Translations}")) if (!ViewData.ContainsKey($"{RMuseumSecurableItem.DiwanEntityShortName}-{RMuseumSecurableItem.Translations}"))
{ {
LastMessage = "شما به این بخش دسترسی ندارید."; LastMessage = "شما به این بخش دسترسی ندارید.";
return Page(); return Page();
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages/{Request.Query["id"]}"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages/{Request.Query["id"]}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -41,7 +41,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
Language = JsonConvert.DeserializeObject<GanjoorLanguage>(await response.Content.ReadAsStringAsync()); Language = JsonConvert.DeserializeObject<DiwanLanguage>(await response.Content.ReadAsStringAsync());
} }
else else
@ -56,9 +56,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response); await DiwanSessionChecker.PrepareClient(secureClient, Request, Response);
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.LanguagesModel @model DiwanRazor.Areas.User.Pages.LanguagesModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "زبان‌ها و نویسش‌ها"; ViewData["Title"] = "زبان‌ها و نویسش‌ها";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,23 +1,23 @@
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using RMuseum.Models.Auth.Memory; using RMuseum.Models.Auth.Memory;
using RMuseum.Models.Ganjoor; using RMuseum.Models.Diwan;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class LanguagesModel : PageModel public class LanguagesModel : PageModel
{ {
public string LastMessage { get; set; } public string LastMessage { get; set; }
[BindProperty] [BindProperty]
public GanjoorLanguage Language { get; set; } public DiwanLanguage Language { get; set; }
public GanjoorLanguage[] Languages { get; set; } public DiwanLanguage[] Languages { get; set; }
public async Task<IActionResult> OnGetAsync() public async Task<IActionResult> OnGetAsync()
{ {
@ -25,16 +25,16 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastMessage = ""; LastMessage = "";
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.GanjoorEntityShortName}-{RMuseumSecurableItem.Translations}")) if (!ViewData.ContainsKey($"{RMuseumSecurableItem.DiwanEntityShortName}-{RMuseumSecurableItem.Translations}"))
{ {
LastMessage = "شما به این بخش دسترسی ندارید."; LastMessage = "شما به این بخش دسترسی ندارید.";
return Page(); return Page();
} }
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages"); HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -43,7 +43,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page(); return Page();
} }
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync()); Languages = JsonConvert.DeserializeObject<DiwanLanguage[]>(await response.Content.ReadAsStringAsync());
} }
else else
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPostAsync() public async Task<IActionResult> OnPostAsync()
{ {
LastMessage = ""; LastMessage = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json")); HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json"));
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
@ -86,9 +86,9 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteAsync(int id) public async Task<IActionResult> OnDeleteAsync(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/translations/languages/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/translations/languages/{id}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.MyBookmarksModel @model DiwanRazor.Areas.User.Pages.MyBookmarksModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "نشان‌شده‌های من"; ViewData["Title"] = "نشان‌شده‌های من";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
@ -79,7 +79,7 @@ else
@if (Model.Bookmarks.Count == 0) @if (Model.Bookmarks.Count == 0)
{ {
<partial name="_EmptyState" model="@("شما هنوز هیچ بیتی را نشان نکرده‌اید. برای آشنایی با نحوهٔ نشان کردن اشعار <a href=\"https://blog.ganjoor.net/1400/07/08/ganjoor-bookmarking/\" target=\"_blank\">اینجا</a> را ببینید.")" /> <partial name="_EmptyState" model="@("شما هنوز هیچ بیتی را نشان نکرده‌اید. برای آشنایی با نحوهٔ نشان کردن اشعار <a href=\"https://blog.ganjoor.net/1400/07/08/diwan-bookmarking/\" target=\"_blank\">اینجا</a> را ببینید.")" />
} }
else else
{ {
@ -105,7 +105,7 @@ else
{ {
<div> <div>
<span class="up-badge">یادداشت</span> <span class="up-badge">یادداشت</span>
<div id="note-text-@bookmark.Id" class="ganjoor-comment"> <div id="note-text-@bookmark.Id" class="diwan-comment">
@Html.Raw(bookmark.PrivateNote) @Html.Raw(bookmark.PrivateNote)
</div> </div>
</div> </div>

View File

@ -6,16 +6,16 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class MyBookmarksModel : PageModel public class MyBookmarksModel : PageModel
{ {
@ -29,7 +29,7 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary> /// </summary>
public List<NameIdUrlImage> PaginationLinks { get; set; } public List<NameIdUrlImage> PaginationLinks { get; set; }
public List<GanjoorUserBookmarkViewModel> Bookmarks { get; set; } public List<DiwanUserBookmarkViewModel> Bookmarks { get; set; }
public string Query { get; set; } public string Query { get; set; }
@ -41,8 +41,8 @@ namespace GanjooRazor.Areas.User.Pages
Query = Request.Query["w"]; Query = Request.Query["w"];
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
{ {
int pageNumber = 1; int pageNumber = 1;
@ -50,14 +50,14 @@ namespace GanjooRazor.Areas.User.Pages
{ {
pageNumber = int.Parse(Request.Query["page"]); pageNumber = int.Parse(Request.Query["page"]);
} }
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/bookmark/?PageNumber={pageNumber}&PageSize=20&q={Query}"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/bookmark/?PageNumber={pageNumber}&PageSize=20&q={Query}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Bookmarks = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorUserBookmarkViewModel>>(); Bookmarks = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DiwanUserBookmarkViewModel>>();
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))
@ -140,11 +140,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteBookmark(Guid id) public async Task<IActionResult> OnDeleteBookmark(Guid id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/bookmark/{id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/bookmark/{id}");
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
@ -161,11 +161,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPutBookmarkNote(Guid id, string note) public async Task<IActionResult> OnPutBookmarkNote(Guid id, string note)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/bookmark/{id}", new StringContent(JsonConvert.SerializeObject(note), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/bookmark/{id}", new StringContent(JsonConvert.SerializeObject(note), Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));

View File

@ -1,10 +1,10 @@
@page @page
@model GanjooRazor.Areas.User.Pages.MyCommentsModel @model DiwanRazor.Areas.User.Pages.MyCommentsModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "حاشیه‌های من"; ViewData["Title"] = "حاشیه‌های من";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -5,17 +5,17 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DNTPersianUtils.Core; using DNTPersianUtils.Core;
using GanjooRazor.Utils; using DiwanRazor.Utils;
using GSpotifyProxy.Models; using GSpotifyProxy.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Diwan.ViewModels;
using RSecurityBackend.Models.Auth.ViewModels; using RSecurityBackend.Models.Auth.ViewModels;
using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic;
namespace GanjooRazor.Areas.User.Pages namespace DiwanRazor.Areas.User.Pages
{ {
public class MyCommentsModel : PageModel public class MyCommentsModel : PageModel
{ {
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
/// <summary> /// <summary>
/// comments /// comments
/// </summary> /// </summary>
public List<GanjoorCommentFullViewModel> Comments { get; set; } public List<DiwanCommentFullViewModel> Comments { get; set; }
/// <summary> /// <summary>
/// pagination links /// pagination links
@ -50,8 +50,8 @@ namespace GanjooRazor.Areas.User.Pages
return Redirect("/"); return Redirect("/");
LastError = ""; LastError = "";
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
{ {
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Cookies["UserId"]}"); var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Cookies["UserId"]}");
@ -86,14 +86,14 @@ namespace GanjooRazor.Areas.User.Pages
{ {
pageNumber = int.Parse(Request.Query["page"]); pageNumber = int.Parse(Request.Query["page"]);
} }
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/comments/mine?PageNumber={pageNumber}&PageSize=20"); var response = await secureClient.GetAsync($"{APIRoot.Url}/api/diwan/comments/mine?PageNumber={pageNumber}&PageSize=20");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
{ {
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()); LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
return Page(); return Page();
} }
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCommentFullViewModel>>(); Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DiwanCommentFullViewModel>>();
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault(); string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
if (!string.IsNullOrEmpty(paginnationMetadata)) if (!string.IsNullOrEmpty(paginnationMetadata))
@ -177,11 +177,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnDeleteMyComment(int id) public async Task<IActionResult> OnDeleteMyComment(int id)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/comment?id={id}"); var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/diwan/comment?id={id}");
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
@ -198,11 +198,11 @@ namespace GanjooRazor.Areas.User.Pages
public async Task<IActionResult> OnPutMyComment(int id, string comment) public async Task<IActionResult> OnPutMyComment(int id, string comment)
{ {
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response))) using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response)))
{ {
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response)) if (await DiwanSessionChecker.PrepareClient(secureClient, Request, Response))
{ {
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/comment/{id}", new StringContent(JsonConvert.SerializeObject(comment), Encoding.UTF8, "application/json")); var response = await secureClient.PutAsync($"{APIRoot.Url}/api/diwan/comment/{id}", new StringContent(JsonConvert.SerializeObject(comment), Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK) if (response.StatusCode != HttpStatusCode.OK)
{ {
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync())); return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));

View File

@ -1,11 +1,11 @@
@page @page
@model GanjooRazor.Areas.User.Pages.MySessionsModel @model DiwanRazor.Areas.User.Pages.MySessionsModel
@using DNTPersianUtils.Core @using DNTPersianUtils.Core
@using System.Linq @using System.Linq
@{ @{
Layout = "_UserPanelLayout"; Layout = "_UserPanelLayout";
ViewData["Title"] = "نشست‌های من"; ViewData["Title"] = "نشست‌های من";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData); await DiwanRazor.Utils.DiwanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
} }
<div class="up-page-header"> <div class="up-page-header">
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

Some files were not shown because too many files have changed in this diff Show More