summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-09 22:57:08 +0200
committerdefault <nobody@localhost>2024-05-09 22:57:08 +0200
commit430afe103b9b31c321c13d510250877b1361c965 (patch)
treee136e9678405aa14a01d4dfb5911f06ec9850d3c
parenta5766a6c83662efeb9544ab4a14ea4bfa33c5344 (diff)
Added a title to search results.
-rw-r--r--html.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/html.c b/html.c
index c56f4cb..505f41a 100644
--- a/html.c
+++ b/html.c
@@ -2566,8 +2566,14 @@ int html_get_handler(const xs_dict *req, const char *q_path,
/* search by content */
int to = 0;
xs *tl = content_search(&snac, q, 1, 0, show, &to);
+ xs *title = NULL;
- *body = html_timeline(&snac, tl, 0, 0, show, 0, NULL, "/admin", 1);
+ if (xs_list_len(tl))
+ 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);
*b_size = strlen(*body);
status = 200;
}