docs: maintaining exact search status inside the search page
This commit is contained in:
parent
5687ed5324
commit
678e043940
@ -42,6 +42,10 @@
|
||||
<div class="actionbox">
|
||||
<form action="/search" method="get" id="searchform">
|
||||
<input type="text" name="s" id="s" class="inputText" value="@Model.Query" placeholder="جستجو" />
|
||||
@if(Model.ExactSearch)
|
||||
{
|
||||
<input type="hidden" name="es" id="es" value="1" />
|
||||
}
|
||||
<select name="author" id="author" onchange="onSelectedPoetChanged()">
|
||||
|
||||
@{
|
||||
|
||||
@ -145,6 +145,8 @@ namespace GanjooRazor.Pages
|
||||
|
||||
public bool Quoted { get; set; }
|
||||
|
||||
public bool ExactSearch { get; set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
if (bool.Parse(Configuration["MaintenanceMode"]))
|
||||
@ -155,7 +157,8 @@ namespace GanjooRazor.Pages
|
||||
LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Token"]);
|
||||
|
||||
Query = Request.Query["s"].ApplyCorrectYeKe().Trim();
|
||||
bool quotes = Query.IndexOf("\"") != -1 || Request.Query["es"] == "1";
|
||||
ExactSearch = Request.Query["es"] == "1";
|
||||
bool quotes = Query.IndexOf("\"") != -1 || ExactSearch;
|
||||
Query = LanguageUtils.MakeTextSearchable(Query); //replace zwnj with space
|
||||
if (quotes)
|
||||
Query = $"\"{Query}\"";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user