parent
8f10475ec6
commit
54a6685c34
@ -27,6 +27,17 @@
|
||||
var stickyEnabled = cookieValue != "false";
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function deletePoetFromSearch(poetId, poetName){
|
||||
if(!confirm('آیا میخواهید '+ poetName+ ' را از نتایج حذف کنید؟')) return;
|
||||
const currentUrl = new URL(window.location.href);
|
||||
const params = currentUrl.searchParams;
|
||||
params.append('e', poetId.toString());
|
||||
currentUrl.search = params.toString();
|
||||
window.location.href = currentUrl.toString();
|
||||
}
|
||||
</script>
|
||||
|
||||
@if (Model.CanEdit)
|
||||
{
|
||||
<script>
|
||||
@ -340,8 +351,10 @@
|
||||
@($"{(poem.CoupletsCount ?? 0).ToPersianNumbers()} بیت")
|
||||
</div>
|
||||
|
||||
|
||||
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{poem.Category.Poet.ImageUrl}")" alt="@($"{poem.Category.Poet.Nickname}")" />
|
||||
<div class="poet">
|
||||
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{poem.Category.Poet.ImageUrl}")" alt="@($"{poem.Category.Poet.Nickname}")" />
|
||||
<a role="button" onclick="deletePoetFromSearch(@poem.Category.Poet.Id, '@(poem.Category.Poet.Nickname)')" class="actionlink" title="حذف @($"{poem.Category.Poet.Nickname}") از نتایج"><i class="notranslate noindent-info-button close-button"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="spacer"> </div>
|
||||
|
||||
|
||||
@ -87,6 +87,8 @@ namespace GanjooRazor.Pages
|
||||
public bool Quoted { get; set; }
|
||||
public bool ExactSearch { get; set; }
|
||||
|
||||
public int[] ExceptPoetId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// can edit
|
||||
@ -405,11 +407,26 @@ namespace GanjooRazor.Pages
|
||||
title += $" شامل کلیدواژهٔ «{Query}»";
|
||||
}
|
||||
|
||||
List<int> exceptPoetId = new List<int>();
|
||||
foreach (var e in Request.Query["e"])
|
||||
{
|
||||
exceptPoetId.Add(int.Parse(e));
|
||||
}
|
||||
ExceptPoetId = exceptPoetId.ToArray();
|
||||
|
||||
|
||||
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}&coupletCountsFrom={CoupletCountsFrom}&coupletCountsTo={CoupletCountsTo}";
|
||||
if(!string.IsNullOrEmpty(Query))
|
||||
{
|
||||
url += $"&term={Query}";
|
||||
}
|
||||
string exceptUrl = "";
|
||||
foreach (var e in exceptPoetId)
|
||||
{
|
||||
exceptUrl += $"&e={e}";
|
||||
}
|
||||
url += exceptUrl;
|
||||
|
||||
var response = await _httpClient.GetAsync(url);
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user