Rename Ganjoor -> Divan throughout the code
Projects (GanjooRazor -> DivanRazor, GanjoorService.sln -> DivanService.sln), files, folders, classes, namespaces, settings, API routes (/api/divan) and DB tables (Divan*). 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:
parent
8a981bf993
commit
532d005cdb
@ -1,7 +1,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
|
||||
namespace GanjooRazor
|
||||
namespace DivanRazor
|
||||
{
|
||||
/// <summary>
|
||||
/// API Root
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.BannersModel
|
||||
@model DivanRazor.Areas.Admin.Pages.BannersModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -46,7 +46,7 @@
|
||||
<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="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="@($"{DivanRazor.APIRoot.InternetUrl}/{banner.ImageUrl}")" alt="@banner.AlternateText" width="200" /></td>
|
||||
@if (banner.Active)
|
||||
{
|
||||
<td>فعال <input type="checkbox" name="active-@banner.Id" id="active-@banner.Id" checked /> </td>
|
||||
@ -1,16 +1,16 @@
|
||||
using GanjooRazor.Models;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Models;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class BannersModel : PageModel
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// banners
|
||||
/// </summary>
|
||||
public GanjoorSiteBannerViewModel[] Banners { get; set; }
|
||||
public DivanSiteBannerViewModel[] Banners { get; set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
@ -38,9 +38,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/banners");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -49,7 +49,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
Banners = JsonConvert.DeserializeObject<GanjoorSiteBannerViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
Banners = JsonConvert.DeserializeObject<DivanSiteBannerViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -69,11 +69,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPutEditAsync(int id, string alt, string url, bool active)
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
GanjoorSiteBannerModifyViewModel model = new GanjoorSiteBannerModifyViewModel()
|
||||
DivanSiteBannerModifyViewModel model = new DivanSiteBannerModifyViewModel()
|
||||
{
|
||||
AlternateText = alt,
|
||||
TargetUrl = url,
|
||||
@ -99,9 +99,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
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)
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
MultipartFormDataContent form = new MultipartFormDataContent();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.CatDelModel
|
||||
@model DivanRazor.Areas.Admin.Pages.CatDelModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,13 +1,13 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class CatDelModel : PageModel
|
||||
{
|
||||
@ -28,7 +28,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// category
|
||||
/// </summary>
|
||||
public GanjoorPoetCompleteViewModel Cat { get; set; }
|
||||
public DivanPoetCompleteViewModel Cat { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@ -42,26 +42,26 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastResult = "";
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Request.Query["id"]}");
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/cat/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
Cat = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorPoetCompleteViewModel>();
|
||||
Cat = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DivanPoetCompleteViewModel>();
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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/divan/cat/{Request.Query["id"]}");
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.CatTransModel
|
||||
@model DivanRazor.Areas.Admin.Pages.CatTransModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -3,17 +3,17 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class CatTransModel : PageModel
|
||||
{
|
||||
@ -25,7 +25,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// poems
|
||||
/// </summary>
|
||||
public GanjoorDuplicateViewModel[] Poems { get; set; }
|
||||
public DivanDuplicateViewModel[] Poems { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@ -47,11 +47,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return false;
|
||||
}
|
||||
CatId = int.Parse(Request.Query["id"]);
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/duplicates/{CatId}");
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/duplicates/{CatId}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -59,7 +59,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
Poems = JsonConvert.DeserializeObject<GanjoorDuplicateViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
Poems = JsonConvert.DeserializeObject<DivanDuplicateViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
if(!string.IsNullOrEmpty(Request.Query["empty"]))
|
||||
{
|
||||
@ -89,11 +89,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostFindDuplicatesAsync()
|
||||
{
|
||||
CatId = int.Parse(Request.Query["id"]);
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/duplicates/{CatId}/{DestCatId}?hardTry=true", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -116,11 +116,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostFinalizeAsync()
|
||||
{
|
||||
CatId = int.Parse(Request.Query["id"]);
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/duplicates/finish/{CatId}/{DestCatId}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -142,11 +142,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/duplicates/{id}");
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/duplicates/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.CatUtilsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.CatUtilsModel
|
||||
@using DNTPersianUtils.Core
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
@ -317,9 +317,9 @@
|
||||
@if (poem.MainSections.Length <= 1)
|
||||
{
|
||||
<td>
|
||||
@if(poem.MainSections.Length == 1 && @poem.MainSections[0].GanjoorMetre != null)
|
||||
@if(poem.MainSections.Length == 1 && @poem.MainSections[0].DivanMetre != null)
|
||||
{
|
||||
@poem.MainSections[0].GanjoorMetre.Rhythm
|
||||
@poem.MainSections[0].DivanMetre.Rhythm
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@ -352,9 +352,9 @@
|
||||
@s.Excerpt
|
||||
</td>
|
||||
<td>
|
||||
@if (s.GanjoorMetre != null)
|
||||
@if (s.DivanMetre != null)
|
||||
{
|
||||
@s.GanjoorMetre.Rhythm
|
||||
@s.DivanMetre.Rhythm
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@ -451,9 +451,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<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.Divan.DivanPoemFormat)))
|
||||
{
|
||||
<option value="@poemFormat">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option>
|
||||
<option value="@poemFormat">@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString((RMuseum.Models.Divan.DivanPoemFormat)poemFormat)</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
@ -1,20 +1,20 @@
|
||||
using GanjooRazor.Pages;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Pages;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class CatUtilsModel : GanjoorPageModelBase
|
||||
public class CatUtilsModel : DivanPageModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// constructor
|
||||
@ -28,21 +28,21 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// category
|
||||
/// </summary>
|
||||
public GanjoorPoetCompleteViewModel Cat { get; set; }
|
||||
public DivanPoetCompleteViewModel Cat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// cat page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorBatchNamingModel NamingModel { get; set; }
|
||||
public DivanBatchNamingModel NamingModel { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// rythm
|
||||
/// </summary>
|
||||
public GanjoorMetre[] Rhythms { get; set; }
|
||||
public DivanMetre[] Rhythms { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@ -58,18 +58,18 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// numbering patterns
|
||||
/// </summary>
|
||||
public GanjoorNumbering[] Numberings { get; set; }
|
||||
public DivanNumbering[] Numberings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// numbering model
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public GanjoorNumbering NumberingModel { get; set; }
|
||||
public DivanNumbering NumberingModel { get; set; }
|
||||
|
||||
public GanjoorLanguage[] Languages { get; set; }
|
||||
public DivanLanguage[] Languages { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorCatViewModel CatMeta { get; set; }
|
||||
public DivanCatViewModel CatMeta { get; set; }
|
||||
|
||||
public PoemRelatedImageEx[] PoemRelatedImages { get; set; }
|
||||
|
||||
@ -82,7 +82,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
Languages = JsonConvert.DeserializeObject<DivanLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
[BindProperty]
|
||||
@ -90,17 +90,17 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
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/divan/cat?url={Request.Query["url"]}&poems=true&mainSections=true");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(response);
|
||||
return false;
|
||||
}
|
||||
Cat = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
Cat = JsonConvert.DeserializeObject<DivanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
if (CatMeta == null)
|
||||
{
|
||||
CatMeta = new GanjoorCatViewModel()
|
||||
CatMeta = new DivanCatViewModel()
|
||||
{
|
||||
Id = Cat.Cat.Id,
|
||||
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/divan/page?url={Request.Query["url"]}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(pageQuery);
|
||||
return false;
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
var rhythmsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms");
|
||||
var rhythmsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms");
|
||||
if (!rhythmsResponse.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(rhythmsResponse);
|
||||
return false;
|
||||
}
|
||||
Rhythms = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmsResponse.Content.ReadAsStringAsync());
|
||||
Rhythms = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmsResponse.Content.ReadAsStringAsync());
|
||||
|
||||
var numberings = await _httpClient.GetAsync($"{APIRoot.Url}/api/numberings/cat/{Cat.Cat.Id}");
|
||||
if (!numberings.IsSuccessStatusCode)
|
||||
@ -132,11 +132,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
LastMessage = await ReadErrorMessageAsync(numberings);
|
||||
return false;
|
||||
}
|
||||
Numberings = JsonConvert.DeserializeObject<GanjoorNumbering[]>(await numberings.Content.ReadAsStringAsync());
|
||||
Numberings = JsonConvert.DeserializeObject<DivanNumbering[]>(await numberings.Content.ReadAsStringAsync());
|
||||
|
||||
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/divan/cat/{Cat.Cat.Id}/images");
|
||||
if (!images.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(images);
|
||||
@ -168,7 +168,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
await GetInformationAsync();
|
||||
|
||||
NamingModel = new GanjoorBatchNamingModel()
|
||||
NamingModel = new DivanBatchNamingModel()
|
||||
{
|
||||
StartWithNotIncludingSpaces = "شمارهٔ ",
|
||||
RemovePreviousPattern = true,
|
||||
@ -176,7 +176,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
Simulate = true
|
||||
};
|
||||
|
||||
NumberingModel = new GanjoorNumbering()
|
||||
NumberingModel = new DivanNumbering()
|
||||
{
|
||||
Name = Cat.Cat.Title,
|
||||
StartCatId = Cat.Cat.Id,
|
||||
@ -191,11 +191,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
/// <param name="NamingModel"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorBatchNamingModel NamingModel)
|
||||
public async Task<IActionResult> OnPostAsync(DivanBatchNamingModel NamingModel)
|
||||
{
|
||||
await GetInformationAsync();
|
||||
|
||||
NumberingModel = new GanjoorNumbering()
|
||||
NumberingModel = new DivanNumbering()
|
||||
{
|
||||
Name = Cat.Cat.Title,
|
||||
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
|
||||
// returning a bare error result, so this keeps its own client/session block instead of
|
||||
// going through WithSecureClientAsync (which is for AJAX-style handlers).
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
if (Request.Form["renameSubcats"].Count == 1)
|
||||
{
|
||||
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/divan/cat/recaptionpoems/{subCat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(response);
|
||||
@ -227,7 +227,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
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/divan/cat/recaptionpoems/{Cat.Cat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(response);
|
||||
@ -245,12 +245,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostNumberingAsync(GanjoorNumbering NumberingModel)
|
||||
public async Task<IActionResult> OnPostNumberingAsync(DivanNumbering NumberingModel)
|
||||
{
|
||||
// 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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/numberings", new StringContent(JsonConvert.SerializeObject(NumberingModel), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -261,7 +261,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
await GetInformationAsync();
|
||||
|
||||
NamingModel = new GanjoorBatchNamingModel()
|
||||
NamingModel = new DivanBatchNamingModel()
|
||||
{
|
||||
StartWithNotIncludingSpaces = "شمارهٔ ",
|
||||
RemovePreviousPattern = true,
|
||||
@ -289,7 +289,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/startassigningrhymes/{id}/{false}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -302,7 +302,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/subcats/startgentoc/{id}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -315,7 +315,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/startassigningrhythms/{id}/{false}?rhythm={rhythm}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -328,7 +328,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/{id}/regenrelatedsections", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -341,7 +341,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/language/{id}/{language}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -350,11 +350,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}, new OkObjectResult(false));
|
||||
}
|
||||
|
||||
public Task<IActionResult> OnPostSetCategoryPoemFormatAsync(int id, GanjoorPoemFormat format)
|
||||
public Task<IActionResult> OnPostSetCategoryPoemFormatAsync(int id, DivanPoemFormat format)
|
||||
{
|
||||
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/divan/cat/poemformat/{id}/{format}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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
|
||||
// its own client/session block rather than using WithSecureClientAsync.
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
MultipartFormDataContent form = new MultipartFormDataContent();
|
||||
|
||||
@ -407,7 +407,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
var fileContent = stream.ToArray();
|
||||
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/divan/sqlite/import/cat/{Cat.Cat.Id}", form);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(response);
|
||||
@ -426,7 +426,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
return WithSecureClientAsync(async secureClient =>
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/poem/{id}");
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/poem/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -439,7 +439,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/cat/reslugpoems/{id}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -448,16 +448,16 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}, new OkObjectResult(false));
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostUpdateCatMeta(GanjoorCatViewModel CatMeta)
|
||||
public async Task<IActionResult> OnPostUpdateCatMeta(DivanCatViewModel CatMeta)
|
||||
{
|
||||
await GetInformationAsync();
|
||||
|
||||
// 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
|
||||
// WithSecureClientAsync.
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
CatMeta.BookName ??= "";
|
||||
CatMeta.MapName ??= "";
|
||||
@ -478,7 +478,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
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/divan/cat/extra/{Cat.Cat.Id}", form);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = await ReadErrorMessageAsync(response);
|
||||
@ -497,7 +497,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
// consistent with the rest of this file via WithSecureClientAsync.
|
||||
return WithSecureClientAsync(async secureClient =>
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/naskban?naskbanUrl={url}");
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/naskban?naskbanUrl={url}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(await ReadErrorMessageAsync(response));
|
||||
@ -510,7 +510,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
return WithSecureClientAsync(async secureClient =>
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/source?sourceUrlSlug={tag}");
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/source?sourceUrlSlug={tag}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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/divan/source/{id}",
|
||||
new StringContent(JsonConvert.SerializeObject(source), Encoding.UTF8, "application/json")
|
||||
);
|
||||
if (!responsePost.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.DonationEditModel
|
||||
@model DivanRazor.Areas.Admin.Pages.DonationEditModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,13 +1,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Accounting.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class DonationEditModel : PageModel
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
var donation = JsonConvert.DeserializeObject<GanjoorDonationViewModel>(await response.Content.ReadAsStringAsync());
|
||||
var donation = JsonConvert.DeserializeObject<DivanDonationViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
Donation = new UpdateDateDescriptionViewModel()
|
||||
{
|
||||
@ -58,9 +58,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.DonationsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.DonationsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -4,14 +4,14 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Accounting.ViewModels;
|
||||
using RMuseum.Utils;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class DonationsModel : PageModel
|
||||
{
|
||||
@ -39,12 +39,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public string EmailContent { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorDonationViewModel Donation { get; set; }
|
||||
public DivanDonationViewModel Donation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// donations
|
||||
/// </summary>
|
||||
public GanjoorDonationViewModel[] Donations { get; set; }
|
||||
public DivanDonationViewModel[] Donations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// show account info
|
||||
@ -60,11 +60,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Donations = JsonConvert.DeserializeObject<GanjoorDonationViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
Donations = JsonConvert.DeserializeObject<DivanDonationViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible");
|
||||
if (!resAccountInfo.IsSuccessStatusCode)
|
||||
@ -87,7 +87,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
Donation = new GanjoorDonationViewModel()
|
||||
Donation = new DivanDonationViewModel()
|
||||
{
|
||||
RecordDate = DateTime.Now.Date,
|
||||
Unit = "تومان"
|
||||
@ -101,7 +101,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if(donation != null)
|
||||
{
|
||||
int rowNumber = Donations.Length - Array.IndexOf(Donations, donation);
|
||||
string donorName = GanjoorHtmlTools.StripHtmlTags(donation.DonorName);
|
||||
string donorName = DivanHtmlTools.StripHtmlTags(donation.DonorName);
|
||||
if(donorName.StartsWith("آقای"))
|
||||
{
|
||||
donorName = $"جناب {donorName}";
|
||||
@ -121,12 +121,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorDonationViewModel Donation)
|
||||
public async Task<IActionResult> OnPostAsync(DivanDonationViewModel Donation)
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
Donation.ImportedRecord = false;
|
||||
|
||||
@ -159,9 +159,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildPageAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null);
|
||||
if(!response.IsSuccessStatusCode)
|
||||
@ -176,9 +176,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.EarlierVersionModel
|
||||
@model DivanRazor.Areas.Admin.Pages.EarlierVersionModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,12 +1,12 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class EarlierVersionModel : PageModel
|
||||
{
|
||||
@ -19,7 +19,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// model
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public GanjoorModifyPageViewModel EarlierVersion { get; set; }
|
||||
public DivanModifyPageViewModel EarlierVersion { get; set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
@ -29,18 +29,18 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/oldversion/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
EarlierVersion = JsonConvert.DeserializeObject<GanjoorModifyPageViewModel>(await response.Content.ReadAsStringAsync());
|
||||
EarlierVersion = JsonConvert.DeserializeObject<DivanModifyPageViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.EditQuotedModel
|
||||
@model DivanRazor.Areas.Admin.Pages.EditQuotedModel
|
||||
@using DNTPersianUtils.Core
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
@ -122,11 +122,11 @@
|
||||
</p>
|
||||
|
||||
|
||||
@if (Model.GanjoorQuotedPoem != null && Model.Couplets != null)
|
||||
@if (Model.DivanQuotedPoem != null && Model.Couplets != null)
|
||||
{
|
||||
<script>
|
||||
|
||||
function selectGanjoorPage() {
|
||||
function selectDivanPage() {
|
||||
document.getElementById('display-frame').style.display = 'none';
|
||||
document.getElementById('select-poem').style.display = 'block';
|
||||
document.getElementById('finalize-select').style.display = 'block';
|
||||
@ -142,18 +142,18 @@
|
||||
|
||||
var url = currentUrl.substring(currentUrl.indexOf('/', currentUrl.indexOf('//') + 2));
|
||||
|
||||
fetch('@(GanjooRazor.APIRoot.InternetUrl)/api/ganjoor/page?url=' + url)
|
||||
fetch('@(DivanRazor.APIRoot.InternetUrl)/api/divan/page?url=' + url)
|
||||
.then((response) => response.json())
|
||||
.then((json) => {
|
||||
upToast(String(json.poem.id));
|
||||
document.getElementById('GanjoorQuotedPoem_RelatedPoemId').value = json.poem.id;
|
||||
document.getElementById('GanjoorQuotedPoem_RelatedPoetId').value = json.poem.category.poet.id;
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetName').value = json.poem.category.poet.nickname;
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri').value = json.poem.category.poet.deathYearInLHijri.toString();
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetUrl').value = json.poem.category.poet.fullUrl;
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemPoetImage').value = json.poem.category.poet.imageUrl;
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemFullTitle').value = json.poem.fullTitle;
|
||||
document.getElementById('GanjoorQuotedPoem_CachedRelatedPoemFullUrl').value = json.poem.fullUrl;
|
||||
document.getElementById('DivanQuotedPoem_RelatedPoemId').value = json.poem.id;
|
||||
document.getElementById('DivanQuotedPoem_RelatedPoetId').value = json.poem.category.poet.id;
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemPoetName').value = json.poem.category.poet.nickname;
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri').value = json.poem.category.poet.deathYearInLHijri.toString();
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemPoetUrl').value = json.poem.category.poet.fullUrl;
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemPoetImage').value = json.poem.category.poet.imageUrl;
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemFullTitle').value = json.poem.fullTitle;
|
||||
document.getElementById('DivanQuotedPoem_CachedRelatedPoemFullUrl').value = json.poem.fullUrl;
|
||||
|
||||
var coupletIndices = [];
|
||||
var coupletTexts = [];
|
||||
@ -170,7 +170,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var x = document.getElementById("GanjoorQuotedPoem_RelatedCoupletIndex");
|
||||
var x = document.getElementById("DivanQuotedPoem_RelatedCoupletIndex");
|
||||
x.length = 0;
|
||||
for (var i = 0; i < coupletIndices.length; i++) {
|
||||
var option = document.createElement("option");
|
||||
@ -232,15 +232,15 @@
|
||||
<form method="post" class="up-form">
|
||||
@Html.AntiForgeryToken()
|
||||
<p>
|
||||
بیت مرجع از <a href="/?p=@Model.GanjoorQuotedPoem.PoemId">شعر</a>:
|
||||
<input type="hidden" asp-for="GanjoorQuotedPoem.Id" />
|
||||
<input type="hidden" asp-for="GanjoorQuotedPoem.PoemId" />
|
||||
<input type="hidden" asp-for="GanjoorQuotedPoem.PoetId" />
|
||||
بیت مرجع از <a href="/?p=@Model.DivanQuotedPoem.PoemId">شعر</a>:
|
||||
<input type="hidden" asp-for="DivanQuotedPoem.Id" />
|
||||
<input type="hidden" asp-for="DivanQuotedPoem.PoemId" />
|
||||
<input type="hidden" asp-for="DivanQuotedPoem.PoetId" />
|
||||
</p>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_CoupletIndex">بیت</label>
|
||||
<select asp-for="GanjoorQuotedPoem.CoupletIndex">
|
||||
<label for="DivanQuotedPoem_CoupletIndex">بیت</label>
|
||||
<select asp-for="DivanQuotedPoem.CoupletIndex">
|
||||
@foreach (var item in Model.Couplets)
|
||||
{
|
||||
<option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option>
|
||||
@ -249,37 +249,37 @@
|
||||
</div>
|
||||
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.CoupletVerse1ShouldBeEmphasized" />
|
||||
<label for="GanjoorQuotedPoem_CoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
|
||||
<input asp-for="DivanQuotedPoem.CoupletVerse1ShouldBeEmphasized" />
|
||||
<label for="DivanQuotedPoem_CoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.CoupletVerse2ShouldBeEmphasized" />
|
||||
<label for="GanjoorQuotedPoem_CoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
|
||||
<input asp-for="DivanQuotedPoem.CoupletVerse2ShouldBeEmphasized" />
|
||||
<label for="DivanQuotedPoem_CoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_PoetId">شاعر مرجع</label>
|
||||
<input asp-for="GanjoorQuotedPoem.PoetId" />
|
||||
<label for="DivanQuotedPoem_PoetId">شاعر مرجع</label>
|
||||
<input asp-for="DivanQuotedPoem.PoetId" />
|
||||
</div>
|
||||
|
||||
<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="selectGanjoorPage()" class="up-btn up-btn--ghost" role="button" id="display-frame">🔎 گزینش شعر مرتبط</a>
|
||||
<a onclick="selectDivanPage()" class="up-btn up-btn--ghost" role="button" id="display-frame">🔎 گزینش شعر مرتبط</a>
|
||||
</div>
|
||||
<iframe id="select-poem" src="/" height="600" style="display:none;width:100%;margin:auto"></iframe>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_RelatedPoemId">شناسهٔ شعر مرتبط</label>
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedPoemId" />
|
||||
<label for="DivanQuotedPoem_RelatedPoemId">شناسهٔ شعر مرتبط</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedPoemId" />
|
||||
</div>
|
||||
@if (Model.GanjoorQuotedPoem.RelatedPoemId != null)
|
||||
@if (Model.DivanQuotedPoem.RelatedPoemId != null)
|
||||
{
|
||||
<p><a href="/?p=@Model.GanjoorQuotedPoem.RelatedPoemId">🔗 مشاهدهٔ شعر مرتبط</a></p>
|
||||
<p><a href="/?p=@Model.DivanQuotedPoem.RelatedPoemId">🔗 مشاهدهٔ شعر مرتبط</a></p>
|
||||
}
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_RelatedCoupletIndex">بیت مرتبط</label>
|
||||
<select asp-for="GanjoorQuotedPoem.RelatedCoupletIndex">
|
||||
<label for="DivanQuotedPoem_RelatedCoupletIndex">بیت مرتبط</label>
|
||||
<select asp-for="DivanQuotedPoem.RelatedCoupletIndex">
|
||||
@foreach (var item in Model.RelatedCouplets)
|
||||
{
|
||||
<option value="@item.Item1">@($"{(item.Item1 + 1).ToPersianNumbers()} - {item.Item2}")</option>
|
||||
@ -288,87 +288,87 @@
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_RelatedCoupletVerse1">مصرع اول مرتبط (خارج از دیوان)</label>
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse1" size="65" />
|
||||
<label for="DivanQuotedPoem_RelatedCoupletVerse1">مصرع اول مرتبط (خارج از دیوان)</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedCoupletVerse1" size="65" />
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized" />
|
||||
<label for="GanjoorQuotedPoem_RelatedCoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized" />
|
||||
<label for="DivanQuotedPoem_RelatedCoupletVerse1ShouldBeEmphasized">مصرع اول مهم است</label>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_RelatedCoupletVerse2">مصرع دوم مرتبط (خارج از دیوان)</label>
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse2" size="65" />
|
||||
<label for="DivanQuotedPoem_RelatedCoupletVerse2">مصرع دوم مرتبط (خارج از دیوان)</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedCoupletVerse2" size="65" />
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized" />
|
||||
<label for="GanjoorQuotedPoem_RelatedCoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized" />
|
||||
<label for="DivanQuotedPoem_RelatedCoupletVerse2ShouldBeEmphasized">مصرع دوم مهم است</label>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_SortOrder">ترتیب</label>
|
||||
<input asp-for="GanjoorQuotedPoem.SortOrder" />
|
||||
<label for="DivanQuotedPoem_SortOrder">ترتیب</label>
|
||||
<input asp-for="DivanQuotedPoem.SortOrder" />
|
||||
</div>
|
||||
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.IsPriorToRelated" />
|
||||
<label for="GanjoorQuotedPoem_IsPriorToRelated">این شعر قدیمیتر از شعر مرتبط است</label>
|
||||
<input asp-for="DivanQuotedPoem.IsPriorToRelated" />
|
||||
<label for="DivanQuotedPoem_IsPriorToRelated">این شعر قدیمیتر از شعر مرتبط است</label>
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.ChosenForMainList" />
|
||||
<label for="GanjoorQuotedPoem_ChosenForMainList">نمایش در فهرست اصلی</label>
|
||||
<input asp-for="DivanQuotedPoem.ChosenForMainList" />
|
||||
<label for="DivanQuotedPoem_ChosenForMainList">نمایش در فهرست اصلی</label>
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.IndirectQuotation" />
|
||||
<label for="GanjoorQuotedPoem_IndirectQuotation">مستقیماً ارتباط ندارد</label>
|
||||
<input asp-for="DivanQuotedPoem.IndirectQuotation" />
|
||||
<label for="DivanQuotedPoem_IndirectQuotation">مستقیماً ارتباط ندارد</label>
|
||||
</div>
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.ClaimedByBothPoets" />
|
||||
<label for="GanjoorQuotedPoem_ClaimedByBothPoets">منتسب به هر دو شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.ClaimedByBothPoets" />
|
||||
<label for="DivanQuotedPoem_ClaimedByBothPoets">منتسب به هر دو شاعر</label>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_RelatedPoetId">شاعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.RelatedPoetId" />
|
||||
<label for="DivanQuotedPoem_RelatedPoetId">شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.RelatedPoetId" />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetName">نام شاعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetName" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemPoetName">نام شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemPoetName" />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri">سالمرگ شاعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemPoetDeathYearInLHijri">سالمرگ شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri" />
|
||||
</div>
|
||||
<div class="up-field up-field--ltr">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetUrl">نشانی صفحهٔ شاعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetUrl" size="65" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemPoetUrl">نشانی صفحهٔ شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemPoetUrl" size="65" />
|
||||
</div>
|
||||
<div class="up-field up-field--ltr">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemPoetImage">تصویر شاعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemPoetImage" size="65" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemPoetImage">تصویر شاعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemPoetImage" size="65" />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemFullTitle">عنوان شعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemFullTitle" size="65" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemFullTitle">عنوان شعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemFullTitle" size="65" />
|
||||
</div>
|
||||
<div class="up-field up-field--ltr">
|
||||
<label for="GanjoorQuotedPoem_CachedRelatedPoemFullUrl">نشانی شعر</label>
|
||||
<input asp-for="GanjoorQuotedPoem.CachedRelatedPoemFullUrl" size="65" />
|
||||
<label for="DivanQuotedPoem_CachedRelatedPoemFullUrl">نشانی شعر</label>
|
||||
<input asp-for="DivanQuotedPoem.CachedRelatedPoemFullUrl" size="65" />
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_Note"><span class="up-field-icon" aria-hidden="true">🗒️</span> یادداشت</label>
|
||||
<textarea asp-for="GanjoorQuotedPoem.Note" rows="4" cols="80" class="editor"></textarea>
|
||||
<label for="DivanQuotedPoem_Note"><span class="up-field-icon" aria-hidden="true">🗒️</span> یادداشت</label>
|
||||
<textarea asp-for="DivanQuotedPoem.Note" rows="4" cols="80" class="editor"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="up-check-row">
|
||||
<input asp-for="GanjoorQuotedPoem.Published" />
|
||||
<label for="GanjoorQuotedPoem_Published">منتشر شده</label>
|
||||
<input asp-for="DivanQuotedPoem.Published" />
|
||||
<label for="DivanQuotedPoem_Published">منتشر شده</label>
|
||||
</div>
|
||||
|
||||
<div class="up-field">
|
||||
<label for="GanjoorQuotedPoem_SamePoemsQuotedCount">تعداد همسانها</label>
|
||||
<input asp-for="GanjoorQuotedPoem.SamePoemsQuotedCount" />
|
||||
<label for="DivanQuotedPoem_SamePoemsQuotedCount">تعداد همسانها</label>
|
||||
<input asp-for="DivanQuotedPoem.SamePoemsQuotedCount" />
|
||||
</div>
|
||||
|
||||
<div class="up-form-actions">
|
||||
@ -380,13 +380,13 @@
|
||||
<div class="up-btn-group">
|
||||
@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.DivanQuotedPoem.RelatedPoemId&id=@Model.ReverseId" class="up-btn up-btn--ghost">🔁 نمایش معکوس</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a role="button" onclick="reverseQuote('@Model.GanjoorQuotedPoem.Id')" class="up-btn up-btn--ghost" title="درج معکوس">🔁 درج معکوس</a>
|
||||
<a role="button" onclick="reverseQuote('@Model.DivanQuotedPoem.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.DivanQuotedPoem.Id')" class="up-btn up-btn--danger" title="حذف">🗑 حذف</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -2,18 +2,18 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using GanjooRazor.Utils;
|
||||
using RMuseum.Models.Divan;
|
||||
using DivanRazor.Utils;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class EditQuotedModel : PageModel
|
||||
{
|
||||
@ -33,23 +33,23 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public GanjoorPoemCompleteViewModel Poem { get; set; }
|
||||
public DivanPoemCompleteViewModel Poem { get; set; }
|
||||
|
||||
public GanjoorPoemCompleteViewModel RelatedPoem { get; set; }
|
||||
public DivanPoemCompleteViewModel RelatedPoem { get; set; }
|
||||
|
||||
public Tuple<int, string>[] Couplets { get; set; }
|
||||
|
||||
public Tuple<int, string>[] RelatedCouplets { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorQuotedPoemViewModel GanjoorQuotedPoem { get; set; }
|
||||
public DivanQuotedPoemViewModel DivanQuotedPoem { get; set; }
|
||||
|
||||
public GanjoorQuotedPoemViewModel[] AllPoemQuoteds { get; set; }
|
||||
public DivanQuotedPoemViewModel[] AllPoemQuoteds { get; set; }
|
||||
public Guid? ReverseId { get; set; }
|
||||
|
||||
public bool DisplayAll { get; set; }
|
||||
|
||||
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses)
|
||||
private Tuple<int, string>[] GetCouplets(DivanVerseViewModel[] verses)
|
||||
{
|
||||
int coupetIndex = -1;
|
||||
string coupletText = "";
|
||||
@ -108,13 +108,13 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
private async Task<string> Prepare(int poemId, string id)
|
||||
{
|
||||
LastMessage = "";
|
||||
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{poemId}");
|
||||
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{poemId}");
|
||||
if (!poemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>();
|
||||
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<DivanPoemCompleteViewModel>();
|
||||
|
||||
Couplets = GetCouplets(Poem.Verses);
|
||||
RelatedCouplets = [];
|
||||
@ -122,35 +122,35 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
|
||||
var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/quoted/{id}");
|
||||
var quoteQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/quoted/{id}");
|
||||
if (!quoteQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
GanjoorQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>();
|
||||
if (GanjoorQuotedPoem.RelatedPoemId != null)
|
||||
DivanQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<DivanQuotedPoemViewModel>();
|
||||
if (DivanQuotedPoem.RelatedPoemId != null)
|
||||
{
|
||||
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}");
|
||||
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{DivanQuotedPoem.RelatedPoemId}");
|
||||
if (!relPoemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>();
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DivanPoemCompleteViewModel>();
|
||||
|
||||
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/divan/poem/{DivanQuotedPoem.RelatedPoemId}/quoteds/{DivanQuotedPoem.PoemId}");
|
||||
if (!revQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await revQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
|
||||
var revs = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await revQuery.Content.ReadAsStringAsync());
|
||||
var rev = revs.Where(r => r.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex && r.RelatedCoupletIndex == GanjoorQuotedPoem.CoupletIndex).SingleOrDefault();
|
||||
var revs = JsonConvert.DeserializeObject<DivanQuotedPoemViewModel[]>(await revQuery.Content.ReadAsStringAsync());
|
||||
var rev = revs.Where(r => r.CoupletIndex == DivanQuotedPoem.RelatedCoupletIndex && r.RelatedCoupletIndex == DivanQuotedPoem.CoupletIndex).SingleOrDefault();
|
||||
if (rev != null)
|
||||
{
|
||||
ReverseId = rev.Id;
|
||||
@ -160,7 +160,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
GanjoorQuotedPoem = new GanjoorQuotedPoemViewModel()
|
||||
DivanQuotedPoem = new DivanQuotedPoemViewModel()
|
||||
{
|
||||
PoemId = poemId,
|
||||
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/divan/poem/{poemId}/quoteds");
|
||||
if (!allQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await allQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
AllPoemQuoteds = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
|
||||
AllPoemQuoteds = JsonConvert.DeserializeObject<DivanQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
|
||||
return LastMessage;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (!string.IsNullOrEmpty(Request.Query["all"]))
|
||||
{
|
||||
DisplayAll = true;
|
||||
string url = $"{APIRoot.Url}/api/ganjoor/quoted?published=false";
|
||||
string url = $"{APIRoot.Url}/api/divan/quoted?published=false";
|
||||
if (!string.IsNullOrEmpty(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());
|
||||
}
|
||||
AllPoemQuoteds = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
|
||||
AllPoemQuoteds = JsonConvert.DeserializeObject<DivanQuotedPoemViewModel[]>(await allQuery.Content.ReadAsStringAsync());
|
||||
|
||||
return Page();
|
||||
}
|
||||
@ -237,14 +237,14 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
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/divan/quoted/{Request.Query["id"]}");
|
||||
if (!quoteQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await quoteQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
GanjoorQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>();
|
||||
poemIdString = GanjoorQuotedPoem.PoemId.ToString();
|
||||
DivanQuotedPoem = JObject.Parse(await quoteQuery.Content.ReadAsStringAsync()).ToObject<DivanQuotedPoemViewModel>();
|
||||
poemIdString = DivanQuotedPoem.PoemId.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -261,39 +261,39 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorQuotedPoemViewModel GanjoorQuotedPoem)
|
||||
public async Task<IActionResult> OnPostAsync(DivanQuotedPoemViewModel DivanQuotedPoem)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
await Prepare(GanjoorQuotedPoem.PoemId, GanjoorQuotedPoem.Id == Guid.Empty ? null : GanjoorQuotedPoem.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;
|
||||
GanjoorQuotedPoem.CoupletVerse2 = Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).Count() < 2 ? "" : Poem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.CoupletIndex).ToArray()[1].Text;
|
||||
if (GanjoorQuotedPoem.RelatedPoemId != null && RelatedPoem == null)
|
||||
await Prepare(DivanQuotedPoem.PoemId, DivanQuotedPoem.Id == Guid.Empty ? null : DivanQuotedPoem.Id.ToString());
|
||||
DivanQuotedPoem.CoupletVerse1 = Poem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.CoupletIndex).Count() < 1 ? "" : Poem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.CoupletIndex).ToArray()[0].Text;
|
||||
DivanQuotedPoem.CoupletVerse2 = Poem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.CoupletIndex).Count() < 2 ? "" : Poem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.CoupletIndex).ToArray()[1].Text;
|
||||
if (DivanQuotedPoem.RelatedPoemId != null && RelatedPoem == null)
|
||||
{
|
||||
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}");
|
||||
var relPoemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{DivanQuotedPoem.RelatedPoemId}");
|
||||
if (!relPoemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>();
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DivanPoemCompleteViewModel>();
|
||||
|
||||
RelatedCouplets = GetCouplets(RelatedPoem.Verses);
|
||||
}
|
||||
|
||||
if (GanjoorQuotedPoem.RelatedCoupletIndex != null)
|
||||
if (DivanQuotedPoem.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;
|
||||
GanjoorQuotedPoem.RelatedCoupletVerse2 = RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).Count() < 2 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == GanjoorQuotedPoem.RelatedCoupletIndex).ToArray()[1].Text;
|
||||
DivanQuotedPoem.RelatedCoupletVerse1 = RelatedPoem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.RelatedCoupletIndex).Count() < 1 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.RelatedCoupletIndex).ToArray()[0].Text;
|
||||
DivanQuotedPoem.RelatedCoupletVerse2 = RelatedPoem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.RelatedCoupletIndex).Count() < 2 ? "" : RelatedPoem.Verses.Where(v => v.CoupletIndex == DivanQuotedPoem.RelatedCoupletIndex).ToArray()[1].Text;
|
||||
}
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var url = $"{APIRoot.Url}/api/ganjoor/quoted";
|
||||
var payload = new StringContent(JsonConvert.SerializeObject(GanjoorQuotedPoem), Encoding.UTF8, "application/json");
|
||||
bool newRecord = GanjoorQuotedPoem.Id == Guid.Empty;
|
||||
var url = $"{APIRoot.Url}/api/divan/quoted";
|
||||
var payload = new StringContent(JsonConvert.SerializeObject(DivanQuotedPoem), Encoding.UTF8, "application/json");
|
||||
bool newRecord = DivanQuotedPoem.Id == Guid.Empty;
|
||||
HttpResponseMessage response =
|
||||
newRecord ?
|
||||
await secureClient.PostAsync(url, payload) :
|
||||
@ -306,10 +306,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
if (newRecord)
|
||||
{
|
||||
GanjoorQuotedPoem = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>();
|
||||
DivanQuotedPoem = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DivanQuotedPoemViewModel>();
|
||||
}
|
||||
|
||||
LastMessage = $"انجام شد. <br /><a href=\"/Admin/EditQuoted/?p={GanjoorQuotedPoem.PoemId}&id={GanjoorQuotedPoem.Id}\">برگشت</a>";
|
||||
LastMessage = $"انجام شد. <br /><a href=\"/Admin/EditQuoted/?p={DivanQuotedPoem.PoemId}&id={DivanQuotedPoem.Id}\">برگشت</a>";
|
||||
|
||||
}
|
||||
}
|
||||
@ -329,11 +329,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(string id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/quoted?id={id}");
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/quoted?id={id}");
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
@ -351,22 +351,22 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
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/divan/quoted/{id}");
|
||||
if (!quoteQuery.IsSuccessStatusCode)
|
||||
{
|
||||
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<DivanQuotedPoemViewModel>();
|
||||
|
||||
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{quote.PoemId}");
|
||||
var poemQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{quote.PoemId}");
|
||||
if (!poemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await poemQuery.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<DivanPoemCompleteViewModel>();
|
||||
|
||||
GanjoorQuotedPoemViewModel reverseRelation = new GanjoorQuotedPoemViewModel()
|
||||
DivanQuotedPoemViewModel reverseRelation = new DivanQuotedPoemViewModel()
|
||||
{
|
||||
PoemId = (int)quote.RelatedPoemId,
|
||||
PoetId = (int)quote.RelatedPoetId,
|
||||
@ -377,7 +377,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
CachedRelatedPoemPoetDeathYearInLHijri = Poem.Category.Poet.DeathYearInLHijri,
|
||||
CachedRelatedPoemPoetName = Poem.Category.Poet.Nickname,
|
||||
CachedRelatedPoemPoetUrl = Poem.Category.Poet.FullUrl,
|
||||
CachedRelatedPoemPoetImage = $"/api/ganjoor/poet/image{Poem.Category.Poet.FullUrl}.gif",
|
||||
CachedRelatedPoemPoetImage = $"/api/divan/poet/image{Poem.Category.Poet.FullUrl}.gif",
|
||||
CachedRelatedPoemFullTitle = Poem.FullTitle,
|
||||
CachedRelatedPoemFullUrl = Poem.FullUrl,
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var url = $"{APIRoot.Url}/api/ganjoor/quoted";
|
||||
var url = $"{APIRoot.Url}/api/divan/quoted";
|
||||
var payload = new StringContent(JsonConvert.SerializeObject(reverseRelation), Encoding.UTF8, "application/json");
|
||||
|
||||
HttpResponseMessage response =
|
||||
@ -416,7 +416,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
reverseRelation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorQuotedPoemViewModel>();
|
||||
reverseRelation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DivanQuotedPoemViewModel>();
|
||||
return new JsonResult($"/Admin/EditQuoted/?p={reverseRelation.PoemId}&id={reverseRelation.Id}");
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ExamineUserModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ExamineUserModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,12 +1,12 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RSecurityBackend.Models.Auth.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ExamineUserModel : PageModel
|
||||
{
|
||||
@ -23,9 +23,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
return Redirect("/");
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}");
|
||||
if (userInfoResponse.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ExpenseEditModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ExpenseEditModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,14 +1,14 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Accounting;
|
||||
using RMuseum.Models.Accounting.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ExpenseEditModel : PageModel
|
||||
{
|
||||
@ -45,7 +45,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
var expense = JsonConvert.DeserializeObject<GanjoorExpense>(await response.Content.ReadAsStringAsync());
|
||||
var expense = JsonConvert.DeserializeObject<DivanExpense>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
Expense = new UpdateDateDescriptionViewModel()
|
||||
{
|
||||
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ExpensesModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ExpensesModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -2,13 +2,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Accounting;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ExpensesModel : PageModel
|
||||
{
|
||||
@ -30,12 +30,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public string LastMessage { get; set; }
|
||||
[BindProperty]
|
||||
public GanjoorExpense Expense { get; set; }
|
||||
public DivanExpense Expense { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// donations
|
||||
/// </summary>
|
||||
public GanjoorExpense[] Expenses { get; set; }
|
||||
public DivanExpense[] Expenses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// show account info
|
||||
@ -51,11 +51,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Expenses = JsonConvert.DeserializeObject<GanjoorExpense[]>(await response.Content.ReadAsStringAsync());
|
||||
Expenses = JsonConvert.DeserializeObject<DivanExpense[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage resAccountInfo = await secureClient.GetAsync($"{APIRoot.Url}/api/donations/accountinfo/visible");
|
||||
if (!resAccountInfo.IsSuccessStatusCode)
|
||||
@ -76,7 +76,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
Expense = new GanjoorExpense()
|
||||
Expense = new DivanExpense()
|
||||
{
|
||||
ExpenseDate = DateTime.Now.Date,
|
||||
Unit = "تومان",
|
||||
@ -85,12 +85,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorExpense Expense)
|
||||
public async Task<IActionResult> OnPostAsync(DivanExpense Expense)
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
|
||||
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()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/donations/page", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -130,9 +130,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/donations/expense/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.KickoutUserModel
|
||||
@model DivanRazor.Areas.Admin.Pages.KickoutUserModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -2,13 +2,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RSecurityBackend.Models.Auth.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class KickoutUserModel : PageModel
|
||||
{
|
||||
@ -27,9 +27,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
return Redirect("/");
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Query["id"]}");
|
||||
if (userInfoResponse.IsSuccessStatusCode)
|
||||
@ -58,9 +58,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/users/kickout", new StringContent(JsonConvert.SerializeObject(UserCauseViewModel), Encoding.UTF8, "application/json"));
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.LocationsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.LocationsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,28 +1,28 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class LocationsModel : PageModel
|
||||
{
|
||||
public string LastMessage { get; set; }
|
||||
public GanjoorGeoLocation[] Locations { get; set; }
|
||||
public DivanGeoLocation[] Locations { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorGeoLocation Location { get; set; }
|
||||
public DivanGeoLocation Location { get; set; }
|
||||
|
||||
private async Task ReadLocationsAsync()
|
||||
{
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -30,7 +30,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return;
|
||||
}
|
||||
Locations = JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await response.Content.ReadAsStringAsync());
|
||||
Locations = JsonConvert.DeserializeObject<DivanGeoLocation[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -50,12 +50,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorGeoLocation Location)
|
||||
public async Task<IActionResult> OnPostAsync(DivanGeoLocation Location)
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/locations", new StringContent(JsonConvert.SerializeObject(Location), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -77,9 +77,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
GanjoorGeoLocation model = new GanjoorGeoLocation()
|
||||
DivanGeoLocation model = new DivanGeoLocation()
|
||||
{
|
||||
Id = id,
|
||||
Name = name,
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.LongRunningJobsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.LongRunningJobsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RSecurityBackend.Models.Generic.Db;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class LongRunningJobsModel : PageModel
|
||||
{
|
||||
@ -22,9 +22,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/rjobs");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -41,9 +41,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostCleanupJobsAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs/cleanup");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -61,9 +61,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(Guid id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/rjobs?id={id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ModifyPageModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ModifyPageModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -59,7 +59,7 @@
|
||||
<textarea asp-for="ModifyModel.HtmlText" tabindex="4" rows="20"></textarea>
|
||||
</div>
|
||||
|
||||
@if (Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoemPage)
|
||||
@if (Model.PageInformation.DivanPageType == RMuseum.Models.Divan.DivanPageType.PoemPage)
|
||||
{
|
||||
<div class="up-field">
|
||||
<label>منبع</label>
|
||||
@ -101,7 +101,7 @@
|
||||
</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.DivanPageType == RMuseum.Models.Divan.DivanPageType.CatPage || Model.PageInformation.DivanPageType == RMuseum.Models.Divan.DivanPageType.PoetPage || Model.PageInformation.DivanPageType == RMuseum.Models.Divan.DivanPageType.PoemPage)
|
||||
{
|
||||
<div class="up-field">
|
||||
<label asp-for="ModifyModel.Published">منتشر شده (فعلا استفاده نشده)</label>
|
||||
@ -113,32 +113,32 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.CatPage || Model.PageInformation.GanjoorPageType == RMuseum.Models.Ganjoor.GanjoorPageType.PoetPage)
|
||||
@if (Model.PageInformation.DivanPageType == RMuseum.Models.Divan.DivanPageType.CatPage || Model.PageInformation.DivanPageType == RMuseum.Models.Divan.DivanPageType.PoetPage)
|
||||
{
|
||||
<div class="up-field">
|
||||
<label asp-for="ModifyModel.CatType">نوع بخش (فقط بخشها)</label>
|
||||
<select asp-for="ModifyModel.CatType">
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.Default">پیشفرض</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.Book">کتاب</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorCatType.BookPart">بخش</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanCatType.Default">پیشفرض</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanCatType.Book">کتاب</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanCatType.BookPart">بخش</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label asp-for="ModifyModel.TableOfContentsStyle">نحوهٔ فهرستگذاری بخش (فقط بخشها)</label>
|
||||
<select asp-for="ModifyModel.TableOfContentsStyle">
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.Analyse">بر اساس تحلیل بخش</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.OnlyTitles">فقط عناوین</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.Analyse">بر اساس تحلیل بخش</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.OnlyTitles">فقط عناوین</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
@ -183,21 +183,21 @@
|
||||
<form action="?Handler=GenerateCatPage&id=@Model.PageInformation.Id" method="post" class="up-form">
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="up-field">
|
||||
<label asp-for="GanjoorTOC">تولید فهرست</label>
|
||||
<select asp-for="GanjoorTOC">
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.Analyse">بر اساس تحلیل بخش</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.OnlyTitles">فقط عناوین</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Ganjoor.GanjoorTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
|
||||
<label asp-for="DivanTOC">تولید فهرست</label>
|
||||
<select asp-for="DivanTOC">
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.Analyse">بر اساس تحلیل بخش</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.OnlyTitles">فقط عناوین</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstVerse">عنوان و مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstVerse">الفبایی با مصرع اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithSecondVerse">الفبایی با مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstCouplet">الفبایی با بیت اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndSecondVerse">عنوان و مصرع دوم</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCouplet">عنوان و بیت اول</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCenteredVerse">عنوان و مصرع بند</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.TitlesAndFirstCenteredCouplet">عنوان و بیت بند</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstVerseNotSorted">الفبایی با مصرع اول - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithSecondVerseNotSorted">الفبایی با مصرع دوم - مرتب نشده</option>
|
||||
<option value="@RMuseum.Models.Divan.DivanTOC.AlphabeticWithFirstCoupletNotSorted">الفبایی با بیت اول - مرتب نشده</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="up-form-actions">
|
||||
@ -1,11 +1,11 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Auth.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -13,7 +13,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ModifyPageModel : PageModel
|
||||
{
|
||||
@ -39,23 +39,23 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// api model
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public GanjoorModifyPageViewModel ModifyModel { get; set; }
|
||||
public DivanModifyPageViewModel ModifyModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rythm
|
||||
/// </summary>
|
||||
public GanjoorMetre[] Rhythms { get; set; }
|
||||
public DivanMetre[] Rhythms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ganjoor toc
|
||||
/// divan toc
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public GanjoorTOC GanjoorTOC { get; set; }
|
||||
public DivanTOC DivanTOC { get; set; }
|
||||
/// <summary>
|
||||
/// last message
|
||||
/// </summary>
|
||||
@ -63,14 +63,14 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public string DefaultHtmlText { get; set; }
|
||||
|
||||
private static string _DefHtmlText(GanjoorVerseViewModel[] verses)
|
||||
private static string _DefHtmlText(DivanVerseViewModel[] verses)
|
||||
{
|
||||
string htmlText = "";
|
||||
int coupletIndex = 0;
|
||||
VersePosition position = VersePosition.Right;
|
||||
for (int vIndex = 0; vIndex < verses.Length; vIndex++)
|
||||
{
|
||||
GanjoorVerseViewModel v = verses[vIndex];
|
||||
DivanVerseViewModel v = verses[vIndex];
|
||||
if (position == VersePosition.Right)
|
||||
{
|
||||
coupletIndex++;
|
||||
@ -89,23 +89,23 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
private async Task<bool> PreparePage()
|
||||
{
|
||||
|
||||
var rhythmResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms");
|
||||
var rhythmResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return false;
|
||||
}
|
||||
|
||||
Rhythms = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
Rhythms = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
if (Request.Query["id"] == "0")
|
||||
{
|
||||
ModifyModel = new GanjoorModifyPageViewModel();
|
||||
PageInformation = new GanjoorPageCompleteViewModel();
|
||||
ModifyModel = new DivanModifyPageViewModel();
|
||||
PageInformation = new DivanPageCompleteViewModel();
|
||||
return true;
|
||||
}
|
||||
|
||||
var pageUrlResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Request.Query["id"]}");
|
||||
var pageUrlResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/pageurl?id={Request.Query["id"]}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return false;
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
if (PageInformation.Poem != null)
|
||||
{
|
||||
DefaultHtmlText = _DefHtmlText(PageInformation.Poem.Verses);
|
||||
}
|
||||
|
||||
ModifyModel = new GanjoorModifyPageViewModel()
|
||||
ModifyModel = new DivanModifyPageViewModel()
|
||||
{
|
||||
Title = PageInformation.Title,
|
||||
UrlSlug = PageInformation.UrlSlug,
|
||||
@ -140,14 +140,14 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
NoIndex = PageInformation.NoIndex,
|
||||
RedirectFromFullUrl = PageInformation.RedirectFromFullUrl,
|
||||
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,
|
||||
Published = PageInformation.Poem == null ? (PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Published : true) : PageInformation.Poem.Published,
|
||||
TableOfContentsStyle = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.TableOfContentsStyle : GanjoorTOC.Analyse,
|
||||
CatType = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.CatType : GanjoorCatType.Default,
|
||||
Description = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Description : "",
|
||||
DescriptionHtml = PageInformation.GanjoorPageType == GanjoorPageType.CatPage || PageInformation.GanjoorPageType == GanjoorPageType.PoetPage ? PageInformation.PoetOrCat.Cat.DescriptionHtml : ""
|
||||
MixedModeOrder = PageInformation.Poem == null ? (PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.MixedModeOrder : 0) : PageInformation.Poem.MixedModeOrder,
|
||||
Published = PageInformation.Poem == null ? (PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Published : true) : PageInformation.Poem.Published,
|
||||
TableOfContentsStyle = PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.TableOfContentsStyle : DivanTOC.Analyse,
|
||||
CatType = PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.CatType : DivanCatType.Default,
|
||||
Description = PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.Description : "",
|
||||
DescriptionHtml = PageInformation.DivanPageType == DivanPageType.CatPage || PageInformation.DivanPageType == DivanPageType.PoetPage ? PageInformation.PoetOrCat.Cat.DescriptionHtml : ""
|
||||
};
|
||||
GanjoorTOC = ModifyModel.TableOfContentsStyle;
|
||||
DivanTOC = ModifyModel.TableOfContentsStyle;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, "شناسهٔ صفحه مشخص نیست.");
|
||||
}
|
||||
GanjoorTOC = GanjoorTOC.Analyse;
|
||||
DivanTOC = DivanTOC.Analyse;
|
||||
await PreparePage();
|
||||
|
||||
return Page();
|
||||
@ -170,37 +170,37 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
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/divan/poem/analysisrhyme/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
}
|
||||
var rhyme = JsonConvert.DeserializeObject<GanjooRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
|
||||
var rhyme = JsonConvert.DeserializeObject<DivanRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
|
||||
return new OkObjectResult(rhyme.Rhyme);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorModifyPageViewModel ModifyModel)
|
||||
public async Task<IActionResult> OnPostAsync(DivanModifyPageViewModel ModifyModel)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
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/divan/page", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
else
|
||||
{
|
||||
var newPage = JsonConvert.DeserializeObject<GanjoorPage>(await response.Content.ReadAsStringAsync());
|
||||
var newPage = JsonConvert.DeserializeObject<DivanPage>(await response.Content.ReadAsStringAsync());
|
||||
return Redirect($"/Admin/ModifyPage?id={newPage.Id}&edit=true");
|
||||
}
|
||||
}
|
||||
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/divan/page/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(ModifyModel), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -220,12 +220,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostGenerateCatPageAsync(GanjoorTOC GanjoorTOC)
|
||||
public async Task<IActionResult> OnPostGenerateCatPageAsync(DivanTOC DivanTOC)
|
||||
{
|
||||
if (!(await PreparePage()))
|
||||
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/divan/cat?url={PageInformation.FullUrl}&poems=true");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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<DivanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
if (Request.Form["directInsert"].Count == 1)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/cat/toc/{Cat.Cat.Id}/{(int)DivanTOC}", null);
|
||||
if (!htmlRes.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync());
|
||||
@ -260,11 +260,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/cat/toc/{Cat.Cat.Id}/{(int)DivanTOC}");
|
||||
if (!htmlRes.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await htmlRes.Content.ReadAsStringAsync());
|
||||
@ -288,11 +288,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildSitemapAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sitemap", null);
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/sitemap", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -306,11 +306,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildStatsAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/rebuild/stats", null);
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/divan/rebuild/stats", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -328,11 +328,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnPostRegeneratePublicDataAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/publicdata/batchexport", null);
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/publicdata/batchexport", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -346,11 +346,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRefillSectionsCoupletCountsAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/fillsectioncoupletcounts", null);
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/fillsectioncoupletcounts", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -366,11 +366,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildRelatedPagesAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/quoted/pages/generate", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -383,11 +383,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildDigitalSourcesStatsAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/source/stats/rebuild", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/cache/{id}");
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/page/cache/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/wordcounts/rebuild/{poetId}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
LoginViewModel model = new LoginViewModel()
|
||||
{
|
||||
Username = username,
|
||||
Password = password,
|
||||
ClientAppName = "GanjooRazor",
|
||||
ClientAppName = "DivanRazor",
|
||||
Language = "ur-PK"
|
||||
};
|
||||
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/divan/naskban/import/poetbooks/{poetId}", stringContent);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/papersources/import/{poetId}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PageDelModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PageDelModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,13 +1,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class PageDelModel : PageModel
|
||||
{
|
||||
@ -28,7 +28,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@ -42,24 +42,24 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastResult = "";
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={Request.Query["url"]}");
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={Request.Query["url"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await response.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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/divan/page/cache/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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/divan/page/{Request.Query["id"]}");
|
||||
|
||||
if(!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PageHistoryModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PageHistoryModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
@ -1,12 +1,12 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class PageHistoryModel : PageModel
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public string LastMessage { get; set; }
|
||||
|
||||
public GanjoorPageSnapshotSummaryViewModel[] OlderVersions { get; set; }
|
||||
public DivanPageSnapshotSummaryViewModel[] OlderVersions { get; set; }
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
@ -23,18 +23,18 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/page/oldversions/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
OlderVersions = JsonConvert.DeserializeObject<GanjoorPageSnapshotSummaryViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
OlderVersions = JsonConvert.DeserializeObject<DivanPageSnapshotSummaryViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PoetModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PoetModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -105,7 +105,7 @@ else
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{Model.Poet.ImageUrl}")" alt="@Model.Poet.Name" />
|
||||
<img src="@($"{DivanRazor.APIRoot.InternetUrl}{Model.Poet.ImageUrl}")" alt="@Model.Poet.Name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -3,17 +3,17 @@ using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Services.Implementation.ImportedFromDesktopGanjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RMuseum.Services.Implementation.ImportedFromDesktopDivan;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class PoetModel : PageModel
|
||||
{
|
||||
@ -47,7 +47,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorPoetViewModel Poet { get; set; }
|
||||
public DivanPoetViewModel Poet { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public IFormFile Image { get; set; }
|
||||
@ -70,26 +70,26 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
private async Task<bool> PreparePoet()
|
||||
{
|
||||
await ReadLocationsAsync();
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poet/{Request.Query["id"]}");
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/divan/poet/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return false;
|
||||
}
|
||||
|
||||
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
var poet = JsonConvert.DeserializeObject<DivanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
Poet = poet.Poet;
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<GanjoorGeoLocation> Locations { get; set; }
|
||||
public List<DivanGeoLocation> Locations { get; set; }
|
||||
private async Task ReadLocationsAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -98,10 +98,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Locations = new List<GanjoorGeoLocation>();
|
||||
Locations = new List<DivanGeoLocation>();
|
||||
Locations.Add
|
||||
(
|
||||
new GanjoorGeoLocation()
|
||||
new DivanGeoLocation()
|
||||
{
|
||||
Id = 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<DivanGeoLocation[]>(await response.Content.ReadAsStringAsync()));
|
||||
|
||||
}
|
||||
else
|
||||
@ -131,7 +131,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (string.IsNullOrEmpty(Request.Query["id"]))
|
||||
{
|
||||
await ReadLocationsAsync();
|
||||
Poet = new GanjoorPoetViewModel()
|
||||
Poet = new DivanPoetViewModel()
|
||||
{
|
||||
Nickname = "",
|
||||
Name = "",
|
||||
@ -148,26 +148,26 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostEditPoetAsync(GanjoorPoetViewModel Poet)
|
||||
public async Task<IActionResult> OnPostEditPoetAsync(DivanPoetViewModel Poet)
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
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/divan/poet", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
var poet = JsonConvert.DeserializeObject<DivanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
var cacheKey1 = $"/api/ganjoor/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets))
|
||||
var cacheKey1 = $"/api/divan/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<DivanPoetViewModel> poets))
|
||||
{
|
||||
_memoryCache.Remove(cacheKey1);
|
||||
}
|
||||
@ -177,21 +177,21 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
}
|
||||
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/divan/poet/{Request.Query["id"]}", new StringContent(JsonConvert.SerializeObject(Poet), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
var cacheKey1 = $"/api/ganjoor/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets))
|
||||
var cacheKey1 = $"/api/divan/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<DivanPoetViewModel> poets))
|
||||
{
|
||||
_memoryCache.Remove(cacheKey1);
|
||||
}
|
||||
|
||||
var cacheKey2 = $"/api/ganjoor/poet/{Request.Query["id"]}";
|
||||
if (_memoryCache.TryGetValue(cacheKey2, out GanjoorPoetCompleteViewModel poet))
|
||||
var cacheKey2 = $"/api/divan/poet/{Request.Query["id"]}";
|
||||
if (_memoryCache.TryGetValue(cacheKey2, out DivanPoetCompleteViewModel poet))
|
||||
{
|
||||
_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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
MultipartFormDataContent form = new MultipartFormDataContent();
|
||||
|
||||
@ -227,7 +227,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
var fileContent = stream.ToArray();
|
||||
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/divan/poet/image/{Request.Query["id"]}", form);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
MultipartFormDataContent form = new MultipartFormDataContent();
|
||||
|
||||
@ -263,7 +263,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
var fileContent = stream.ToArray();
|
||||
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/divan/sqlite/import/{Request.Query["id"]}", form);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
MultipartFormDataContent form = new MultipartFormDataContent();
|
||||
|
||||
@ -299,7 +299,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
var fileContent = stream.ToArray();
|
||||
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/divan/sqlite/update/{Request.Query["id"]}?note={CorrecionDbModel.Note}", form);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -316,7 +316,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnGetDownloadSqliteDbAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
LastResult = "";
|
||||
if(false == await PreparePoet())
|
||||
@ -324,9 +324,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return BadRequest(LastResult);
|
||||
}
|
||||
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
var content = await secureClient.GetStreamAsync($"{APIRoot.Url}/api/ganjoor/sqlite/export/{id}");
|
||||
var content = await secureClient.GetStreamAsync($"{APIRoot.Url}/api/divan/sqlite/export/{id}");
|
||||
var contentType = "Application/octet-stream";
|
||||
var fileName = $"{GPersianTextSync.Farglisize(Poet.Name)}.gdb";
|
||||
return File(content, contentType, fileName);
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PoetDelModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PoetDelModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,14 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class PoetDelModel : PageModel
|
||||
{
|
||||
@ -39,11 +39,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public string LastResult { get; set; }
|
||||
|
||||
|
||||
public GanjoorPoetViewModel Poet { get; set; }
|
||||
public DivanPoetViewModel Poet { get; set; }
|
||||
|
||||
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/divan/poet/{Request.Query["id"]}");
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -51,7 +51,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return false;
|
||||
}
|
||||
|
||||
var poet = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
var poet = JsonConvert.DeserializeObject<DivanPoetCompleteViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
|
||||
Poet = poet.Poet;
|
||||
@ -72,25 +72,25 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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/divan/poet/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
var cacheKey1 = $"/api/ganjoor/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<GanjoorPoetViewModel> poets))
|
||||
var cacheKey1 = $"/api/divan/poets";
|
||||
if (_memoryCache.TryGetValue(cacheKey1, out List<DivanPoetViewModel> poets))
|
||||
{
|
||||
_memoryCache.Remove(cacheKey1);
|
||||
}
|
||||
|
||||
var cacheKey2 = $"/api/ganjoor/poet/{Request.Query["id"]}";
|
||||
if (_memoryCache.TryGetValue(cacheKey2, out GanjoorPoetCompleteViewModel poet))
|
||||
var cacheKey2 = $"/api/divan/poet/{Request.Query["id"]}";
|
||||
if (_memoryCache.TryGetValue(cacheKey2, out DivanPoetCompleteViewModel poet))
|
||||
{
|
||||
_memoryCache.Remove(cacheKey2);
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PoetsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PoetsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,16 +1,16 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class PoetsModel : PageModel
|
||||
{
|
||||
@ -22,16 +22,16 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// poets
|
||||
/// </summary>
|
||||
public GanjoorPoetViewModel[] Poets { get; set; }
|
||||
public DivanPoetViewModel[] Poets { get; set; }
|
||||
|
||||
public List<GanjoorGeoLocation> Locations { get; set; }
|
||||
public List<DivanGeoLocation> Locations { get; set; }
|
||||
private async Task ReadLocationsAsync()
|
||||
{
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -40,10 +40,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Locations = new List<GanjoorGeoLocation>();
|
||||
Locations = new List<DivanGeoLocation>();
|
||||
Locations.Add
|
||||
(
|
||||
new GanjoorGeoLocation()
|
||||
new DivanGeoLocation()
|
||||
{
|
||||
Id = 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<DivanGeoLocation[]>(await response.Content.ReadAsStringAsync()));
|
||||
|
||||
}
|
||||
else
|
||||
@ -70,11 +70,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
LastMessage = "";
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poets/secure");
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/poets/secure");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastMessage = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -83,7 +83,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
await ReadLocationsAsync();
|
||||
|
||||
Poets = JsonConvert.DeserializeObject<GanjoorPoetViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
Poets = JsonConvert.DeserializeObject<DivanPoetViewModel[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -98,11 +98,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostExportAllAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/sqlite/batchexport", null);
|
||||
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/sqlite/batchexport", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var poet = new GanjoorPoetViewModel()
|
||||
var poet = new DivanPoetViewModel()
|
||||
{
|
||||
Id = id,
|
||||
BirthYearInLHijri = birth,
|
||||
@ -131,14 +131,14 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
BirthPlace = birthlocation,
|
||||
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/divan/poet/{id}", new StringContent(JsonConvert.SerializeObject(poet), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
_memoryCache.Remove($"/api/ganjoor/poets");
|
||||
_memoryCache.Remove($"/api/ganjoor/poet/{id}");
|
||||
_memoryCache.Remove($"/api/divan/poets");
|
||||
_memoryCache.Remove($"/api/divan/poet/{id}");
|
||||
|
||||
return new OkObjectResult(true);
|
||||
|
||||
@ -151,11 +151,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostUpdatePeriodsAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/periods", null);
|
||||
var response = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/periods", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.PublicDataImportModel
|
||||
@model DivanRazor.Areas.Admin.Pages.PublicDataImportModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -81,7 +81,7 @@
|
||||
|
||||
<div>
|
||||
<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:\divan-public-data یا https://cdn.jsdelivr.net/gh/divan/divan-data@main/" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -6,10 +6,10 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// (Re)build local Ganjoor content from the public data export — local git clone or a URL
|
||||
/// (Re)build local Divan 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
|
||||
/// old per-poet SQLite import.
|
||||
/// </summary>
|
||||
@ -43,9 +43,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return BadRequest("مسیر یا نشانی نمیتواند خالی باشد.");
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var body = new
|
||||
{
|
||||
@ -56,7 +56,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
var response = await secureClient.PostAsync
|
||||
(
|
||||
$"{APIRoot.Url}/api/ganjoor/publicdata/import",
|
||||
$"{APIRoot.Url}/api/divan/publicdata/import",
|
||||
new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json")
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
@page
|
||||
@using DNTPersianUtils.Core
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewCatEditsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewCatEditsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -119,39 +119,39 @@
|
||||
|
||||
<div class="up-field">
|
||||
<label>نتیجهٔ بررسی</label>
|
||||
@if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.Result == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label>
|
||||
<input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="description_review_result_Approved" name="description_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="description_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)</label>
|
||||
<input type="radio" id="description_review_result_NotChanged" name="description_review_result" class="radio-notchanged" value="@RMuseum.Models.Divan.CorrectionReviewResult.NotChanged">
|
||||
<label for="description_review_result_NotChanged">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)</label>
|
||||
</div>
|
||||
}
|
||||
<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">
|
||||
<label for="description_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="description_review_result_RejectedBecauseWrong" name="description_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="description_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="description_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="description_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="description_review_result_Rejected" name="description_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="description_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<p class="up-hint up-hint--danger">دلیل را در یادداشت بررسی بنویسید.</p>
|
||||
</div>
|
||||
@ -1,28 +1,28 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
using System.Text;
|
||||
using System;
|
||||
using RMuseum.Utils;
|
||||
using System.Collections.Generic;
|
||||
using GanjooRazor.Models;
|
||||
using DivanRazor.Models;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ReviewCatEditsModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// correction
|
||||
/// </summary>
|
||||
public GanjoorCatCorrectionViewModel Correction { get; set; }
|
||||
public DivanCatCorrectionViewModel Correction { get; set; }
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
/// </summary>
|
||||
@ -46,7 +46,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
@ -55,11 +55,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FatalError = "";
|
||||
TotalCount = 0;
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/cat/correction/next?skip={Skip}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
|
||||
@ -71,25 +71,25 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
|
||||
}
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanCatCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
if (Correction != null)
|
||||
{
|
||||
var catQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Correction.CatId}");
|
||||
var catQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/cat/{Correction.CatId}");
|
||||
if (!catQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await catQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
var cat = JsonConvert.DeserializeObject<GanjoorPoetCompleteViewModel>(await catQuery.Content.ReadAsStringAsync());
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={cat.Cat.FullUrl}");
|
||||
var cat = JsonConvert.DeserializeObject<DivanPoetCompleteViewModel>(await catQuery.Content.ReadAsStringAsync());
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={cat.Cat.FullUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
Links = GanjoorHtmlTools.ExtractLinksWithRegex(Correction.DescriptionHtml);
|
||||
Links = DivanHtmlTools.ExtractLinksWithRegex(Correction.DescriptionHtml);
|
||||
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/cat/correction/{pms.correctionId}");
|
||||
if (!correctionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanCatCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
|
||||
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/divan/cat/correction/moderate",
|
||||
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
|
||||
));
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewEditsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewEditsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@using RMuseum.Models.Ganjoor
|
||||
@using RMuseum.Models.Divan
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
ViewData["Title"] = "بازبینی ویرایشها";
|
||||
@ -375,7 +375,7 @@ else
|
||||
|
||||
<tr>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseWrong)</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -447,38 +447,38 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (Model.Correction.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.Result == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="title_review_result_Approved" name="title_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="title_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="title_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="title_review_result_RejectedBecauseWrong" name="title_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="title_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="title_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="title_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="title_review_result_Rejected" name="title_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="title_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="title_review_note" name="title_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -520,38 +520,38 @@ else
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
@if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.RhythmResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="rhythm_review_result_Approved" name="rhythm_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="rhythm_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="rhythm_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="rhythm_review_result_RejectedBecauseWrong" name="rhythm_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="rhythm_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="rhythm_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="rhythm_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="rhythm_review_result_Rejected" name="rhythm_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="rhythm_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
@if (Model.Correction.Title != null)
|
||||
{
|
||||
@ -587,34 +587,34 @@ else
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="rhyme_review_result_Approved" name="rhyme_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="rhyme_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="rhyme_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="rhyme_review_result_RejectedBecauseWrong" name="rhyme_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="rhyme_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="rhyme_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="rhyme_review_result_RejectedBecauseVariant" name="rhyme_review_result" class="radio-variant" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="rhyme_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="title_review_note" name="title_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -658,34 +658,34 @@ else
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<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">
|
||||
<label for="rhythm2_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="rhythm2_review_result_Approved" name="rhythm2_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="rhythm2_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<br>
|
||||
@if (Model.Correction.Rhythm2Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.Rhythm2Result == RMuseum.Models.Divan.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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="rhythm2_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="rhythm2_review_result_RejectedBecauseWrong" name="rhythm2_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="rhythm2_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="rhythm2_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
|
||||
<label for="rhythm2_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="rhythm2_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="rhythm2_review_result_Rejected" name="rhythm2_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="rhythm2_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
@if (Model.Correction.Title != null)
|
||||
{
|
||||
@ -712,47 +712,47 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<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.DivanPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p>
|
||||
</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.DivanPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="poemformat_review_result_Approved" name="poemformat_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="poemformat_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="poemformat_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="poemformat_review_result_RejectedBecauseWrong" name="poemformat_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="poemformat_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="poemformat_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="poemformat_review_result_Rejected" name="poemformat_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="poemformat_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -791,81 +791,81 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (Model.Correction.SummaryReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.SummaryReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="poem-summary_review_result_Approved" name="poem-summary_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="poem-summary_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedBecauseWrong" name="poem-summary_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="poem-summary_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseInformal" name="poem-summary_review_result" class="radio-variant" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseInformal">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseArtificial" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseNotBetter" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
|
||||
<input type="radio" id="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution" name="poem-summary_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution">
|
||||
<label for="poem-summary_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="poem-summary_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="poem-summary_review_result_Rejected" name="poem-summary_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="poem-summary_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
|
||||
<input type="text" id="poem-summary_review_note" name="poem-summary_review_note" value="" size="50" />
|
||||
@ -932,13 +932,13 @@ else
|
||||
}
|
||||
else if (isPersonTag)
|
||||
{
|
||||
RMuseum.Models.Ganjoor.ViewModels.PersonGraphSuggestion personGraph = null;
|
||||
RMuseum.Models.Divan.ViewModels.PersonGraphSuggestion personGraph = null;
|
||||
string personGraphError = null;
|
||||
if (geoTag.PersonId == null && !string.IsNullOrEmpty(geoTag.SuggestedPersonGraphJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
personGraph = Newtonsoft.Json.JsonConvert.DeserializeObject<RMuseum.Models.Ganjoor.ViewModels.PersonGraphSuggestion>(geoTag.SuggestedPersonGraphJson);
|
||||
personGraph = Newtonsoft.Json.JsonConvert.DeserializeObject<RMuseum.Models.Divan.ViewModels.PersonGraphSuggestion>(geoTag.SuggestedPersonGraphJson);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -992,11 +992,11 @@ else
|
||||
{
|
||||
<p><small>خویشاوندان/وابستگان همراه این پیشنهاد:</small></p>
|
||||
<ul>
|
||||
@foreach (var relation in personGraph.Relations ?? new List<RMuseum.Models.Ganjoor.ViewModels.PersonGraphRelationEntry>())
|
||||
@foreach (var relation in personGraph.Relations ?? new List<RMuseum.Models.Divan.ViewModels.PersonGraphRelationEntry>())
|
||||
{
|
||||
var otherNode = personGraph.RelatedPeople.Where(p => p.LocalKey == (relation.Person1 == personGraph.Person.LocalKey ? relation.Person2 : relation.Person1)).FirstOrDefault();
|
||||
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<DivanRelatedPerson>()).Where(p => p.Id == otherNode.ExistingPersonId).Select(p => p.Name).FirstOrDefault() : otherNode.Name)
|
||||
: null;
|
||||
<li>
|
||||
<small>
|
||||
@ -1021,7 +1021,7 @@ else
|
||||
<label for="geotag@(geoIndex)_person_search">اتصال به نامبردۀ موجود در فهرست (در صورت وجود اشتباه در تشخیص نامبرده):</label>
|
||||
<div class="up-autocomplete-wrap">
|
||||
<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<DivanRelatedPerson>()).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)" />
|
||||
<div id="geotag@(geoIndex)_person_results" class="up-autocomplete-results" style="display:none;"></div>
|
||||
</div>
|
||||
@ -1094,7 +1094,7 @@ else
|
||||
<label for="geotag@(geoIndex)_location_search">اتصال به مکان موجود در فهرست (در صورت وجود اشتباه در تشخیص مکان):</label>
|
||||
<div class="up-autocomplete-wrap">
|
||||
<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<DivanGeoLocation>()).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)" />
|
||||
<div id="geotag@(geoIndex)_location_results" class="up-autocomplete-results" style="display:none;"></div>
|
||||
</div>
|
||||
@ -1155,20 +1155,20 @@ else
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<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">
|
||||
<label for="geotag@(geoIndex)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="geotag@(geoIndex)_review_result_Approved" name="geotag@(geoIndex)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="geotag@(geoIndex)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="geotag@(geoIndex)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="geotag@(geoIndex)_review_result_RejectedBecauseWrong" name="geotag@(geoIndex)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="geotag@(geoIndex)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
|
||||
<label for="geotag@(geoIndex)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="geotag@(geoIndex)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="geotag@(geoIndex)_review_result_Rejected" name="geotag@(geoIndex)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="geotag@(geoIndex)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="geotag@(geoIndex)_review_note" name="geotag@(geoIndex)_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -1226,42 +1226,42 @@ else
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (verse.NewVerseResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (verse.NewVerseResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -1285,45 +1285,45 @@ else
|
||||
@if (verse.OriginalVersePosition != null)
|
||||
{
|
||||
<text>
|
||||
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.OriginalVersePosition)</p>
|
||||
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Divan.VersePosition)verse.OriginalVersePosition)</p>
|
||||
</text>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.VersePosition)</p>
|
||||
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Divan.VersePosition)verse.VersePosition)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@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.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
}
|
||||
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.Divan.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.Divan.CorrectionReviewResult.Approved)</label>
|
||||
<br>
|
||||
@if (verse.VersePositionResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (verse.VersePositionResult == RMuseum.Models.Divan.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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-position@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="verse-position@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="verse-position@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="verse-position@(verse.VORder)_review_result_Rejected" name="verse-position@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="verse-position@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotSuggestedByUser">
|
||||
<label for="verse-position@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرمافزار دیوان</label>
|
||||
</div>
|
||||
</td>
|
||||
@ -1352,57 +1352,57 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (verse.Result == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (verse.Result == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Approved" name="verse@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="verse@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseVariant">مربوط به نسخهٔ دیگری است</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseUnnecessaryChange">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseOfAbusingPunctuations">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseOfAbusingPunctuations">از علائم سجاوندی به طور نامناسب استفاده شده است.</label>
|
||||
</div>
|
||||
|
||||
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseOfNonStandardCharcaters">
|
||||
<label for="verse@(verse.VORder)_review_result_RejectedBecauseOfNonStandardCharcaters">برای هٔ چسبان یا نویسههای دیگر از دستور خط فرهنگستان تبعیت نشده است.</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="verse@(verse.VORder)_review_result_Rejected" name="verse@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="verse@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<input type="text" id="verse@(verse.VORder)_review_note" name="verse@(verse.VORder)_review_note" value="" size="50" />
|
||||
</td>
|
||||
@ -1438,35 +1438,35 @@ else
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
@if (verse.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (verse.LanguageReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse-language@(verse.VORder)_review_result_Approved" name="verse-language@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
<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">
|
||||
<label for="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-language@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="verse-language@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
<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">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="verse-language@(verse.VORder)_review_result_Rejected" name="verse-language@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="verse-language@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotSuggestedByUser">
|
||||
<label for="verse-language@(verse.VORder)_review_result_NotSuggectedByUser">اشکال نرمافزار دیوان</label>
|
||||
</div>
|
||||
</td>
|
||||
@ -1500,81 +1500,81 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@if (verse.SummaryReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (verse.SummaryReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Approved)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Approved" name="verse-summary@(verse.VORder)_review_result" class="radio-approved" value="@RMuseum.Models.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Approved">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Approved)</label>
|
||||
</div>
|
||||
|
||||
<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.Divan.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.Divan.CorrectionReviewResult.NotChanged)</label><br>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong" name="verse-summary@(verse.VORder)_review_result" class="radio-notcorrect" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedBecauseWrong">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedBecauseWrong)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal" name="verse-summary@(verse.VORder)_review_result" class="radio-variant" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseInformal">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseInformal">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseInformal)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseArtificial">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseArtificial)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseUnfathomable">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseUnfathomable)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseContainsOwnIdeas">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseContainsOwnIdeas)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseHasServeralTypoErrors">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseHasServeralTypoErrors)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseNotBetter">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseNotBetter)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsNotAParaphrase">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsNotAParaphrase)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseItIsWordMeaningOrIncomplete">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseItIsWordMeaningOrIncomplete)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution" name="verse-summary@(verse.VORder)_review_result" class="radio-unnecessary" value="@RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_RejectedParaphraseBecauseFakeAttribution">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.RejectedParaphraseBecauseFakeAttribution)</label>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Ganjoor.CorrectionReviewResult.Rejected)</label>
|
||||
<input type="radio" id="verse-summary@(verse.VORder)_review_result_Rejected" name="verse-summary@(verse.VORder)_review_result" class="radio-rejected" value="@RMuseum.Models.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="verse-summary@(verse.VORder)_review_result_Rejected">@RMuseum.Services.Implementation.CorrectionReviewResultConvertor.GetString(RMuseum.Models.Divan.CorrectionReviewResult.Rejected)</label>
|
||||
</div>
|
||||
|
||||
<input type="text" id="verse-summary@(verse.VORder)_review_note" name="verse-summary@(verse.VORder)_review_note" value="" size="50" />
|
||||
@ -5,24 +5,24 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Models;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Models;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ReviewEditsModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// correction
|
||||
/// </summary>
|
||||
public GanjoorPoemCorrectionViewModel Correction { get; set; }
|
||||
public DivanPoemCorrectionViewModel Correction { get; set; }
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
/// </summary>
|
||||
@ -45,15 +45,15 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
public GanjoorMetre GanjoorMetre1 { get; set; }
|
||||
public DivanMetre DivanMetre1 { get; set; }
|
||||
|
||||
public GanjoorMetre GanjoorMetre2 { get; set; }
|
||||
public DivanMetre DivanMetre2 { get; set; }
|
||||
|
||||
public string RhymeLetters { get; set; }
|
||||
|
||||
public GanjoorLanguage[] Languages { get; set; }
|
||||
public DivanLanguage[] Languages { 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
|
||||
/// moderator can correct a mistyped/duplicate name by linking it to the existing entry instead
|
||||
/// </summary>
|
||||
public List<GanjoorGeoLocation> Locations { get; set; }
|
||||
public List<DivanGeoLocation> Locations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side for the
|
||||
@ -75,7 +75,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public string AllLocationsJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
(Locations ?? new List<GanjoorGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
|
||||
(Locations ?? new List<DivanGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
|
||||
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
|
||||
/// entry instead - same purpose as Locations above
|
||||
/// </summary>
|
||||
public List<GanjoorRelatedPerson> People { get; set; }
|
||||
public List<DivanRelatedPerson> People { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only), used
|
||||
@ -93,7 +93,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public string AllPeopleJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
(People ?? new List<GanjoorRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
|
||||
(People ?? new List<DivanRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
|
||||
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
|
||||
);
|
||||
|
||||
@ -103,7 +103,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
/// <param name="verses"></param>
|
||||
/// <returns></returns>
|
||||
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses)
|
||||
private Tuple<int, string>[] GetCouplets(DivanVerseViewModel[] verses)
|
||||
{
|
||||
int coupetIndex = -1;
|
||||
string coupletText = "";
|
||||
@ -157,7 +157,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
Languages = JsonConvert.DeserializeObject<DivanLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
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"]);
|
||||
OnlyUserCorrections = string.IsNullOrEmpty(Request.Query["onlyUserCorrections"]) ? true : bool.Parse(Request.Query["onlyUserCorrections"]);
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/poem/correction/next?skip={Skip}&onlyUserCorrections={OnlyUserCorrections}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
|
||||
@ -190,10 +190,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
await ReadLanguagesAsync(secureClient);
|
||||
|
||||
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanPoemCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
if(Correction != null)
|
||||
{
|
||||
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/pageurl?id={Correction.PoemId}");
|
||||
var pageUrlResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/pageurl?id={Correction.PoemId}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
Couplets = GetCouplets(PageInformation.Poem.Verses);
|
||||
|
||||
@ -219,9 +219,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await responseLocations.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
Locations = new List<GanjoorGeoLocation>();
|
||||
Locations.Add(new GanjoorGeoLocation() { Id = 0, Latitude = 0, Longitude = 0, Name = "" });
|
||||
Locations.AddRange(JsonConvert.DeserializeObject<GanjoorGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync()));
|
||||
Locations = new List<DivanGeoLocation>();
|
||||
Locations.Add(new DivanGeoLocation() { Id = 0, Latitude = 0, Longitude = 0, Name = "" });
|
||||
Locations.AddRange(JsonConvert.DeserializeObject<DivanGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync()));
|
||||
|
||||
var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people");
|
||||
if (!responsePeople.IsSuccessStatusCode)
|
||||
@ -229,9 +229,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await responsePeople.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
People = new List<GanjoorRelatedPerson>();
|
||||
People.Add(new GanjoorRelatedPerson() { Id = 0, Name = "" });
|
||||
People.AddRange(JsonConvert.DeserializeObject<GanjoorRelatedPerson[]>(await responsePeople.Content.ReadAsStringAsync()));
|
||||
People = new List<DivanRelatedPerson>();
|
||||
People.Add(new DivanRelatedPerson() { Id = 0, Name = "" });
|
||||
People.AddRange(JsonConvert.DeserializeObject<DivanRelatedPerson[]>(await responsePeople.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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.DivanMetre != null).Any())
|
||||
{
|
||||
GanjoorMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).First().GanjoorMetre;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Count() > 1)
|
||||
DivanMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).OrderBy(s => s.VerseType).First().DivanMetre;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).Count() > 1)
|
||||
{
|
||||
GanjoorMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).ToList()[1].GanjoorMetre;
|
||||
DivanMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).OrderBy(s => s.VerseType).ToList()[1].DivanMetre;
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,10 +298,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if (Correction.Rhythm != null)
|
||||
{
|
||||
GanjoorMetre originalMetre = null;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null && s.VerseType == VersePoemSectionType.First).Any())
|
||||
DivanMetre originalMetre = null;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != 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.DivanMetre != null).OrderBy(s => s.VerseType).First().DivanMetre;
|
||||
}
|
||||
Correction.OriginalRhythm = originalMetre == null ? null : originalMetre.Rhythm;
|
||||
if (Correction.OriginalRhythm == Correction.Rhythm)
|
||||
@ -310,10 +310,10 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if (Correction.Rhythm2 != null)
|
||||
{
|
||||
GanjoorMetre originalMetre2 = null;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null && s.VerseType == VersePoemSectionType.Second).Any())
|
||||
DivanMetre originalMetre2 = null;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != 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.DivanMetre != null && s.VerseType == VersePoemSectionType.Second).OrderBy(s => s.VerseType).First().DivanMetre;
|
||||
}
|
||||
Correction.OriginalRhythm2 = originalMetre2 == null ? null : originalMetre2.Rhythm;
|
||||
if (Correction.OriginalRhythm2 == Correction.Rhythm2)
|
||||
@ -345,17 +345,17 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/correction/{pms.correctionId}");
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/correction/{pms.correctionId}");
|
||||
if (!correctionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
|
||||
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/divan/correction/moderate",
|
||||
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
|
||||
// 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
|
||||
// unhandled exception here and surface as GanjooRazor's own generic HTML
|
||||
// unhandled exception here and surface as DivanRazor's own generic HTML
|
||||
// error page, which is unreadable and leaves the real error only in the
|
||||
// Windows Event Log.
|
||||
err = JsonConvert.DeserializeObject<string>(err);
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewPartEditsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewPartEditsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
@ -275,34 +275,34 @@ else
|
||||
<p class="green-color">@Model.Correction.Rhythm</p>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
@if (Model.Correction.RhythmResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.RhythmResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="rhythm_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
<label for="rhythm_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="rhythm_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged">
|
||||
<label for="rhythm_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="rhythm_review_result_RejectedBecauseWrong">درست نیست</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="rhythm_review_result_Rejected">به دلیل دیگری رد میشود</label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.RhymeLettersReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="rhyme_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
<label for="rhyme_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="rhyme_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged">
|
||||
<label for="rhyme_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="rhyme_review_result_RejectedBecauseWrong">درست نیست</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="rhyme_review_result_Rejected">به دلیل دیگری رد میشود</label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
@if (Model.Correction.LanguageReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.LanguageReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="language_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
<label for="language_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="language_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged">
|
||||
<label for="language_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="language_review_result_RejectedBecauseWrong">درست نیست</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="language_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="language_review_result_Rejected">به دلیل دیگری رد میشود</label>
|
||||
</div>
|
||||
<input type="text" id="language_review_note" name="language_review_note" value="" placeholder="یادداشت بررسی" />
|
||||
@ -414,45 +414,45 @@ else
|
||||
<h2 class="up-card__title">قالب شعری</h2>
|
||||
<div class="up-field">
|
||||
<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.DivanPoemFormatConvertor.GetString(Model.Correction.OriginalPoemFormat)</p>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<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.DivanPoemFormatConvertor.GetString(Model.Correction.PoemFormat)</p>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Ganjoor.CorrectionReviewResult.NotChanged)
|
||||
@if (Model.Correction.PoemFormatReviewResult == RMuseum.Models.Divan.CorrectionReviewResult.NotChanged)
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved">
|
||||
<label for="poemformat_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged" checked="checked">
|
||||
<label for="poemformat_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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.Divan.CorrectionReviewResult.Approved" checked="checked">
|
||||
<label for="poemformat_review_result_Approved">تأیید میشود</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.NotChanged">
|
||||
<label for="poemformat_review_result_NotChanged">تغییری نکرده</label>
|
||||
</div>
|
||||
}
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseWrong">
|
||||
<label for="poemformat_review_result_RejectedBecauseWrong">درست نیست</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.RejectedBecauseVariant">
|
||||
<label for="poemformat_review_result_RejectedBecauseUnnecessaryChange">تغییر سلیقهای یا بی دلیل است</label>
|
||||
</div>
|
||||
<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.Divan.CorrectionReviewResult.Rejected">
|
||||
<label for="poemformat_review_result_Rejected">به دلیل دیگری رد میشود</label>
|
||||
</div>
|
||||
<input type="text" id="poemformat_review_note" name="poemformat_review_note" value="" placeholder="یادداشت بررسی" />
|
||||
@ -3,24 +3,24 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ReviewPartEditsModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// correction
|
||||
/// </summary>
|
||||
public GanjoorPoemSectionCorrectionViewModel Correction { get; set; }
|
||||
public DivanPoemSectionCorrectionViewModel Correction { get; set; }
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
/// </summary>
|
||||
@ -46,32 +46,32 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// poem section
|
||||
/// </summary>
|
||||
public GanjoorPoemSection PoemSection { get; set; }
|
||||
public DivanPoemSection PoemSection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// verses
|
||||
/// </summary>
|
||||
public List<GanjoorVerseViewModel> Verses { get; set; }
|
||||
public List<DivanVerseViewModel> Verses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms alphabetically
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsAlphabetically { get; set; }
|
||||
public DivanMetre[] RhythmsAlphabetically { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms by frequency
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsByVerseCount { get; set; }
|
||||
public DivanMetre[] RhythmsByVerseCount { get; set; }
|
||||
|
||||
private List<GanjoorVerseViewModel> _FilterSectionVerses(GanjoorPoemSection section, GanjoorVerseViewModel[] verses)
|
||||
private List<DivanVerseViewModel> _FilterSectionVerses(DivanPoemSection section, DivanVerseViewModel[] verses)
|
||||
{
|
||||
List<GanjoorVerseViewModel> sectionVerses = new List<GanjoorVerseViewModel>();
|
||||
foreach (GanjoorVerseViewModel verse in verses)
|
||||
List<DivanVerseViewModel> sectionVerses = new List<DivanVerseViewModel>();
|
||||
foreach (DivanVerseViewModel verse in verses)
|
||||
{
|
||||
switch (section.VerseType)
|
||||
{
|
||||
@ -106,11 +106,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = 0;
|
||||
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
|
||||
DeletedUserSections = string.IsNullOrEmpty(Request.Query["deletedUserSections"]) ? false : bool.Parse(Request.Query["deletedUserSections"]);
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/section/correction/next?skip={Skip}&deletedUserSections={DeletedUserSections}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
|
||||
@ -122,18 +122,18 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
|
||||
}
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanPoemSectionCorrectionViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
if (Correction != null)
|
||||
{
|
||||
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/{Correction.SectionId}");
|
||||
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/section/{Correction.SectionId}");
|
||||
if (!sectionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PoemSection = JsonConvert.DeserializeObject<GanjoorPoemSection>(await sectionResponse.Content.ReadAsStringAsync());
|
||||
PoemSection = JsonConvert.DeserializeObject<DivanPoemSection>(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/divan/pageurl?id={PoemSection.PoemId}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any())
|
||||
{
|
||||
@ -156,7 +156,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if (Correction.Rhythm != null)
|
||||
{
|
||||
Correction.OriginalRhythm = PoemSection.GanjoorMetre == null ? null : PoemSection.GanjoorMetre.Rhythm;
|
||||
Correction.OriginalRhythm = PoemSection.DivanMetre == null ? null : PoemSection.DivanMetre.Rhythm;
|
||||
if (Correction.OriginalRhythm == Correction.Rhythm)
|
||||
Correction.RhythmResult = CorrectionReviewResult.NotChanged;
|
||||
}
|
||||
@ -166,23 +166,23 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if (DeletedUserSections)
|
||||
{
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true");
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms?sortOnVerseCount=true");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount);
|
||||
List<DivanMetre> rhythmsByVerseCount = new List<DivanMetre>(RhythmsByVerseCount);
|
||||
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = "null"
|
||||
}
|
||||
);
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = ""
|
||||
}
|
||||
@ -222,17 +222,17 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
string poemformatReviewNote,
|
||||
string reviewNote)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/{correctionId}");
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/section/correction/{correctionId}");
|
||||
if (!correctionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
|
||||
int? breakFromVerse1VOrder = null;
|
||||
int? breakFromVerse2VOrder = null;
|
||||
@ -247,15 +247,15 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if (breakFromVIndices.Length > 0)
|
||||
{
|
||||
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/{Correction.SectionId}");
|
||||
var sectionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/section/{Correction.SectionId}");
|
||||
if (!sectionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await sectionResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PoemSection = JsonConvert.DeserializeObject<GanjoorPoemSection>(await sectionResponse.Content.ReadAsStringAsync());
|
||||
PoemSection = JsonConvert.DeserializeObject<DivanPoemSection>(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/divan/pageurl?id={PoemSection.PoemId}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
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/divan/section/moderate",
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/section/correction/{correctionId}");
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/section/correction/{correctionId}");
|
||||
if (!correctionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
|
||||
}
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanPoemSectionCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
Correction.RhythmResult = CorrectionReviewResult.Rejected;
|
||||
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/section/moderate",
|
||||
var moderationResponse = await secureClient.PostAsync($"{APIRoot.Url}/api/divan/section/moderate",
|
||||
new StringContent(JsonConvert.SerializeObject(Correction), Encoding.UTF8, "application/json"
|
||||
));
|
||||
if (!moderationResponse.IsSuccessStatusCode)
|
||||
@ -450,14 +450,14 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
if(!string.IsNullOrEmpty(rhythm))
|
||||
{
|
||||
GanjoorPoemSectionCorrectionViewModel correction = new GanjoorPoemSectionCorrectionViewModel()
|
||||
DivanPoemSectionCorrectionViewModel correction = new DivanPoemSectionCorrectionViewModel()
|
||||
{
|
||||
SectionId = sectionId,
|
||||
Rhythm = rhythm,
|
||||
};
|
||||
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/section/correction",
|
||||
$"{APIRoot.Url}/api/divan/section/correction",
|
||||
new StringContent(JsonConvert.SerializeObject(correction),
|
||||
Encoding.UTF8,
|
||||
"application/json"));
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewPersonEditsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewPersonEditsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
@ -4,18 +4,18 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// moderator review queue for pending GanjoorPersonEditSuggestion entries - counterpart of
|
||||
/// moderator review queue for pending DivanPersonEditSuggestion entries - counterpart of
|
||||
/// ReviewEdits.cshtml for poem corrections, but much simpler: one suggestion, one overall
|
||||
/// Result, no per-field branching.
|
||||
/// </summary>
|
||||
@ -24,7 +24,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// the pending suggestion currently shown
|
||||
/// </summary>
|
||||
public GanjoorPersonEditSuggestion Suggestion { get; set; }
|
||||
public DivanPersonEditSuggestion Suggestion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
@ -46,7 +46,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// DeathLocationId into names for the before/after diff (the suggestion's own Suggested*
|
||||
/// locations already arrive populated via the backend's Include)
|
||||
/// </summary>
|
||||
public List<GanjoorGeoLocation> Locations { get; set; }
|
||||
public List<DivanGeoLocation> Locations { get; set; }
|
||||
|
||||
public string LocationName(int? id)
|
||||
{
|
||||
@ -101,9 +101,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = 0;
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var locationsResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/locations");
|
||||
if (!locationsResponse.IsSuccessStatusCode)
|
||||
@ -111,7 +111,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await locationsResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
Locations = JsonConvert.DeserializeObject<List<GanjoorGeoLocation>>(await locationsResponse.Content.ReadAsStringAsync());
|
||||
Locations = JsonConvert.DeserializeObject<List<DivanGeoLocation>>(await locationsResponse.Content.ReadAsStringAsync());
|
||||
|
||||
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/editsuggestions/next?skip={Skip}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
@ -126,7 +126,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount;
|
||||
}
|
||||
|
||||
Suggestion = JsonConvert.DeserializeObject<GanjoorPersonEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
|
||||
Suggestion = JsonConvert.DeserializeObject<DivanPersonEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
|
||||
|
||||
return Page();
|
||||
}
|
||||
@ -147,9 +147,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید.");
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var moderation = new PersonEditSuggestionModerationViewModel()
|
||||
{
|
||||
@ -1,8 +1,8 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewPersonRelationEditsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewPersonRelationEditsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@using RMuseum.Models.Ganjoor
|
||||
@using RMuseum.Models.Divan
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
ViewData["Title"] = "بازبینی پیشنهادهای نسبتهای خویشاوندی";
|
||||
@ -3,18 +3,18 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// moderator review queue for pending GanjoorPersonRelationEditSuggestion entries - counterpart
|
||||
/// moderator review queue for pending DivanPersonRelationEditSuggestion entries - counterpart
|
||||
/// of ReviewPersonEdits.cshtml, but for kinship edges (Add/Modify/Remove) rather than a person's
|
||||
/// own fields.
|
||||
/// </summary>
|
||||
@ -23,7 +23,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// <summary>
|
||||
/// the pending suggestion currently shown
|
||||
/// </summary>
|
||||
public GanjoorPersonRelationEditSuggestion Suggestion { get; set; }
|
||||
public DivanPersonRelationEditSuggestion Suggestion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = 0;
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var nextResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/people/relationeditsuggestions/next?skip={Skip}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
@ -76,7 +76,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginationMetadata).totalCount;
|
||||
}
|
||||
|
||||
Suggestion = JsonConvert.DeserializeObject<GanjoorPersonRelationEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
|
||||
Suggestion = JsonConvert.DeserializeObject<DivanPersonRelationEditSuggestion>(await nextResponse.Content.ReadAsStringAsync());
|
||||
|
||||
return Page();
|
||||
}
|
||||
@ -97,9 +97,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return new BadRequestObjectResult("لطفاً تکلیف بررسی این پیشنهاد را مشخص کنید.");
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var moderation = new PersonEditSuggestionModerationViewModel()
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
@page
|
||||
@using DNTPersianUtils.Core
|
||||
@model GanjooRazor.Areas.Admin.Pages.ReviewQuotedsModel
|
||||
@model DivanRazor.Areas.Admin.Pages.ReviewQuotedsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -14,7 +14,7 @@
|
||||
{
|
||||
<div class="up-alert up-alert--danger">@Model.FatalError</div>
|
||||
}
|
||||
else if (Model.GanjoorQuotedPoem == null)
|
||||
else if (Model.DivanQuotedPoem == null)
|
||||
{
|
||||
<partial name="_EmptyState" model="@("پیشنهادی وجود ندارد.")" />
|
||||
}
|
||||
@ -24,7 +24,7 @@ else
|
||||
<p class="up-hint">تعداد کل: @Model.TotalCount</p>
|
||||
<div class="up-field">
|
||||
<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.DivanQuotedPoem.SuggestedById" target="_blank">@Model.SuggestedBy.NickName</a></div>
|
||||
</div>
|
||||
|
||||
<form method="post" class="up-form">
|
||||
@ -46,38 +46,38 @@ else
|
||||
</div>
|
||||
|
||||
<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.DivanQuotedPoem.PoemId">شعر</a></h2>
|
||||
|
||||
@if (Model.GanjoorQuotedPoem.CoupletIndex != null && Model.GanjoorQuotedPoem.CoupletIndex != -1)
|
||||
@if (Model.DivanQuotedPoem.CoupletIndex != null && Model.DivanQuotedPoem.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.DivanQuotedPoem.CoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.Couplets[(int)Model.DivanQuotedPoem.CoupletIndex].Item2}")</p>
|
||||
}
|
||||
|
||||
<div class="up-field">
|
||||
<label>مصرع اول مهم است</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.CoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.CoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>مصرع دوم مهم است</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.CoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.CoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>شاعر مرجع</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.PoetId</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.PoetId</div>
|
||||
</div>
|
||||
|
||||
@if (Model.GanjoorQuotedPoem.RelatedPoemId != null)
|
||||
@if (Model.DivanQuotedPoem.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.DivanQuotedPoem.RelatedPoemId" class="up-btn up-btn--ghost up-btn--sm">مشاهدهٔ شعر مرتبط</a></p>
|
||||
}
|
||||
|
||||
<div class="up-field">
|
||||
<label>بیت مرتبط</label>
|
||||
@if (Model.GanjoorQuotedPoem.RelatedCoupletIndex != null && Model.GanjoorQuotedPoem.RelatedCoupletIndex != -1)
|
||||
@if (Model.DivanQuotedPoem.RelatedCoupletIndex != null && Model.DivanQuotedPoem.RelatedCoupletIndex != -1)
|
||||
{
|
||||
if (Model.GanjoorQuotedPoem.RelatedCoupletIndex < Model.RelatedCouplets.Length)
|
||||
if (Model.DivanQuotedPoem.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.DivanQuotedPoem.RelatedCoupletIndex].Item1 + 1).ToPersianNumbers()} - {Model.RelatedCouplets[(int)Model.DivanQuotedPoem.RelatedCoupletIndex].Item2}")</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -88,59 +88,59 @@ else
|
||||
|
||||
<div class="up-field">
|
||||
<label>مصرع اول مرتبط (خارج از دیوان)</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedCoupletVerse1</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.RelatedCoupletVerse1</div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>مصرع اول مهم است</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.RelatedCoupletVerse1ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>مصرع دوم مرتبط (خارج از دیوان)</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedCoupletVerse2</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.RelatedCoupletVerse2</div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>مصرع دوم مهم است</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.RelatedCoupletVerse2ShouldBeEmphasized ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>ترتیب</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.SortOrder</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.SortOrder</div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>این شعر قدیمیتر از شعر مرتبط است</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.IsPriorToRelated ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.IsPriorToRelated ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>منتسب به هر دو شاعر</label>
|
||||
<input type="checkbox" disabled @(Model.GanjoorQuotedPoem.ClaimedByBothPoets ? "checked=\"checked\"" : "") />
|
||||
<input type="checkbox" disabled @(Model.DivanQuotedPoem.ClaimedByBothPoets ? "checked=\"checked\"" : "") />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>شاعر</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.RelatedPoetId - @Model.GanjoorQuotedPoem.CachedRelatedPoemPoetName</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.RelatedPoetId - @Model.DivanQuotedPoem.CachedRelatedPoemPoetName</div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>سالمرگ شاعر</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.CachedRelatedPoemPoetDeathYearInLHijri</div>
|
||||
</div>
|
||||
<div class="up-field up-field--ltr">
|
||||
<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.DivanQuotedPoem.CachedRelatedPoemPoetUrl">@Model.DivanQuotedPoem.CachedRelatedPoemPoetUrl</a></div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>تصویر شاعر</label>
|
||||
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{Model.GanjoorQuotedPoem.CachedRelatedPoemPoetImage}")" style="max-width:200px;" />
|
||||
<img src="@($"{DivanRazor.APIRoot.InternetUrl}{Model.DivanQuotedPoem.CachedRelatedPoemPoetImage}")" style="max-width:200px;" />
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>عنوان شعر</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.CachedRelatedPoemFullTitle</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.CachedRelatedPoemFullTitle</div>
|
||||
</div>
|
||||
<div class="up-field up-field--ltr">
|
||||
<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.DivanQuotedPoem.CachedRelatedPoemFullUrl">@Model.DivanQuotedPoem.CachedRelatedPoemFullUrl</a></div>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label>یادداشت</label>
|
||||
<div class="up-field-static">@Model.GanjoorQuotedPoem.Note</div>
|
||||
<div class="up-field-static">@Model.DivanQuotedPoem.Note</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@ -1,20 +1,20 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text;
|
||||
using RMuseum.Models.Auth.ViewModel;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class ReviewQuotedsModel : PageModel
|
||||
{
|
||||
@ -22,12 +22,12 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// moderation model
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public GanjoorQuotedPoemModerationViewModel ModerationModel { get; set; }
|
||||
public DivanQuotedPoemModerationViewModel ModerationModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// suggestion
|
||||
/// </summary>
|
||||
public GanjoorQuotedPoemViewModel GanjoorQuotedPoem { get; set; }
|
||||
public DivanQuotedPoemViewModel DivanQuotedPoem { get; set; }
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
/// </summary>
|
||||
@ -47,13 +47,13 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
public Tuple<int, string>[] RelatedCouplets { get; set; }
|
||||
|
||||
public GanjoorPoemCompleteViewModel Poem { get; set; }
|
||||
public DivanPoemCompleteViewModel Poem { get; set; }
|
||||
|
||||
public GanjoorPoemCompleteViewModel RelatedPoem { get; set; }
|
||||
public DivanPoemCompleteViewModel RelatedPoem { get; set; }
|
||||
|
||||
public GanjoorUserPublicProfile SuggestedBy { get; set; }
|
||||
public DivanUserPublicProfile SuggestedBy { get; set; }
|
||||
|
||||
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses)
|
||||
private Tuple<int, string>[] GetCouplets(DivanVerseViewModel[] verses)
|
||||
{
|
||||
int coupetIndex = -1;
|
||||
string coupletText = "";
|
||||
@ -112,11 +112,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
TotalCount = 0;
|
||||
Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]);
|
||||
RelatedCouplets = [];
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/quoted/suggestion/next?skip={Skip}");
|
||||
if (!nextResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await nextResponse.Content.ReadAsStringAsync());
|
||||
@ -128,38 +128,38 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
|
||||
}
|
||||
GanjoorQuotedPoem = JsonConvert.DeserializeObject<GanjoorQuotedPoemViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
DivanQuotedPoem = JsonConvert.DeserializeObject<DivanQuotedPoemViewModel>(await nextResponse.Content.ReadAsStringAsync());
|
||||
|
||||
if(GanjoorQuotedPoem != null)
|
||||
if(DivanQuotedPoem != null)
|
||||
{
|
||||
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/user/profile/{GanjoorQuotedPoem.SuggestedById}");
|
||||
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/user/profile/{DivanQuotedPoem.SuggestedById}");
|
||||
if (!responseUserProfile.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
SuggestedBy = JsonConvert.DeserializeObject<GanjoorUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
SuggestedBy = JsonConvert.DeserializeObject<DivanUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
|
||||
var poemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.PoemId}");
|
||||
var poemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{DivanQuotedPoem.PoemId}");
|
||||
if (!poemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await poemQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>();
|
||||
Poem = JObject.Parse(await poemQuery.Content.ReadAsStringAsync()).ToObject<DivanPoemCompleteViewModel>();
|
||||
|
||||
Couplets = GetCouplets(Poem.Verses);
|
||||
|
||||
if (GanjoorQuotedPoem.RelatedPoemId != null)
|
||||
if (DivanQuotedPoem.RelatedPoemId != null)
|
||||
{
|
||||
var relPoemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{GanjoorQuotedPoem.RelatedPoemId}");
|
||||
var relPoemQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/poem/{DivanQuotedPoem.RelatedPoemId}");
|
||||
if (!relPoemQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await relPoemQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPoemCompleteViewModel>();
|
||||
RelatedPoem = JObject.Parse(await relPoemQuery.Content.ReadAsStringAsync()).ToObject<DivanPoemCompleteViewModel>();
|
||||
|
||||
RelatedCouplets = GetCouplets(RelatedPoem.Verses);
|
||||
|
||||
@ -167,9 +167,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
}
|
||||
|
||||
ModerationModel = new GanjoorQuotedPoemModerationViewModel()
|
||||
ModerationModel = new DivanQuotedPoemModerationViewModel()
|
||||
{
|
||||
Id = GanjoorQuotedPoem.Id,
|
||||
Id = DivanQuotedPoem.Id,
|
||||
Approved = true,
|
||||
ReviewNote = ""
|
||||
};
|
||||
@ -184,16 +184,16 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorQuotedPoemModerationViewModel ModerationModel)
|
||||
public async Task<IActionResult> OnPostAsync(DivanQuotedPoemModerationViewModel ModerationModel)
|
||||
{
|
||||
FatalError = "";
|
||||
try
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var url = $"{APIRoot.Url}/api/ganjoor/quoted/moderate";
|
||||
var url = $"{APIRoot.Url}/api/divan/quoted/moderate";
|
||||
var payload = new StringContent(JsonConvert.SerializeObject(ModerationModel), Encoding.UTF8, "application/json");
|
||||
HttpResponseMessage response = await secureClient.PutAsync(url, payload);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.RolesModel
|
||||
@model DivanRazor.Areas.Admin.Pages.RolesModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -9,7 +9,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class RolesModel : PageModel
|
||||
{
|
||||
@ -25,9 +25,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
return Redirect("/");
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles");
|
||||
if (response.IsSuccessStatusCode)
|
||||
@ -53,9 +53,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnPostNewRoleAsync(string name, string description)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var newRole = new { name = name, description = description };
|
||||
@ -72,9 +72,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnDeleteRoleAsync(string roleName)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/roles/{roleName}");
|
||||
@ -90,9 +90,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnGetPermissionsAsync(string roleName)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles/permissions/{roleName}");
|
||||
@ -109,9 +109,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnPutPermissionsAsync(string roleName)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
string body;
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.SectionDelModel
|
||||
@model DivanRazor.Areas.Admin.Pages.SectionDelModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,11 +1,11 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
|
||||
public class SectionDelModel : PageModel
|
||||
@ -43,11 +43,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastResult = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.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/divan/section/{Request.Query["poemId"]}/{Request.Query["sectionIndex"]}/{true}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastResult = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.TransferMeterModel
|
||||
@model DivanRazor.Areas.Admin.Pages.TransferMeterModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
@ -1,26 +1,26 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class TransferMeterModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// rhythms alphabetically
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsAlphabetically { get; set; }
|
||||
public DivanMetre[] RhythmsAlphabetically { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms by frequency
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsByVerseCount { get; set; }
|
||||
public DivanMetre[] RhythmsByVerseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
@ -52,28 +52,28 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
InitialSourceMeter = Request.Query["m"];
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true");
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms?sortOnVerseCount=true");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount);
|
||||
List<DivanMetre> rhythmsByVerseCount = new List<DivanMetre>(RhythmsByVerseCount);
|
||||
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = "null"
|
||||
}
|
||||
);
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = ""
|
||||
}
|
||||
@ -81,7 +81,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
|
||||
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/divan/pageurl?id={Request.Query["id"]}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true");
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms?sortOnVerseCount=true");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return new BadRequestObjectResult(FatalError);
|
||||
}
|
||||
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
var sourceMeter = RhythmsByVerseCount.Where(m => m.Rhythm == rhythm).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/divan/prosody/transfer/{sourceMeter.Id}/{destMeter.Id}", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Admin.Pages.UsersModel
|
||||
@model DivanRazor.Areas.Admin.Pages.UsersModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_AdminLayout";
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@ -13,7 +13,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Admin.Pages
|
||||
namespace DivanRazor.Areas.Admin.Pages
|
||||
{
|
||||
public class UsersModel : PageModel
|
||||
{
|
||||
@ -46,9 +46,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
FilterByEmail = filterByEmail;
|
||||
FilterByNickName = filterByNickName;
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var url = $"{APIRoot.Url}/api/users?PageNumber={PageNumber}&PageSize={PageSize}";
|
||||
if (!string.IsNullOrEmpty(FilterByEmail))
|
||||
@ -139,9 +139,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnGetRolesAsync(Guid id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}/roles");
|
||||
@ -158,9 +158,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnGetAllRolesAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/roles");
|
||||
@ -177,9 +177,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnPostAddRoleAsync(Guid id, string role)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
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>
|
||||
public async Task<IActionResult> OnDeleteRoleAsync(Guid id, string role)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/users/{id}/roles/{Uri.EscapeDataString(role)}");
|
||||
@ -213,9 +213,9 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public async Task<IActionResult> OnPostToggleStatusAsync(Guid id, bool active)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (!await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (!await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
return BadRequest("لطفاً از دیوان خارج و مجددا به آن وارد شوید.");
|
||||
|
||||
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{id}");
|
||||
@ -1,11 +1,11 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.AllPoemSectionsModel
|
||||
@model DivanRazor.Areas.User.Pages.AllPoemSectionsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "همهٔ قطعات شعر";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -47,7 +47,7 @@ else
|
||||
@foreach (var poemSection in Model.PoemSections)
|
||||
{
|
||||
<div class="up-card">
|
||||
@if (poemSection.SectionType == RMuseum.Models.Ganjoor.PoemSectionType.WholePoem)
|
||||
@if (poemSection.SectionType == RMuseum.Models.Divan.PoemSectionType.WholePoem)
|
||||
{
|
||||
<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">
|
||||
@ -80,7 +80,7 @@ else
|
||||
<div class="up-field-row">
|
||||
<div class="up-field">
|
||||
<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.DivanMetre == null ? "تعیین نشده" : poemSection.DivanMetre.Rhythm)</p>
|
||||
</div>
|
||||
<div class="up-field">
|
||||
<label><span class="up-field-icon" aria-hidden="true">🔤</span> حروف قافیه</label>
|
||||
@ -88,9 +88,9 @@ else
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (poemSection.GanjoorMetre != null && !string.IsNullOrEmpty(poemSection.RhymeLetters) && Model.CanEdit)
|
||||
@if (poemSection.DivanMetre != 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.DivanMetreId, '@poemSection.RhymeLetters')">🔁 بازسازی مرتبطها</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class AllPoemSectionsModel : PageModel
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public string FatalError { get; set; }
|
||||
|
||||
public GanjoorPoemSection[] PoemSections { get; set; }
|
||||
public DivanPoemSection[] PoemSections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// can edit
|
||||
@ -28,17 +28,17 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
return Redirect("/");
|
||||
CanEdit = Request.Cookies["CanEdit"] == "True";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/sections/{Request.Query["id"]}");
|
||||
if (!sectionsResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await sectionsResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PoemSections = JsonConvert.DeserializeObject<GanjoorPoemSection[]>(await sectionsResponse.Content.ReadAsStringAsync());
|
||||
PoemSections = JsonConvert.DeserializeObject<DivanPoemSection[]>(await sectionsResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
}
|
||||
return Page();
|
||||
@ -47,12 +47,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRebuildRelatedSectionsAsync(int meterId, string rhyming)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/sections/updaterelated?metreId={meterId}&rhyme={rhyming}",
|
||||
$"{APIRoot.Url}/api/divan/sections/updaterelated?metreId={meterId}&rhyme={rhyming}",
|
||||
null
|
||||
);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.AwaitingCommentsModel
|
||||
@model DivanRazor.Areas.User.Pages.AwaitingCommentsModel
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "حاشیههای در انتظار تأیید";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,11 +1,11 @@
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -14,7 +14,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class AwaitingCommentsModel : PageModel
|
||||
{
|
||||
@ -26,7 +26,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// <summary>
|
||||
/// comments
|
||||
/// </summary>
|
||||
public List<GanjoorCommentFullViewModel> Comments { get; set; }
|
||||
public List<DivanCommentFullViewModel> Comments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// pagination links
|
||||
@ -43,8 +43,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
|
||||
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"]);
|
||||
}
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/comments/awaiting?PageNumber={pageNumber}&PageSize=20");
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/comments/awaiting?PageNumber={pageNumber}&PageSize=20");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCommentFullViewModel>>();
|
||||
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DivanCommentFullViewModel>>();
|
||||
|
||||
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -150,11 +150,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteCommentAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/comment/awaiting/delete?id={id}");
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
@ -172,11 +172,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPutApproveAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/comment/awaiting/publish", new StringContent(JsonConvert.SerializeObject(id), Encoding.UTF8, "application/json"));
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -192,9 +192,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostStopKeepingAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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"));
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
@ -212,9 +212,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostStartKeepingAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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"));
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.CatEditorModel
|
||||
@model DivanRazor.Areas.User.Pages.CatEditorModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایشگر متن بخش";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,28 +1,28 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using RMuseum.Utils;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class CatEditorModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// my last edit
|
||||
/// </summary>
|
||||
public GanjoorCatCorrectionViewModel MyLastEdit { get; set; }
|
||||
public DivanCatCorrectionViewModel MyLastEdit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
/// <summary>
|
||||
/// fatal error
|
||||
/// </summary>
|
||||
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
public int CatId { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorCatCorrectionViewModel Correction { get; set; }
|
||||
public DivanCatCorrectionViewModel Correction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// get
|
||||
@ -46,11 +46,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
FatalError = Request.Query["FatalError"];
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/pageurl?id={Request.Query["id"]}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
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/divan/cat/correction/last/{CatId}");
|
||||
if (!editResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
MyLastEdit = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
MyLastEdit = JsonConvert.DeserializeObject<DivanCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
|
||||
if (MyLastEdit != null)
|
||||
{
|
||||
Correction = JsonConvert.DeserializeObject<GanjoorCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
Correction = JsonConvert.DeserializeObject<DivanCatCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else
|
||||
{
|
||||
Correction = new GanjoorCatCorrectionViewModel()
|
||||
Correction = new DivanCatCorrectionViewModel()
|
||||
{
|
||||
CatId = CatId,
|
||||
DescriptionHtml = PageInformation.PoetOrCat.Cat.DescriptionHtml,
|
||||
@ -100,12 +100,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostDeleteCatCorrectionAsync(int catid)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/cat/correction/{catid}");
|
||||
$"{APIRoot.Url}/api/divan/cat/correction/{catid}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -122,13 +122,13 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
try
|
||||
{
|
||||
Correction.Description = GanjoorHtmlTools.StripHtmlTags(Correction.DescriptionHtml);
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
Correction.Description = DivanHtmlTools.StripHtmlTags(Correction.DescriptionHtml);
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/cat/correction",
|
||||
$"{APIRoot.Url}/api/divan/cat/correction",
|
||||
new StringContent(JsonConvert.SerializeObject(Correction),
|
||||
Encoding.UTF8,
|
||||
"application/json"));
|
||||
@ -1,11 +1,11 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.CatEditsModel
|
||||
@using RMuseum.Models.Ganjoor
|
||||
@model DivanRazor.Areas.User.Pages.CatEditsModel
|
||||
@using RMuseum.Models.Divan
|
||||
@using RMuseum.Services.Implementation
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایشهای بخشهای من";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,18 +1,18 @@
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class CatEditsModel : PageModel
|
||||
{
|
||||
@ -39,7 +39,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// <summary>
|
||||
/// Corrections
|
||||
/// </summary>
|
||||
public List<GanjoorCatCorrectionViewModel> Corrections { get; set; }
|
||||
public List<DivanCatCorrectionViewModel> Corrections { get; set; }
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
@ -47,8 +47,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
CanEdit = Request.Cookies["CanEdit"] == "True";
|
||||
AllUsersEdits = false;
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
{
|
||||
int pageNumber = 1;
|
||||
@ -56,14 +56,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
pageNumber = int.Parse(Request.Query["page"]);
|
||||
}
|
||||
string url = $"{APIRoot.Url}/api/ganjoor/cat/corrections/mine?PageNumber={pageNumber}&PageSize=20";
|
||||
string url = $"{APIRoot.Url}/api/divan/cat/corrections/mine?PageNumber={pageNumber}&PageSize=20";
|
||||
|
||||
if (CanEdit)
|
||||
{
|
||||
AllUsersEdits = Request.Query["AllUsers"] == "1";
|
||||
if (AllUsersEdits)
|
||||
{
|
||||
url = $"{APIRoot.Url}/api/ganjoor/cat/corrections/all?PageNumber={pageNumber}&PageSize=20";
|
||||
url = $"{APIRoot.Url}/api/divan/cat/corrections/all?PageNumber={pageNumber}&PageSize=20";
|
||||
}
|
||||
}
|
||||
var response = await secureClient.GetAsync(url);
|
||||
@ -73,7 +73,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCatCorrectionViewModel>>();
|
||||
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DivanCatCorrectionViewModel>>();
|
||||
|
||||
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.DeleteAccountModel
|
||||
@model DivanRazor.Areas.User.Pages.DeleteAccountModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "حذف حساب کاربری";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@ -10,7 +10,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class DeleteAccountModel : PageModel
|
||||
{
|
||||
@ -54,9 +54,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
Step1 = true;
|
||||
FatalError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
deleteViewModel.CallbackUrl = $"{_configuration["SiteUrl"]}/User/DeleteAccount";
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
@ -89,9 +89,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
FatalError = "";
|
||||
Step1 = false;
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync(
|
||||
$"{APIRoot.Url}/api/users/selfdelete/finalize/{secret}"
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.EditorModel
|
||||
@model DivanRazor.Areas.User.Pages.EditorModel
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایشگر";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -118,9 +118,9 @@
|
||||
|
||||
// ---------- geo/date tag AND person (شخصیت) tag suggestions ----------
|
||||
// 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 DivanPoemGeoDateTagCorrection[] (pcs.geoDateTags) - that
|
||||
// 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
|
||||
// DivanPoemGeoDateTagCorrection.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
|
||||
// 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
|
||||
@ -139,7 +139,7 @@
|
||||
// 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
|
||||
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.Divan.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
|
||||
// two render functions to filter on. New items always set _uiKind themselves when pushed; this
|
||||
@ -541,7 +541,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// Builds the SuggestedPersonGraphJson payload (see GanjoorPoemGeoDateTagCorrection's doc
|
||||
// Builds the SuggestedPersonGraphJson payload (see DivanPoemGeoDateTagCorrection's doc
|
||||
// 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;
|
||||
// the caller is expected to have already checked the panel is actually meant to be used.
|
||||
@ -1427,10 +1427,10 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="red-color"> @RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.MyLastEdit.OriginalPoemFormat)</p>
|
||||
<p class="red-color"> @RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString(Model.MyLastEdit.OriginalPoemFormat)</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class="green-color"> @RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.MyLastEdit.PoemFormat)</p>
|
||||
<p class="green-color"> @RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString(Model.MyLastEdit.PoemFormat)</p>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@ -1493,12 +1493,12 @@ else
|
||||
@if (verse.OriginalVersePosition != null)
|
||||
{
|
||||
<text>
|
||||
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.OriginalVersePosition)</p>
|
||||
نوع پیشین مصرع: <p class="red-color">@RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Divan.VersePosition)verse.OriginalVersePosition)</p>
|
||||
</text>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((RMuseum.Models.Ganjoor.VersePosition)verse.VersePosition)</p>
|
||||
نوع پیشنهادی مصرع: <p class="green-color">@RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((RMuseum.Models.Divan.VersePosition)verse.VersePosition)</p>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@ -1872,7 +1872,7 @@ else
|
||||
<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())
|
||||
{
|
||||
@foreach (var verseposition in RMuseum.Models.Ganjoor.VersePositionHelper.VersePositions)
|
||||
@foreach (var verseposition in RMuseum.Models.Divan.VersePositionHelper.VersePositions)
|
||||
if (verseposition.VersePosition == Model.MyLastEdit.VerseOrderText.Where(v => v.VORder == verse.VOrder).First().VersePosition)
|
||||
{
|
||||
<option value="@verseposition.VersePosition" selected>@verseposition.Text</option>
|
||||
@ -1884,7 +1884,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var verseposition in RMuseum.Models.Ganjoor.VersePositionHelper.VersePositions)
|
||||
@foreach (var verseposition in RMuseum.Models.Divan.VersePositionHelper.VersePositions)
|
||||
if (verseposition.VersePosition == verse.VersePosition)
|
||||
{
|
||||
<option value="@verseposition.VersePosition" selected>@verseposition.Text</option>
|
||||
@ -1958,7 +1958,7 @@ else
|
||||
|
||||
<div class="up-btn-group">
|
||||
<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.Divan.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>
|
||||
}
|
||||
@ -1979,7 +1979,7 @@ else
|
||||
|
||||
<div class="up-field">
|
||||
<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.DivanMetre1 == null ? "" : Model.DivanMetre1.Rhythm)</p>
|
||||
</div>
|
||||
|
||||
<div class="up-alert up-alert--warning">
|
||||
@ -2009,7 +2009,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.GanjoorMetre1 != null && Model.GanjoorMetre1.Rhythm == rhythm.Rhythm)
|
||||
if (Model.DivanMetre1 != null && Model.DivanMetre1.Rhythm == rhythm.Rhythm)
|
||||
{
|
||||
<option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option>
|
||||
}
|
||||
@ -2091,7 +2091,7 @@ else
|
||||
</div>
|
||||
<div id="secondr3" class="up-field" style="display:none">
|
||||
<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.DivanMetre2 == null ? "" : Model.DivanMetre2.Rhythm)</p>
|
||||
</div>
|
||||
<div id="secondr4" class="up-field" style="display:none">
|
||||
<label for="select-search2"><span class="up-field-icon" aria-hidden="true">🎵</span> جستجوی وزن (دوم)</label>
|
||||
@ -2115,7 +2115,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.GanjoorMetre2 != null && Model.GanjoorMetre2.Rhythm == rhythm.Rhythm)
|
||||
if (Model.DivanMetre2 != null && Model.DivanMetre2.Rhythm == rhythm.Rhythm)
|
||||
{
|
||||
<option value="@rhythm.Rhythm" selected>@rhythm.Rhythm</option>
|
||||
}
|
||||
@ -2135,7 +2135,7 @@ else
|
||||
<div class="up-field">
|
||||
<label>قالب شعری فعلی</label>
|
||||
<p class="up-field-static">
|
||||
@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(Model.PoemFormat)
|
||||
@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString(Model.PoemFormat)
|
||||
<span id="poemformat-old" class="hidden-recitation">@Model.PoemFormat</span>
|
||||
</p>
|
||||
</div>
|
||||
@ -2143,19 +2143,19 @@ else
|
||||
<div class="up-field">
|
||||
<label for="poemformat"><span class="up-field-icon" aria-hidden="true">📐</span> قالب شعری</label>
|
||||
<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.Divan.DivanPoemFormat)))
|
||||
{
|
||||
@if (Model.MyLastEdit != null && (Model.MyLastEdit.PoemFormat == (RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat))
|
||||
@if (Model.MyLastEdit != null && (Model.MyLastEdit.PoemFormat == (RMuseum.Models.Divan.DivanPoemFormat)poemFormat))
|
||||
{
|
||||
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option>
|
||||
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString((RMuseum.Models.Divan.DivanPoemFormat)poemFormat)</option>
|
||||
}
|
||||
else if (Model.PoemFormat == (RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)
|
||||
else if (Model.PoemFormat == (RMuseum.Models.Divan.DivanPoemFormat)poemFormat)
|
||||
{
|
||||
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option>
|
||||
<option value="@poemFormat" selected>@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString((RMuseum.Models.Divan.DivanPoemFormat)poemFormat)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@poemFormat">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString((RMuseum.Models.Ganjoor.GanjoorPoemFormat)poemFormat)</option>
|
||||
<option value="@poemFormat">@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString((RMuseum.Models.Divan.DivanPoemFormat)poemFormat)</option>
|
||||
}
|
||||
|
||||
}
|
||||
@ -2244,9 +2244,9 @@ else
|
||||
@for (int verseIndex = 0; verseIndex < Model.PageInformation.Poem.Verses.Length; verseIndex++)
|
||||
{
|
||||
@if (
|
||||
Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Right
|
||||
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.CenteredVerse1
|
||||
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Paragraph
|
||||
Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Divan.VersePosition.Right
|
||||
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Divan.VersePosition.CenteredVerse1
|
||||
|| Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Divan.VersePosition.Paragraph
|
||||
)
|
||||
{
|
||||
var summaryCoupletNumber = Model.GetVerseCoupletNumber(Model.PageInformation.Poem.Verses[verseIndex]);
|
||||
@ -2258,7 +2258,7 @@ else
|
||||
</p>
|
||||
<div class="up-field">
|
||||
<label>متن</label>
|
||||
@if (Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Ganjoor.VersePosition.Paragraph)
|
||||
@if (Model.PageInformation.Poem.Verses[verseIndex].VersePosition == RMuseum.Models.Divan.VersePosition.Paragraph)
|
||||
{
|
||||
<p class="up-field-static">@Model.PageInformation.Poem.Verses[verseIndex].Text</p>
|
||||
}
|
||||
@ -2270,9 +2270,9 @@ else
|
||||
(nIndex == verseIndex
|
||||
||
|
||||
(
|
||||
Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.Right
|
||||
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.CenteredVerse1
|
||||
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Ganjoor.VersePosition.Paragraph
|
||||
Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Divan.VersePosition.Right
|
||||
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Divan.VersePosition.CenteredVerse1
|
||||
&& Model.PageInformation.Poem.Verses[nIndex].VersePosition != RMuseum.Models.Divan.VersePosition.Paragraph
|
||||
))
|
||||
; nIndex++)
|
||||
{
|
||||
@ -2336,26 +2336,26 @@ else
|
||||
}
|
||||
</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.Divan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Divan.VersePoemSectionType.First) > 1)
|
||||
{
|
||||
<div class="up-card" id="poem-sections">
|
||||
<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.Divan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Divan.VersePoemSectionType.First).ToList())
|
||||
{
|
||||
<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">
|
||||
🧩 قطعهٔ @(poemSetion.Number.ToPersianNumbers()):
|
||||
</a>
|
||||
<p>@Html.Raw(poemSetion.HtmlText)</p>
|
||||
<p class="up-hint">وزن: @(poemSetion.GanjoorMetre == null ? "تعیین نشده" : poemSetion.GanjoorMetre.Rhythm)</p>
|
||||
<p class="up-hint">وزن: @(poemSetion.DivanMetre == null ? "تعیین نشده" : poemSetion.DivanMetre.Rhythm)</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
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.Divan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Divan.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.Divan.PoemSectionType.WholePoem && s.VerseType == RMuseum.Models.Divan.VersePoemSectionType.First).ToList())
|
||||
{
|
||||
<p id="poem-sections">
|
||||
<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>
|
||||
<div class="up-btn-group">
|
||||
@if (Model.GanjoorMetre1 != null && !string.IsNullOrEmpty(Model.RhymeLetters))
|
||||
@if (Model.DivanMetre1 != 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.DivanMetre1.Id, '@Model.RhymeLetters')" class="up-btn up-btn--ghost">🔁 همآهنگهای وزن اول</a>
|
||||
}
|
||||
@if (Model.GanjoorMetre2 != null && !string.IsNullOrEmpty(Model.RhymeLetters))
|
||||
@if (Model.DivanMetre2 != 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.DivanMetre2.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="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>
|
||||
</div>
|
||||
|
||||
@* شخصیت (person) tags use the same GanjoorPoemGeoDateTagCorrection structure as the geo/date
|
||||
@* شخصیت (person) tags use the same DivanPoemGeoDateTagCorrection structure as the geo/date
|
||||
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
|
||||
with its own "existing tags" table, its own pending list, and its own add button - a
|
||||
@ -4,22 +4,22 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class EditorModel : PageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// my last edit
|
||||
/// </summary>
|
||||
public GanjoorPoemCorrectionViewModel MyLastEdit { get; set; }
|
||||
public DivanPoemCorrectionViewModel MyLastEdit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of MyLastEdit.GeoDateTags, pre-serialized here (rather than inline in the .cshtml
|
||||
@ -29,14 +29,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public string MyLastEditGeoDateTagsJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
MyLastEdit?.GeoDateTags ?? Array.Empty<GanjoorPoemGeoDateTagCorrection>(),
|
||||
MyLastEdit?.GeoDateTags ?? Array.Empty<DivanPoemGeoDateTagCorrection>(),
|
||||
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
public GanjoorPageCompleteViewModel PageInformation { get; set; }
|
||||
public DivanPageCompleteViewModel PageInformation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// rhythms alphabetically
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsAlphabetically { get; set; }
|
||||
public DivanMetre[] RhythmsAlphabetically { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms by frequency
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsByVerseCount { get; set; }
|
||||
public DivanMetre[] RhythmsByVerseCount { get; set; }
|
||||
|
||||
public bool CanAssignRhythms { get; set; }
|
||||
|
||||
@ -60,12 +60,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public string FatalError { get; set; }
|
||||
|
||||
public string GetVersePosition(GanjoorVerseViewModel verse)
|
||||
public string GetVersePosition(DivanVerseViewModel verse)
|
||||
{
|
||||
return VersePositionHelper.GetVersePositionString(verse.VersePosition);
|
||||
}
|
||||
|
||||
public int GetVerseCoupletNumber(GanjoorVerseViewModel verse)
|
||||
public int GetVerseCoupletNumber(DivanVerseViewModel verse)
|
||||
{
|
||||
int n = 1;
|
||||
VersePosition pre = VersePosition.Right;
|
||||
@ -125,16 +125,16 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public PoemRelatedImage TextSourceImage { get; set; }
|
||||
|
||||
public GanjoorMetre GanjoorMetre1 { get; set; }
|
||||
public DivanMetre DivanMetre1 { get; set; }
|
||||
|
||||
public GanjoorMetre GanjoorMetre2 { get; set; }
|
||||
public DivanMetre DivanMetre2 { get; set; }
|
||||
|
||||
public string RhymeLetters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// valid for whole poem sections
|
||||
/// </summary>
|
||||
public GanjoorPoemFormat? PoemFormat { get; set; }
|
||||
public DivanPoemFormat? PoemFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// can edit
|
||||
@ -150,7 +150,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// <summary>
|
||||
/// locations
|
||||
/// </summary>
|
||||
public List<GanjoorGeoLocation> Locations { get; set; }
|
||||
public List<DivanGeoLocation> Locations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of Locations (id/name/latitude/longitude only), used client-side to warn
|
||||
@ -161,14 +161,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public string AllLocationsJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
(Locations ?? new List<GanjoorGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
|
||||
(Locations ?? new List<DivanGeoLocation>()).Select(l => new { l.Id, l.Name, l.Latitude, l.Longitude }),
|
||||
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// people (for the geo/date/person tag's person picker)
|
||||
/// </summary>
|
||||
public List<GanjoorRelatedPerson> People { get; set; }
|
||||
public List<DivanRelatedPerson> People { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of People (id/name/birthYearInLHijri/deathYearInLHijri only - enough to
|
||||
@ -177,7 +177,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public string AllPeopleJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
(People ?? new List<GanjoorRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
|
||||
(People ?? new List<DivanRelatedPerson>()).Select(p => new { p.Id, p.Name, p.BirthYearInLHijri, p.DeathYearInLHijri }),
|
||||
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
|
||||
);
|
||||
|
||||
@ -187,7 +187,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public PoemGeoDateTag[] PoemGeoDateTags { get; set; }
|
||||
|
||||
public GanjoorLanguage[] Languages { get; set; }
|
||||
public DivanLanguage[] Languages { get; set; }
|
||||
|
||||
private async Task ReadLanguagesAsync(HttpClient secureClient)
|
||||
{
|
||||
@ -198,7 +198,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
Languages = JsonConvert.DeserializeObject<DivanLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -207,7 +207,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
/// <param name="verses"></param>
|
||||
/// <returns></returns>
|
||||
private Tuple<int, string>[] GetCouplets(GanjoorVerseViewModel[] verses)
|
||||
private Tuple<int, string>[] GetCouplets(DivanVerseViewModel[] verses)
|
||||
{
|
||||
int coupetIndex = -1;
|
||||
string coupletText = "";
|
||||
@ -275,38 +275,38 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
Couplets = Array.Empty<Tuple<int, string>>();
|
||||
|
||||
ShowAdminOps = CanEdit && Request.Query["admin"] == "1";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/poem/correction/last/{Request.Query["id"]}");
|
||||
if (!editResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await editResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
MyLastEdit = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
MyLastEdit = JsonConvert.DeserializeObject<DivanPoemCorrectionViewModel>(await editResponse.Content.ReadAsStringAsync());
|
||||
|
||||
|
||||
|
||||
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true");
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/rhythms?sortOnVerseCount=true");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<DivanMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount);
|
||||
List<DivanMetre> rhythmsByVerseCount = new List<DivanMetre>(RhythmsByVerseCount);
|
||||
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = "null"
|
||||
}
|
||||
);
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
rhythmsByVerseCount.Insert(0, new DivanMetre()
|
||||
{
|
||||
Rhythm = ""
|
||||
}
|
||||
@ -314,7 +314,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
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/divan/pageurl?id={Request.Query["id"]}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
PageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
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;
|
||||
}
|
||||
|
||||
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.DivanMetre != null).Any())
|
||||
{
|
||||
GanjoorMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).First().GanjoorMetre;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).Count() > 1)
|
||||
DivanMetre1 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).OrderBy(s => s.VerseType).First().DivanMetre;
|
||||
if (PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).Count() > 1)
|
||||
{
|
||||
GanjoorMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.GanjoorMetre != null).OrderBy(s => s.VerseType).ToList()[1].GanjoorMetre;
|
||||
DivanMetre2 = PageInformation.Poem.Sections.Where(s => s.SectionType == PoemSectionType.WholePoem && s.DivanMetre != null).OrderBy(s => s.VerseType).ToList()[1].DivanMetre;
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
PoemFormat = GanjoorPoemFormat.Unknown;
|
||||
PoemFormat = DivanPoemFormat.Unknown;
|
||||
}
|
||||
|
||||
if (PageInformation.Poem.Images.Where(i => i.IsTextOriginalSource).Any())
|
||||
@ -388,10 +388,10 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
Locations = new List<GanjoorGeoLocation>();
|
||||
Locations = new List<DivanGeoLocation>();
|
||||
Locations.Add
|
||||
(
|
||||
new GanjoorGeoLocation()
|
||||
new DivanGeoLocation()
|
||||
{
|
||||
Id = 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<DivanGeoLocation[]>(await responseLocations.Content.ReadAsStringAsync()));
|
||||
|
||||
var responsePeople = await secureClient.GetAsync($"{APIRoot.Url}/api/people");
|
||||
if (!responsePeople.IsSuccessStatusCode)
|
||||
@ -409,10 +409,10 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
People = JsonConvert.DeserializeObject<List<GanjoorRelatedPerson>>(await responsePeople.Content.ReadAsStringAsync());
|
||||
People = JsonConvert.DeserializeObject<List<DivanRelatedPerson>>(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/divan/poem/{PageInformation.Id}/geotag");
|
||||
if (!tagsResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await tagsResponse.Content.ReadAsStringAsync());
|
||||
@ -431,12 +431,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostDeletePoemCorrectionsAsync(int poemid)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/correction/{poemid}");
|
||||
$"{APIRoot.Url}/api/divan/poem/correction/{poemid}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
string rawError = await response.Content.ReadAsStringAsync();
|
||||
@ -478,7 +478,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
public string[] verseLanguages { get; set; }
|
||||
public string note { get; set; }
|
||||
public bool hideMyName { get; set; }
|
||||
public RMuseum.Models.Ganjoor.GanjoorPoemGeoDateTagCorrection[] geoDateTags { get; set; }
|
||||
public RMuseum.Models.Divan.DivanPoemGeoDateTagCorrection[] geoDateTags { get; set; }
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostSendPoemCorrectionsAsync([FromBody] PoemCorrectionStructure pcs)
|
||||
@ -487,14 +487,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
if (pcs == null)
|
||||
{
|
||||
return new BadRequestObjectResult("خطای پیشبینی نشده: لطفاً نشانی این شعر را به ganjoor@ganjoor.net ارسال بفرمایید تا بررسی بیشتری انجام شود.");
|
||||
return new BadRequestObjectResult("خطای پیشبینی نشده: لطفاً نشانی این شعر را به divan@ganjoor.net ارسال بفرمایید تا بررسی بیشتری انجام شود.");
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/pageurl?id={pcs.poemid}");
|
||||
if (!pageUrlResponse.IsSuccessStatusCode)
|
||||
{
|
||||
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 pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/page?url={pageUrl}");
|
||||
var pageQuery = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/page?url={pageUrl}");
|
||||
if (!pageQuery.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await pageQuery.Content.ReadAsStringAsync());
|
||||
return new BadRequestObjectResult(FatalError);
|
||||
}
|
||||
var pageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<GanjoorPageCompleteViewModel>();
|
||||
var pageInformation = JObject.Parse(await pageQuery.Content.ReadAsStringAsync()).ToObject<DivanPageCompleteViewModel>();
|
||||
|
||||
string title = null;
|
||||
List<GanjoorVerseVOrderText> vOrderTexts = new List<GanjoorVerseVOrderText>();
|
||||
List<DivanVerseVOrderText> vOrderTexts = new List<DivanVerseVOrderText>();
|
||||
List<VersePosition?> versePositions = new List<VersePosition?>();
|
||||
foreach (var versePosition in pcs.versePositions)
|
||||
{
|
||||
@ -546,7 +546,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
vOrderTexts.Add
|
||||
(
|
||||
new GanjoorVerseVOrderText()
|
||||
new DivanVerseVOrderText()
|
||||
{
|
||||
VORder = vOrder,
|
||||
Text = verseText,
|
||||
@ -593,7 +593,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
}
|
||||
vOrderTexts.Add
|
||||
(
|
||||
new GanjoorVerseVOrderText()
|
||||
new DivanVerseVOrderText()
|
||||
{
|
||||
VORder = vOrder,
|
||||
Text = null,
|
||||
@ -624,7 +624,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
|
||||
|
||||
GanjoorPoemCorrectionViewModel correction = new GanjoorPoemCorrectionViewModel()
|
||||
DivanPoemCorrectionViewModel correction = new DivanPoemCorrectionViewModel()
|
||||
{
|
||||
PoemId = pcs.poemid,
|
||||
Title = title,
|
||||
@ -632,7 +632,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
Rhythm = pcs.rhythm,
|
||||
Rhythm2 = pcs.rhythm2,
|
||||
RhymeLetters = pcs.rhyme,
|
||||
PoemFormat = string.IsNullOrEmpty(pcs.format) ? (GanjoorPoemFormat?)null : (GanjoorPoemFormat)Enum.Parse(typeof(GanjoorPoemFormat), pcs.format),
|
||||
PoemFormat = string.IsNullOrEmpty(pcs.format) ? (DivanPoemFormat?)null : (DivanPoemFormat)Enum.Parse(typeof(DivanPoemFormat), pcs.format),
|
||||
PoemSummary = poemSummary,
|
||||
Note = pcs.note,
|
||||
HideMyName = pcs.hideMyName,
|
||||
@ -640,7 +640,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
};
|
||||
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/correction",
|
||||
$"{APIRoot.Url}/api/divan/poem/correction",
|
||||
new StringContent(JsonConvert.SerializeObject(correction),
|
||||
Encoding.UTF8,
|
||||
"application/json"));
|
||||
@ -666,12 +666,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostBreakPoemAsync(int poemId, int vOrder)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/break",
|
||||
$"{APIRoot.Url}/api/divan/poem/break",
|
||||
new StringContent(JsonConvert.SerializeObject
|
||||
(
|
||||
new PoemVerseOrder()
|
||||
@ -697,12 +697,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostUpdateRelatedSectionsAsync(int meterId, string rhyme)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/sections/updaterelated?metreId={meterId}&rhyme={rhyme}",
|
||||
$"{APIRoot.Url}/api/divan/sections/updaterelated?metreId={meterId}&rhyme={rhyme}",
|
||||
null
|
||||
);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -720,12 +720,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRefillCoupletIndicesAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/refillcoupletindices/{id}",
|
||||
$"{APIRoot.Url}/api/divan/refillcoupletindices/{id}",
|
||||
null
|
||||
);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -743,12 +743,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRegeneratePoemSectionsAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/{id}/sections/regenerate",
|
||||
$"{APIRoot.Url}/api/divan/poem/{id}/sections/regenerate",
|
||||
null
|
||||
);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -769,16 +769,16 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
public async Task<IActionResult> OnGetComputeRhymeAsync(int id)
|
||||
{
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/analysisrhyme/{id}");
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/poem/analysisrhyme/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
}
|
||||
var rhyme = JsonConvert.DeserializeObject<GanjooRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
|
||||
var rhyme = JsonConvert.DeserializeObject<DivanRhymeAnalysisResult>(await response.Content.ReadAsStringAsync());
|
||||
return new OkObjectResult(rhyme.Rhyme);
|
||||
}
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/geotag",
|
||||
$"{APIRoot.Url}/api/divan/poem/geotag",
|
||||
new StringContent(JsonConvert.SerializeObject(
|
||||
new PoemGeoDateTag()
|
||||
{
|
||||
@ -827,12 +827,12 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteGeoDateTagAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/geotag/{id}"
|
||||
$"{APIRoot.Url}/api/divan/poem/geotag/{id}"
|
||||
);
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PutAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/adminedit/{poemId}",
|
||||
$"{APIRoot.Url}/api/divan/poem/adminedit/{poemId}",
|
||||
new StringContent(JsonConvert.SerializeObject(
|
||||
new GanjoorModifyPageViewModel()
|
||||
new DivanModifyPageViewModel()
|
||||
{
|
||||
NoIndex = noindex,
|
||||
RedirectFromFullUrl = redirectfromurl,
|
||||
@ -1,12 +1,12 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.EditsModel
|
||||
@model DivanRazor.Areas.User.Pages.EditsModel
|
||||
@using DNTPersianUtils.Core
|
||||
@using RMuseum.Models.Ganjoor
|
||||
@using GanjooRazor.Utils
|
||||
@using RMuseum.Models.Divan
|
||||
@using DivanRazor.Utils
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایشهای من";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -255,10 +255,10 @@ else
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="color:red">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(correction.OriginalPoemFormat)</p>
|
||||
<p style="color:red">@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString(correction.OriginalPoemFormat)</p>
|
||||
</td>
|
||||
<td>
|
||||
<p style="color:green">@RMuseum.Services.Implementation.GanjoorPoemFormatConvertor.GetString(correction.PoemFormat)</p>
|
||||
<p style="color:green">@RMuseum.Services.Implementation.DivanPoemFormatConvertor.GetString(correction.PoemFormat)</p>
|
||||
</td>
|
||||
<td>
|
||||
<partial name="_ReviewResultBadge" model="correction.PoemFormatReviewResult" />
|
||||
@ -483,11 +483,11 @@ else
|
||||
<td>
|
||||
@if (verse.OriginalVersePosition != null)
|
||||
{
|
||||
<p>تبدیل نوع مصرع از @RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((VersePosition)verse.OriginalVersePosition)</p>
|
||||
<p>تبدیل نوع مصرع از @RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((VersePosition)verse.OriginalVersePosition)</p>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<p style="color:orange">تبدیل نوع مصرع به @RMuseum.Models.Ganjoor.VersePositionHelper.GetVersePositionString((VersePosition)verse.VersePosition)</p>
|
||||
<p style="color:orange">تبدیل نوع مصرع به @RMuseum.Models.Divan.VersePositionHelper.GetVersePositionString((VersePosition)verse.VersePosition)</p>
|
||||
</td>
|
||||
<td>
|
||||
<partial name="_ReviewResultBadge" model="verse.VersePositionResult" />
|
||||
@ -5,18 +5,18 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Auth.ViewModel;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class EditsModel : PageModel
|
||||
{
|
||||
@ -45,14 +45,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public Guid? filteredUserId { get; set; }
|
||||
|
||||
public GanjoorUserPublicProfile Profile { get; set; }
|
||||
public DivanUserPublicProfile Profile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Corrections
|
||||
/// </summary>
|
||||
public List<GanjoorPoemCorrectionViewModel> Corrections { get; set; }
|
||||
public List<DivanPoemCorrectionViewModel> Corrections { get; set; }
|
||||
|
||||
public GanjoorLanguage[] Languages { get; set; }
|
||||
public DivanLanguage[] Languages { get; set; }
|
||||
|
||||
private async Task ReadLanguagesAsync(HttpClient secureClient)
|
||||
{
|
||||
@ -63,7 +63,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
Languages = JsonConvert.DeserializeObject<DivanLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
@ -72,8 +72,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
CanEdit = Request.Cookies["CanEdit"] == "True";
|
||||
AllUsersEdits = false;
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
{
|
||||
int pageNumber = 1;
|
||||
@ -81,26 +81,26 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
pageNumber = int.Parse(Request.Query["page"]);
|
||||
}
|
||||
string url = $"{APIRoot.Url}/api/ganjoor/corrections/mine?PageNumber={pageNumber}&PageSize=20";
|
||||
string url = $"{APIRoot.Url}/api/divan/corrections/mine?PageNumber={pageNumber}&PageSize=20";
|
||||
if (CanEdit)
|
||||
{
|
||||
AllUsersEdits = Request.Query["AllUsers"] == "1";
|
||||
if (AllUsersEdits)
|
||||
{
|
||||
url = $"{APIRoot.Url}/api/ganjoor/corrections/all?PageNumber={pageNumber}&PageSize=20";
|
||||
url = $"{APIRoot.Url}/api/divan/corrections/all?PageNumber={pageNumber}&PageSize=20";
|
||||
}
|
||||
filteredUserId = string.IsNullOrEmpty(Request.Query["UserId"]) ? null : Guid.Parse(Request.Query["UserId"]);
|
||||
if (filteredUserId != null)
|
||||
{
|
||||
url += $"&userId={filteredUserId}";
|
||||
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/user/profile/{filteredUserId}");
|
||||
var responseUserProfile = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/user/profile/{filteredUserId}");
|
||||
if (!responseUserProfile.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = JsonConvert.DeserializeObject<string>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
Profile = JsonConvert.DeserializeObject<GanjoorUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
Profile = JsonConvert.DeserializeObject<DivanUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
|
||||
}
|
||||
}
|
||||
var response = await secureClient.GetAsync(url);
|
||||
@ -110,7 +110,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorPoemCorrectionViewModel>>();
|
||||
Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DivanPoemCorrectionViewModel>>();
|
||||
|
||||
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -205,18 +205,18 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostRollBackCorrectionAsync(int correctionId)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/correction/{correctionId}");
|
||||
var correctionResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/correction/{correctionId}");
|
||||
if (!correctionResponse.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await correctionResponse.Content.ReadAsStringAsync()));
|
||||
}
|
||||
|
||||
var currentCorrection = JsonConvert.DeserializeObject<GanjoorPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
GanjoorPoemCorrectionViewModel correction = new GanjoorPoemCorrectionViewModel();
|
||||
var currentCorrection = JsonConvert.DeserializeObject<DivanPoemCorrectionViewModel>(await correctionResponse.Content.ReadAsStringAsync());
|
||||
DivanPoemCorrectionViewModel correction = new DivanPoemCorrectionViewModel();
|
||||
correction.PoemId = currentCorrection.PoemId;
|
||||
if (currentCorrection.Title != null && currentCorrection.Result == CorrectionReviewResult.Approved)
|
||||
{
|
||||
@ -224,7 +224,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
correction.Title = currentCorrection.OriginalTitle;
|
||||
}
|
||||
|
||||
List<GanjoorVerseVOrderText> vOrderTexts = new List<GanjoorVerseVOrderText>();
|
||||
List<DivanVerseVOrderText> vOrderTexts = new List<DivanVerseVOrderText>();
|
||||
if (currentCorrection.VerseOrderText != null)
|
||||
{
|
||||
|
||||
@ -241,7 +241,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
)
|
||||
{
|
||||
vOrderTexts.Add(
|
||||
new GanjoorVerseVOrderText()
|
||||
new DivanVerseVOrderText()
|
||||
{
|
||||
VORder = verseOrderText.VORder,
|
||||
OriginalText = verseOrderText.Text,
|
||||
@ -284,7 +284,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
if (currentCorrection.GeoDateTags != null)
|
||||
{
|
||||
var geoDateTagsRollback = new List<GanjoorPoemGeoDateTagCorrection>();
|
||||
var geoDateTagsRollback = new List<DivanPoemGeoDateTagCorrection>();
|
||||
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
|
||||
@ -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 same data, which was snapshotted onto this same record when it was approved
|
||||
// (LocationId/LunarYear/etc. are otherwise unused for a pure delete-request)
|
||||
geoDateTagsRollback.Add(new GanjoorPoemGeoDateTagCorrection()
|
||||
geoDateTagsRollback.Add(new DivanPoemGeoDateTagCorrection()
|
||||
{
|
||||
CoupletIndex = geoTag.CoupletIndex,
|
||||
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
|
||||
// live tag it produced (its id was recorded onto ExistingTagId when approved)
|
||||
geoDateTagsRollback.Add(new GanjoorPoemGeoDateTagCorrection()
|
||||
geoDateTagsRollback.Add(new DivanPoemGeoDateTagCorrection()
|
||||
{
|
||||
CoupletIndex = geoTag.CoupletIndex,
|
||||
MarkForDelete = true,
|
||||
@ -337,7 +337,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
}
|
||||
|
||||
HttpResponseMessage response = await secureClient.PostAsync(
|
||||
$"{APIRoot.Url}/api/ganjoor/poem/correction",
|
||||
$"{APIRoot.Url}/api/divan/poem/correction",
|
||||
new StringContent(JsonConvert.SerializeObject(correction),
|
||||
Encoding.UTF8,
|
||||
"application/json"));
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.FAQCatEditModel
|
||||
@model DivanRazor.Areas.User.Pages.FAQCatEditModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایش دستهبندی";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -8,7 +8,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class FAQCatEditModel : PageModel
|
||||
{
|
||||
@ -22,7 +22,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastMessage = "";
|
||||
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
|
||||
{
|
||||
LastMessage = "شما به این بخش دسترسی ندارید.";
|
||||
@ -31,9 +31,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(Request.Query["id"]))
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -57,9 +57,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
HttpResponseMessage response =
|
||||
Category.Id == 0 ?
|
||||
await secureClient.PostAsync($"{APIRoot.Url}/api/faq/cat", new StringContent(JsonConvert.SerializeObject(Category), Encoding.UTF8, "application/json"))
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.FAQItemEditModel
|
||||
@model DivanRazor.Areas.User.Pages.FAQItemEditModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایش پرسش";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@if (!string.IsNullOrEmpty(Model.LastMessage))
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -8,7 +8,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class FAQItemEditModel : PageModel
|
||||
{
|
||||
@ -22,7 +22,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastMessage = "";
|
||||
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
|
||||
{
|
||||
LastMessage = "شما به این بخش دسترسی ندارید.";
|
||||
@ -31,9 +31,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Request.Query["id"]))
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/secure/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -64,9 +64,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
HttpResponseMessage response =
|
||||
Question.Id == 0 ?
|
||||
await secureClient.PostAsync($"{APIRoot.Url}/api/faq", new StringContent(JsonConvert.SerializeObject(Question), Encoding.UTF8, "application/json"))
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.FAQItemsModel
|
||||
@model DivanRazor.Areas.User.Pages.FAQItemsModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "پرسشهای متداول";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,4 +1,4 @@
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -8,7 +8,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class FAQItemsModel : PageModel
|
||||
{
|
||||
@ -26,7 +26,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastMessage = "";
|
||||
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.FAQEntityShortName}-{RMuseumSecurableItem.ModerateOperationShortName}"))
|
||||
{
|
||||
LastMessage = "شما به این بخش دسترسی ندارید.";
|
||||
@ -35,9 +35,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
CatId = 0;
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/secure");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -72,9 +72,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
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)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/faq/cat/items/secure?catId={id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -115,9 +115,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteItemAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/faq/{id}");
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.FinalizeImagesModel
|
||||
@model DivanRazor.Areas.User.Pages.FinalizeImagesModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "نهاییسازی تصاویر پیشنهادی";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -22,7 +22,7 @@
|
||||
else
|
||||
{
|
||||
<div class="up-card">
|
||||
<p><a href="@Model.MainImage.GanjoorUrl" target="_blank">@Model.MainImage.GanjoorTitle</a></p>
|
||||
<p><a href="@Model.MainImage.DivanUrl" target="_blank">@Model.MainImage.DivanTitle</a></p>
|
||||
|
||||
<div style="display:flex;gap:var(--up-space-3);flex-wrap:wrap;">
|
||||
<div>
|
||||
@ -1,15 +1,15 @@
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Models.MuseumLink;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Models.MuseumLink;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.GanjoorIntegration.ViewModels;
|
||||
using RMuseum.Models.DivanIntegration.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class FinalizeImagesModel : PageModel
|
||||
{
|
||||
@ -28,9 +28,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
public GanjoorLinkViewModel MainImage { get; set; }
|
||||
public DivanLinkViewModel MainImage { get; set; }
|
||||
|
||||
public GanjoorLinkViewModel PreviouslyLinkedImage { get; set; }
|
||||
public DivanLinkViewModel PreviouslyLinkedImage { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
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"]);
|
||||
MainImage = null;
|
||||
PreviouslyLinkedImage = null;
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/nextunsychedimage?skip={Skip}");
|
||||
if (!imageResponse.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = await imageResponse.Content.ReadAsStringAsync();
|
||||
@ -61,7 +61,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
TotalCount = JsonConvert.DeserializeObject<PaginationMetadata>(paginnationMetadata).totalCount;
|
||||
}
|
||||
|
||||
var images = JsonConvert.DeserializeObject<GanjoorLinkViewModel[]>(await imageResponse.Content.ReadAsStringAsync());
|
||||
var images = JsonConvert.DeserializeObject<DivanLinkViewModel[]>(await imageResponse.Content.ReadAsStringAsync());
|
||||
|
||||
if(images != null)
|
||||
{
|
||||
@ -97,11 +97,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
LastError = "";
|
||||
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 DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/sync/{ImageLinkFinalizeModel.Id}/{ImageLinkFinalizeModel.DisplayOnPage}", null);
|
||||
if (!imageResponse.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = await imageResponse.Content.ReadAsStringAsync();
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.HistoryModel
|
||||
@model DivanRazor.Areas.User.Pages.HistoryModel
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ادامهٔ مطالعه";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,12 +1,12 @@
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -16,7 +16,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class HistoryModel : PageModel
|
||||
{
|
||||
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// <summary>
|
||||
/// history items
|
||||
/// </summary>
|
||||
public List<GanjoorUserBookmarkViewModel> HistoryItems { get; set; }
|
||||
public List<DivanUserBookmarkViewModel> HistoryItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// tracking is enabled
|
||||
@ -45,8 +45,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
|
||||
return Redirect("/");
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/options/KeepHistory");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -85,7 +85,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
HistoryItems = JArray.Parse(await responseHistoryItems.Content.ReadAsStringAsync()).ToObject<List<GanjoorUserBookmarkViewModel>>();
|
||||
HistoryItems = JArray.Parse(await responseHistoryItems.Content.ReadAsStringAsync()).ToObject<List<DivanUserBookmarkViewModel>>();
|
||||
|
||||
string paginnationMetadata = responseHistoryItems.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -168,9 +168,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteHistoryItem(Guid id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/tracking/{id}");
|
||||
|
||||
@ -190,9 +190,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostStopTracking()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
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()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.PutAsync($"{APIRoot.Url}/api/tracking", new StringContent(JsonConvert.SerializeObject(true), Encoding.UTF8, "application/json"));
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.Panel.Pages.IndexModel
|
||||
@model DivanRazor.Areas.Panel.Pages.IndexModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "پیشخان کاربر";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,5 +1,5 @@
|
||||
using GanjooRazor.Models.User;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Models.User;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
@ -8,7 +8,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GanjooRazor.Areas.Panel.Pages
|
||||
namespace DivanRazor.Areas.Panel.Pages
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
@ -48,9 +48,9 @@ namespace GanjooRazor.Areas.Panel.Pages
|
||||
|
||||
private async Task _PreparePage()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var userInfoResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/{Request.Cookies["UserId"]}");
|
||||
if (userInfoResponse.IsSuccessStatusCode)
|
||||
@ -90,9 +90,9 @@ namespace GanjooRazor.Areas.Panel.Pages
|
||||
{
|
||||
LastError = "";
|
||||
PasswordChanged = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var isAdminResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/users/isadmin?userId={Request.Cookies["UserId"]}");
|
||||
if (isAdminResponse.IsSuccessStatusCode)
|
||||
@ -134,9 +134,9 @@ namespace GanjooRazor.Areas.Panel.Pages
|
||||
LastError = "گذرواژهٔ جدید با گذرواژهٔ کنونی یکسان است.";
|
||||
return Page();
|
||||
}
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var changePassResp = await secureClient.PostAsync($"{APIRoot.Url}/api/users/setmypassword",
|
||||
new StringContent(JsonConvert.SerializeObject
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.LanguageEditModel
|
||||
@model DivanRazor.Areas.User.Pages.LanguageEditModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "ویرایش زبان یا نویسش";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@if (!string.IsNullOrEmpty(Model.LastMessage))
|
||||
@ -1,19 +1,19 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Auth.Memory;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class LanguageEditModel : PageModel
|
||||
{
|
||||
[BindProperty]
|
||||
public GanjoorLanguage Language { get; set; }
|
||||
public DivanLanguage Language { get; set; }
|
||||
|
||||
public string LastMessage { get; set; }
|
||||
|
||||
@ -23,16 +23,16 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastMessage = "";
|
||||
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.GanjoorEntityShortName}-{RMuseumSecurableItem.Translations}"))
|
||||
await DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.DivanEntityShortName}-{RMuseumSecurableItem.Translations}"))
|
||||
{
|
||||
LastMessage = "شما به این بخش دسترسی ندارید.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages/{Request.Query["id"]}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -41,7 +41,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
Language = JsonConvert.DeserializeObject<GanjoorLanguage>(await response.Content.ReadAsStringAsync());
|
||||
Language = JsonConvert.DeserializeObject<DivanLanguage>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -56,9 +56,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
await DivanSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.LanguagesModel
|
||||
@model DivanRazor.Areas.User.Pages.LanguagesModel
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "زبانها و نویسشها";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -1,23 +1,23 @@
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using RMuseum.Models.Auth.Memory;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Divan;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class LanguagesModel : PageModel
|
||||
{
|
||||
public string LastMessage { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public GanjoorLanguage Language { get; set; }
|
||||
public DivanLanguage Language { get; set; }
|
||||
|
||||
public GanjoorLanguage[] Languages { get; set; }
|
||||
public DivanLanguage[] Languages { get; set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
@ -25,16 +25,16 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastMessage = "";
|
||||
await GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.GanjoorEntityShortName}-{RMuseumSecurableItem.Translations}"))
|
||||
await DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
if (!ViewData.ContainsKey($"{RMuseumSecurableItem.DivanEntityShortName}-{RMuseumSecurableItem.Translations}"))
|
||||
{
|
||||
LastMessage = "شما به این بخش دسترسی ندارید.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.GetAsync($"{APIRoot.Url}/api/translations/languages");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -43,7 +43,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
Languages = JsonConvert.DeserializeObject<GanjoorLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
Languages = JsonConvert.DeserializeObject<DivanLanguage[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
}
|
||||
else
|
||||
@ -59,9 +59,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
LastMessage = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PostAsync($"{APIRoot.Url}/api/translations/languages", new StringContent(JsonConvert.SerializeObject(Language), Encoding.UTF8, "application/json"));
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -86,9 +86,9 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/translations/languages/{id}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.MyBookmarksModel
|
||||
@model DivanRazor.Areas.User.Pages.MyBookmarksModel
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "نشانشدههای من";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -79,7 +79,7 @@ else
|
||||
|
||||
@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/divan-bookmarking/\" target=\"_blank\">اینجا</a> را ببینید.")" />
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -105,7 +105,7 @@ else
|
||||
{
|
||||
<div>
|
||||
<span class="up-badge">یادداشت</span>
|
||||
<div id="note-text-@bookmark.Id" class="ganjoor-comment">
|
||||
<div id="note-text-@bookmark.Id" class="divan-comment">
|
||||
@Html.Raw(bookmark.PrivateNote)
|
||||
</div>
|
||||
</div>
|
||||
@ -6,16 +6,16 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class MyBookmarksModel : PageModel
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public List<NameIdUrlImage> PaginationLinks { get; set; }
|
||||
|
||||
public List<GanjoorUserBookmarkViewModel> Bookmarks { get; set; }
|
||||
public List<DivanUserBookmarkViewModel> Bookmarks { get; set; }
|
||||
|
||||
public string Query { get; set; }
|
||||
|
||||
@ -41,8 +41,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
Query = Request.Query["w"];
|
||||
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
{
|
||||
int pageNumber = 1;
|
||||
@ -50,14 +50,14 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
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/divan/bookmark/?PageNumber={pageNumber}&PageSize=20&q={Query}");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
Bookmarks = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorUserBookmarkViewModel>>();
|
||||
Bookmarks = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DivanUserBookmarkViewModel>>();
|
||||
|
||||
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -140,11 +140,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteBookmark(Guid id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/bookmark/{id}");
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/bookmark/{id}");
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
@ -161,11 +161,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPutBookmarkNote(Guid id, string note)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/bookmark/{id}", new StringContent(JsonConvert.SerializeObject(note), Encoding.UTF8, "application/json"));
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -1,10 +1,10 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.MyCommentsModel
|
||||
@model DivanRazor.Areas.User.Pages.MyCommentsModel
|
||||
@using DNTPersianUtils.Core
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "حاشیههای من";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@ -5,17 +5,17 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DNTPersianUtils.Core;
|
||||
using GanjooRazor.Utils;
|
||||
using DivanRazor.Utils;
|
||||
using GSpotifyProxy.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.Divan.ViewModels;
|
||||
using RSecurityBackend.Models.Auth.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
|
||||
namespace GanjooRazor.Areas.User.Pages
|
||||
namespace DivanRazor.Areas.User.Pages
|
||||
{
|
||||
public class MyCommentsModel : PageModel
|
||||
{
|
||||
@ -34,7 +34,7 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// <summary>
|
||||
/// comments
|
||||
/// </summary>
|
||||
public List<GanjoorCommentFullViewModel> Comments { get; set; }
|
||||
public List<DivanCommentFullViewModel> Comments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// pagination links
|
||||
@ -50,8 +50,8 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
return Redirect("/");
|
||||
|
||||
LastError = "";
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
{
|
||||
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"]);
|
||||
}
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/comments/mine?PageNumber={pageNumber}&PageSize=20");
|
||||
var response = await secureClient.GetAsync($"{APIRoot.Url}/api/divan/comments/mine?PageNumber={pageNumber}&PageSize=20");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
LastError = JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorCommentFullViewModel>>();
|
||||
Comments = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<DivanCommentFullViewModel>>();
|
||||
|
||||
string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(paginnationMetadata))
|
||||
@ -177,11 +177,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnDeleteMyComment(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/comment?id={id}");
|
||||
var response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/divan/comment?id={id}");
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
@ -198,11 +198,11 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
|
||||
public async Task<IActionResult> OnPutMyComment(int id, string comment)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient(new GanjoorReloginHandler(Request, Response)))
|
||||
using (HttpClient secureClient = new HttpClient(new DivanReloginHandler(Request, Response)))
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
if (await DivanSessionChecker.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/divan/comment/{id}", new StringContent(JsonConvert.SerializeObject(comment), Encoding.UTF8, "application/json"));
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
@ -1,11 +1,11 @@
|
||||
@page
|
||||
@model GanjooRazor.Areas.User.Pages.MySessionsModel
|
||||
@model DivanRazor.Areas.User.Pages.MySessionsModel
|
||||
@using DNTPersianUtils.Core
|
||||
@using System.Linq
|
||||
@{
|
||||
Layout = "_UserPanelLayout";
|
||||
ViewData["Title"] = "نشستهای من";
|
||||
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
await DivanRazor.Utils.DivanSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
|
||||
}
|
||||
<div class="up-page-header">
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user