summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-10 07:05:24 -0400
committerJune McEnroe <june@causal.agency>2020-07-10 07:05:24 -0400
commit0a18eb475fcda950a211c8b4ef80683ff892f78b (patch)
tree68aaac8ef5a4399d43088ce0d5104b2263b00c66
parentAdd -c to check SQL queries (diff)
downloadscooper-0a18eb475fcda950a211c8b4ef80683ff892f78b.tar.gz
scooper-0a18eb475fcda950a211c8b4ef80683ff892f78b.zip
Add syntax and columns to search form
-rw-r--r--html.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/html.c b/html.c
index 59ecc30..9d9134b 100644
--- a/html.c
+++ b/html.c
@@ -90,6 +90,14 @@ htmlNav(struct khtmlreq *html, const char *network, const char *context) {
 	return khtml_closeelem(html, 2);
 }
 
+static const char *SyntaxURL = {
+	"https://www.sqlite.org/fts5.html#full_text_query_syntax"
+};
+
+static const char *Columns = {
+	"network, channel, query, nick, user, target, message"
+};
+
 enum kcgi_err
 htmlSearch(struct khtmlreq *html, const char *network, const char *context) {
 	char label[256];
@@ -105,6 +113,14 @@ htmlSearch(struct khtmlreq *html, const char *network, const char *context) {
 			KATTR_ACTION, Pages[Search],
 			KATTR__MAX
 		)
+		|| khtml_attr(html, KELEM_A, KATTR_HREF, SyntaxURL, KATTR__MAX)
+		|| khtml_puts(html, "Syntax")
+		|| khtml_closeelem(html, 1)
+		|| khtml_putc(html, ' ')
+		|| khtml_attr(html, KELEM_SPAN, KATTR_TITLE, Columns, KATTR__MAX)
+		|| khtml_puts(html, "Columns")
+		|| khtml_closeelem(html, 1)
+		|| khtml_putc(html, ' ')
 		|| khtml_attr(
 			html, KELEM_INPUT,
 			KATTR_TYPE, "search",