summary refs log tree commit diff
path: root/networks.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-11 14:04:25 -0400
committerJune McEnroe <june@causal.agency>2020-07-11 14:04:25 -0400
commit24c7965d9d0aaf27985d29c5cbb12a4e08ac7d9c (patch)
tree2a9e3955d59c375edb7d02ae0bd195bf966d57ea /networks.c
parentImplement basic search page (diff)
downloadscooper-24c7965d9d0aaf27985d29c5cbb12a4e08ac7d9c.tar.gz
scooper-24c7965d9d0aaf27985d29c5cbb12a4e08ac7d9c.zip
Factor out "scope" of pages
Use this to keep the search query around and hide network and context
from the search results if the scope is already limited.
Diffstat (limited to 'networks.c')
-rw-r--r--networks.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/networks.c b/networks.c
index 7f974c4..74b9ea2 100644
--- a/networks.c
+++ b/networks.c
@@ -44,6 +44,8 @@ const char *NetworksQuery = SQL(
 );
 
 enum kcgi_err pageNetworks(struct kreq *req) {
+	struct Scope scope = {0};
+
 	enum kcgi_err error = httpHead(req, KHTTP_200, KMIME_TEXT_HTML);
 	if (req->method == KMETHOD_HEAD) return error;
 
@@ -52,7 +54,7 @@ enum kcgi_err pageNetworks(struct kreq *req) {
 		|| khttp_body(req)
 		|| khtml_open(&html, req, KHTML_PRETTY)
 		|| htmlHead(&html, "Litterbox")
-		|| htmlNav(&html, NULL, NULL);
+		|| htmlNav(&html, scope);
 	if (error) return error;
 
 	dbBindInt(stmt.networks, ":recent", pageRecent);