Compare commits

..

No commits in common. "b297498ca9ac07bb61064767fcae88dd1675cc2b" and "cc4506b918c8f74ef803114bdcf627aa3e9c878c" have entirely different histories.

6 changed files with 34 additions and 52 deletions

View File

@ -25,10 +25,7 @@ Response HandlerSearch::handleRequest(const Request &r)
std::string q = r.get("q"); std::string q = r.get("q");
if(q.empty()) if(q.empty())
{ {
TemplatePage searchForm = this->templ->getPage("searchform"); return errorResponse("Missing search term", "No search term supplied");
response.setBody(searchForm.render());
response.setStatus(200);
return response;
} }
auto pageDao = this->database->createPageDao(); auto pageDao = this->database->createPageDao();

View File

@ -12,7 +12,6 @@
#include <filesystem> #include <filesystem>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/capability.h> #include <sys/capability.h>
#define HAVE_LANDLOCK 0
#include <qssb.h> #include <qssb.h>
#include "../logger.h" #include "../logger.h"
#include "../utils.h" #include "../utils.h"

View File

@ -13,10 +13,9 @@
<li><a href="{qswiki:config:linkrecent}">Recent changes</a></li> <li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{qswiki:config:linkallpages}">All pages</a></li> <li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{qswiki:config:linkallcats}">All categories</a></li> <li><a href="{qswiki:config:linkallcats}">All categories</a></li>
<li id="searchlink"><a href="{qswiki:config:linksearch}">Search</a></li>
</ul> </ul>
<ul id="right" class="search"> <ul id="right" class="search">
<li><div id="searchbar"><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></div></li> <li><div><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></div></li>
</ul> </ul>
</nav> </nav>

View File

@ -13,7 +13,6 @@
<li><a href="{qswiki:config:linkrecent}">Recent changes</a></li> <li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{qswiki:config:linkallpages}">All pages</a></li> <li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{qswiki:config:linkallcats}">All categories</a></li> <li><a href="{qswiki:config:linkallcats}">All categories</a></li>
<li id="searchlink"><a href="{qswiki:config:linksearch}">Search</a></li>
</ul> </ul>
<ul> <ul>
@ -21,6 +20,6 @@
</ul> </ul>
<ul id="right" class="search"> <ul id="right" class="search">
<li><div id="searchbar"><form action="{qswiki:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" value="search here" onfocus="this.value=''" name="q"/></form></div></li> <li><div><form action="{qswiki:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" value="search here" onfocus="this.value=''" name="q"/></form></div></li>
</ul> </ul>
</nav> </nav>

View File

@ -1,8 +0,0 @@
{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}

View File

@ -23,6 +23,7 @@ h1, h2, h3
{ {
margin: 0; margin: 0;
padding: 0; padding: 0;
display: inline;
} }
nav nav
@ -36,7 +37,6 @@ nav
grid-area: nav; grid-area: nav;
} }
nav ul nav ul
{ {
background-color: #062463; background-color: #062463;
@ -47,12 +47,16 @@ nav ul
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
}
}
nav li nav li
{ {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
nav a, nav a:visited nav a, nav a:visited
@ -64,6 +68,7 @@ nav a, nav a:visited
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
line-height: 100%; line-height: 100%;
} }
nav a:hover, nav a:focus nav a:hover, nav a:focus
@ -76,6 +81,8 @@ nav a:hover, nav a:focus
font-weight: bold; font-weight: bold;
} }
a, a:visited a, a:visited
{ {
color: #062463;; color: #062463;;
@ -85,6 +92,7 @@ a:hover
{ {
background-color: #062463; background-color: #062463;
color: white; color: white;
} }
#content #content
@ -99,16 +107,19 @@ a:hover
#sidebar #sidebar
{ {
grid-area: side; grid-area: side;
} }
#sidebar ul #sidebar ul
{ {
list-style-type: none; list-style-type: none;
} }
#sidebar a, a:visited #sidebar a, a:visited
{ {
color: #062463; color: #062463;
} }
#sidebar a:hover #sidebar a:hover
@ -126,8 +137,9 @@ a:hover
{ {
background-color: #062463; background-color: #062463;
color: white; color: white;
}
}
footer footer
{ {
width: 100%; width: 100%;
@ -148,7 +160,6 @@ footer ul
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
} }
footer li footer li
{ {
margin: 0; margin: 0;
@ -157,12 +168,14 @@ footer li
line-height: 45px; line-height: 45px;
color: white; color: white;
font-weight: bold; font-weight: bold;
//flex: 1 1 0;
text-align: center; text-align: center;
} }
footer a, a:visited footer a, a:visited
{ {
text-decoration: none; text-decoration: none;
color: white; color: white;
display: inline-block; display: inline-block;
} }
@ -185,27 +198,20 @@ footer a:hover, ul#nav a:focus
text-decoration: underline; text-decoration: underline;
font-weight: bold; font-weight: bold;
} }
ol ol
{ {
counter-reset: item; counter-reset: item;
} }
.indexlink .indexlink
{ {
display: block; display: block;
} }
.notexists .notexists
{ {
color: red !important; color: red !important;
font-weight: bold; font-weight: bold;
} }
#searchlink
{
display: none;
}
@media screen and (orientation: portrait) @media screen and (orientation: portrait)
{ {
@ -213,23 +219,13 @@ ol
{ {
display: none; display: none;
} }
#footer li:nth-child(-n+2) #footer li:nth-child(-n+2)
{ {
display: none; display: none;
} }
#footer li:nth-of-type(3) #footer li:nth-of-type(3)
{ {
text-align: center; text-align: center;
width: 100%; width: 100%;
} }
#searchlink {
display: inline;
}
#searchbar {
display: none;
}
} }