diff options
| author | 2024-05-10 11:02:59 +0200 | |
|---|---|---|
| committer | 2024-05-10 11:02:59 +0200 | |
| commit | 2b27a0d772cd294cfe1db67bbfdb2b58df585130 (patch) | |
| tree | da987d0c5aaa621a72935a1dfbfbaa798e72927c | |
| parent | Added a title to search results. (diff) | |
| download | penes-snac2-2b27a0d772cd294cfe1db67bbfdb2b58df585130.tar.gz penes-snac2-2b27a0d772cd294cfe1db67bbfdb2b58df585130.tar.xz penes-snac2-2b27a0d772cd294cfe1db67bbfdb2b58df585130.zip | |
Some tweaks to web ui search.
| -rw-r--r-- | html.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -2565,15 +2565,18 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 2565 | if (q && *q) { | 2565 | if (q && *q) { |
| 2566 | /* search by content */ | 2566 | /* search by content */ |
| 2567 | int to = 0; | 2567 | int to = 0; |
| 2568 | xs *tl = content_search(&snac, q, 1, 0, show, &to); | 2568 | xs *tl = content_search(&snac, q, 1, skip ? 10 : 0, skip + show, &to); |
| 2569 | xs *title = NULL; | 2569 | xs *title = NULL; |
| 2570 | xs *page = xs_fmt("/admin?q=%s", q); | ||
| 2571 | int tl_len = xs_list_len(tl); | ||
| 2570 | 2572 | ||
| 2571 | if (xs_list_len(tl)) | 2573 | if (tl_len) |
| 2572 | title = xs_fmt(L("Search results for '%s'"), q); | 2574 | title = xs_fmt(L("Search results for '%s'"), q); |
| 2573 | else | 2575 | else |
| 2574 | title = xs_fmt(L("Nothing found for '%s'"), q); | 2576 | title = xs_fmt(L("Nothing found for '%s'"), q); |
| 2575 | 2577 | ||
| 2576 | *body = html_timeline(&snac, tl, 0, 0, show, 0, title, "/admin", 1); | 2578 | *body = html_timeline(&snac, tl, 0, 0, tl_len, |
| 2579 | (to || tl_len == skip + show), title, page, 1); | ||
| 2577 | *b_size = strlen(*body); | 2580 | *b_size = strlen(*body); |
| 2578 | status = 200; | 2581 | status = 200; |
| 2579 | } | 2582 | } |