diff options
| author | 2024-05-09 22:57:08 +0200 | |
|---|---|---|
| committer | 2024-05-09 22:57:08 +0200 | |
| commit | 430afe103b9b31c321c13d510250877b1361c965 (patch) | |
| tree | e136e9678405aa14a01d4dfb5911f06ec9850d3c /html.c | |
| parent | The /admin page now accepts ?q=regex for a content search. (diff) | |
| download | snac2-430afe103b9b31c321c13d510250877b1361c965.tar.gz snac2-430afe103b9b31c321c13d510250877b1361c965.tar.xz snac2-430afe103b9b31c321c13d510250877b1361c965.zip | |
Added a title to search results.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -2566,8 +2566,14 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 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, 0, show, &to); |
| 2569 | xs *title = NULL; | ||
| 2569 | 2570 | ||
| 2570 | *body = html_timeline(&snac, tl, 0, 0, show, 0, NULL, "/admin", 1); | 2571 | if (xs_list_len(tl)) |
| 2572 | title = xs_fmt(L("Search results for '%s'"), q); | ||
| 2573 | else | ||
| 2574 | title = xs_fmt(L("Nothing found for '%s'"), q); | ||
| 2575 | |||
| 2576 | *body = html_timeline(&snac, tl, 0, 0, show, 0, title, "/admin", 1); | ||
| 2571 | *b_size = strlen(*body); | 2577 | *b_size = strlen(*body); |
| 2572 | status = 200; | 2578 | status = 200; |
| 2573 | } | 2579 | } |