docs: #286 display selected rhyme and rhythm in the similar poems page + rhymes statistics page + a bug fix

This commit is contained in:
Hamid Reza Mohammadi 2022-02-21 21:43:43 +03:30
parent 9004e0caac
commit 244922b65f
2 changed files with 10 additions and 10 deletions

View File

@ -28,7 +28,7 @@ namespace GanjooRazor.Pages
if (string.IsNullOrEmpty(Request.Query["v"]) || string.IsNullOrEmpty(Request.Query["g"]))
{
GanjoorPage.HtmlText = "<p>شعری با مشخصات انتخاب شده یافت نشد.</p>";
return;
}
int pageNumber = 1;
@ -39,6 +39,7 @@ namespace GanjooRazor.Pages
string metre = Request.Query["v"];
string rhyme = Request.Query["g"];
string auther = string.IsNullOrEmpty(Request.Query["a"]) ? "0" : Request.Query["a"];
string url = $"{APIRoot.Url}/api/ganjoor/poems/similar?PageNumber={pageNumber}&PageSize=20&metre={metre}&rhyme={rhyme}&poetId={auther}";
@ -62,16 +63,14 @@ namespace GanjooRazor.Pages
GanjoorPage.Title += $"{poetInfo.Nickname} ";
}
}
GanjoorPage.Title += $"با وزن «{metre}»";
GanjoorPage.Title += $" و حروف قافیهٔ «{rhyme}»";
string htmlText = "";
htmlText += $"<div class=\"sitem\" id=\"all\">{Environment.NewLine}";
htmlText += $"<h2>{GanjoorPage.Title}</h2>";
htmlText += $"</div>{Environment.NewLine}";
foreach (var poem in poems)

View File

@ -57,14 +57,15 @@ namespace GanjooRazor.Pages
string htmlText = "";
htmlText += $"<div class=\"sitem\" id=\"all\">{Environment.NewLine}";
htmlText += $"<h2>{GanjoorPage.Title}</h2>";
if (poetId != 0)
{
htmlText += $"<div class=\"sitem\" id=\"all\">{Environment.NewLine}";
htmlText += $"<h2>{Environment.NewLine}";
htmlText += $"<p>{Environment.NewLine}";
htmlText += $"<a href=\"/vazn/?v={Uri.EscapeDataString(metre)}\">مشاهدهٔ فهرست شعرهای همهٔ شاعران با این وزن</a>{Environment.NewLine}";
htmlText += $"</h2>{Environment.NewLine}";
htmlText += $"</div>{Environment.NewLine}";
htmlText += $"</p>{Environment.NewLine}";
}
htmlText += $"</div>{Environment.NewLine}";
var poems = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorPoemCompleteViewModel>>();