summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-10 11:02:59 +0200
committerdefault <nobody@localhost>2024-05-10 11:02:59 +0200
commit2b27a0d772cd294cfe1db67bbfdb2b58df585130 (patch)
treeda987d0c5aaa621a72935a1dfbfbaa798e72927c
parent430afe103b9b31c321c13d510250877b1361c965 (diff)
Some tweaks to web ui search.
-rw-r--r--html.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/html.c b/html.c
index 505f41a..9eefeec 100644
--- a/html.c
+++ b/html.c
@@ -2565,15 +2565,18 @@ int html_get_handler(const xs_dict *req, const char *q_path,
if (q && *q) {
/* search by content */
int to = 0;
- xs *tl = content_search(&snac, q, 1, 0, show, &to);
+ xs *tl = content_search(&snac, q, 1, skip ? 10 : 0, skip + show, &to);
xs *title = NULL;
+ xs *page = xs_fmt("/admin?q=%s", q);
+ int tl_len = xs_list_len(tl);
- if (xs_list_len(tl))
+ if (tl_len)
title = xs_fmt(L("Search results for '%s'"), q);
else
title = xs_fmt(L("Nothing found for '%s'"), q);
- *body = html_timeline(&snac, tl, 0, 0, show, 0, title, "/admin", 1);
+ *body = html_timeline(&snac, tl, 0, 0, tl_len,
+ (to || tl_len == skip + show), title, page, 1);
*b_size = strlen(*body);
status = 200;
}