commit 2b27a0d

default  ·  2024-05-10 09:02:59 +0000 UTC
parent 430afe1
Some tweaks to web ui search.
1 files changed,  +6, -3
M html.c
M html.c
+6, -3
 1@@ -2565,15 +2565,18 @@ int html_get_handler(const xs_dict *req, const char *q_path,
 2             if (q && *q) {
 3                 /* search by content */
 4                 int to = 0;
 5-                xs *tl = content_search(&snac, q, 1, 0, show, &to);
 6+                xs *tl = content_search(&snac, q, 1, skip ? 10 : 0, skip + show, &to);
 7                 xs *title = NULL;
 8+                xs *page = xs_fmt("/admin?q=%s", q);
 9+                int tl_len = xs_list_len(tl);
10 
11-                if (xs_list_len(tl))
12+                if (tl_len)
13                     title = xs_fmt(L("Search results for '%s'"), q);
14                 else
15                     title = xs_fmt(L("Nothing found for '%s'"), q);
16 
17-                *body   = html_timeline(&snac, tl, 0, 0, show, 0, title, "/admin", 1);
18+                *body   = html_timeline(&snac, tl, 0, 0, tl_len,
19+                            (to || tl_len == skip + show), title, page, 1);
20                 *b_size = strlen(*body);
21                 status  = 200;
22             }