HandlerSearch: Render a form when no q= given
Tento commit je obsažen v:
rodič
75268e0073
revize
fdcef18861
@ -25,7 +25,10 @@ Response HandlerSearch::handleRequest(const Request &r)
|
||||
std::string q = r.get("q");
|
||||
if(q.empty())
|
||||
{
|
||||
return errorResponse("Missing search term", "No search term supplied");
|
||||
TemplatePage searchForm = this->templ->getPage("searchform");
|
||||
response.setBody(searchForm.render());
|
||||
response.setStatus(200);
|
||||
return response;
|
||||
}
|
||||
|
||||
auto pageDao = this->database->createPageDao();
|
||||
|
8
template/quitesimple/searchform
Normální soubor
8
template/quitesimple/searchform
Normální soubor
@ -0,0 +1,8 @@
|
||||
{qswiki:include:general_header}
|
||||
<main id="content">
|
||||
<h2>Search</h2>
|
||||
|
||||
Search content of pages:
|
||||
<form action="{qswiki:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" name="q" value="search here" onfocus="this.value=''"></form>
|
||||
</main>
|
||||
{qswiki:include:general_footer}
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele