fixes for search page (exact search bug fix + w3 validator passing)

This commit is contained in:
Hamid Reza Mohammadi 2021-09-28 20:24:02 +03:30
parent 8365a0403f
commit 8583483490
3 changed files with 8 additions and 7 deletions

View File

@ -162,7 +162,7 @@
</p>
</div>
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{poem.Category.Poet.ImageUrl}")" alt=@($"{poem.Category.Poet.Name}") />
<img src="@($"{GanjooRazor.APIRoot.InternetUrl}{poem.Category.Poet.ImageUrl}")" alt="@($"{poem.Category.Poet.Name}")" />
<div class="spacer">&nbsp;</div>
</div>

View File

@ -246,7 +246,7 @@ namespace GanjooRazor.Pages
{
catQuery = $"&cat={Request.Query["cat"]}";
}
PagingToolsHtml = GeneratePagingBarHtml(paginationMetadata, $"/search?s={Query}&author={PoetId}{catQuery}");
PagingToolsHtml = GeneratePagingBarHtml(paginationMetadata, $"/search?s={WebUtility.UrlEncode(Query)}&amp;author={PoetId}{catQuery}");
}
}
@ -262,11 +262,12 @@ namespace GanjooRazor.Pages
{
string htmlText = "<p style=\"text-align: center;\">";
if (paginationMetadata != null && paginationMetadata.totalPages > 1)
{
if (paginationMetadata.currentPage > 3)
{
htmlText += $"[<a href=\"{routeStartWithQueryStrings}&page=1\">صفحهٔ اول</a>] …";
htmlText += $"[<a href=\"{routeStartWithQueryStrings.Replace("\"", "%22")}&amp;page=1\">صفحهٔ اول</a>] …";
}
for (int i = (paginationMetadata.currentPage - 2); i <= (paginationMetadata.currentPage + 2); i++)
{
@ -279,14 +280,14 @@ namespace GanjooRazor.Pages
}
else
{
htmlText += $"<a href=\"{routeStartWithQueryStrings}&page={i}\">{i.ToPersianNumbers()}</a>";
htmlText += $"<a href=\"{routeStartWithQueryStrings.Replace("\"", "%22")}&amp;page={i}\">{i.ToPersianNumbers()}</a>";
}
htmlText += "] ";
}
}
if (paginationMetadata.totalPages > (paginationMetadata.currentPage + 2))
{
htmlText += $"… [<a href=\"{routeStartWithQueryStrings}&page={paginationMetadata.totalPages}\">صفحهٔ آخر</a>]";
htmlText += $"… [<a href=\"{routeStartWithQueryStrings.Replace("\"", "%22")}&amp;page={paginationMetadata.totalPages}\">صفحهٔ آخر</a>]";
}
}

View File

@ -8,8 +8,8 @@
},
"AllowedHosts": "*",
"GoogleAnalyticsCode": "",
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"APIRoot": "https://ganjgah.ir",
"GlobalAPIRoot": "https://ganjgah.ir",
"SiteUrl": "http://localhost:33081",
"ReadOnlyMode": "False"
}