#413 similars in a specific categoies

This commit is contained in:
Hamid Reza Mohammadi 2023-12-09 17:20:27 +03:30
parent 151b1df2a1
commit 0ad5e4b297
3 changed files with 17 additions and 4 deletions

View File

@ -212,7 +212,7 @@ namespace GanjooRazor.Pages
CatFullTitle += parentCat.Title;
CatFullTitle += " »";
}
CatFullTitle += cat.Cat.Title;
CatFullTitle += " " + cat.Cat.Title;
}
}
else

View File

@ -236,6 +236,13 @@
}
</select>
@if(Model.CatId != 0)
{
<div class="width-100per">
تنها در بخش <a href="@Model.CatFullUrl">@Model.CatFullTitle</a>
</div>
}
<input type="submit" class="width-100per margin-top-5px" value="اعمال ورودی‌ها" />
@if (Model.CanEdit)

View File

@ -339,9 +339,11 @@ namespace GanjooRazor.Pages
foreach (var parentCat in cat.Cat.Ancestors)
{
CatFullTitle += parentCat.Title;
CatFullTitle += " &raquo";
CatFullTitle += " »";
}
CatFullTitle += cat.Cat.Title;
CatFullTitle += " " + cat.Cat.Title;
title += $" در بخش {CatFullTitle}";
}
}
else
@ -350,7 +352,7 @@ namespace GanjooRazor.Pages
CatFullTitle = "";
}
string url = $"{APIRoot.Url}/api/ganjoor/poems/similar?PageNumber={pageNumber}&PageSize=20&metre={Metre}&rhyme={Rhyme}&poetId={PoetId}&language={Language}&format={(int)Format}";
string url = $"{APIRoot.Url}/api/ganjoor/poems/similar?PageNumber={pageNumber}&PageSize=20&metre={Metre}&rhyme={Rhyme}&poetId={PoetId}&catId={CatId}&language={Language}&format={(int)Format}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode)
@ -374,6 +376,10 @@ namespace GanjooRazor.Pages
{
htmlText = $"<div>{Environment.NewLine}";
string authorParam = PoetId != 0 ? $"&amp;a={PoetId}" : "";
if(authorParam != "" && CatId != 0)
{
authorParam += $"&amp;c={CatId}";
}
title += $" - صفحهٔ {pageNumber.ToPersianNumbers()}";
if (paginationMetadata.currentPage > 3)
{