about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--contexts.c3
-rw-r--r--default.css34
-rw-r--r--events.c3
-rw-r--r--html.c43
-rw-r--r--networks.c3
-rw-r--r--server.h3
6 files changed, 56 insertions, 33 deletions
diff --git a/contexts.c b/contexts.c
index bf5811f..b81c515 100644
--- a/contexts.c
+++ b/contexts.c
@@ -57,8 +57,7 @@ enum kcgi_err pageContexts(struct kreq *req) {
 		|| khttp_body(req)
 		|| khtml_open(&html, req, KHTML_PRETTY)
 		|| htmlHead(&html, network)
-		|| htmlNav(&html, network, NULL)
-		|| htmlSearch(&html, network, NULL);
+		|| htmlNav(&html, network, NULL);
 	if (error) return error;
 
 	dbBindText(stmt.contexts, ":network", network);
diff --git a/default.css b/default.css
index edd2af3..5ed641e 100644
--- a/default.css
+++ b/default.css
@@ -5,4 +5,38 @@ html {
 body {
 	max-width: 130ch;
 	margin: auto;
+	padding: 1em 1ch;
+}
+
+h1 {
+	margin: 0;
+}
+
+nav {
+	display: flex;
+	flex-wrap: wrap;
+	align-items: center;
+	justify-content: space-between;
+	margin-bottom: 1em;
+}
+
+nav ol {
+	margin: 1em 0 0;
+	padding: 0;
+	list-style-type: none;
+}
+nav ol li {
+	display: inline;
+}
+nav ol li::before {
+	content: '/';
+}
+
+nav form {
+	margin-top: 1em;
+}
+nav form span[title] {
+	text-decoration: underline;
+	text-decoration-style: dotted;
+	cursor: help;
 }
diff --git a/events.c b/events.c
index f40e5ae..deedc59 100644
--- a/events.c
+++ b/events.c
@@ -107,8 +107,7 @@ enum kcgi_err pageEvents(struct kreq *req) {
 		|| khttp_body(req)
 		|| khtml_open(&html, req, KHTML_PRETTY)
 		|| htmlHead(&html, context)
-		|| htmlNav(&html, network, context)
-		|| htmlSearch(&html, network, context);
+		|| htmlNav(&html, network, context);
 	if (error) return error;
 
 	sqlite3_stmt *events = stmt.eventsAfter;
diff --git a/html.c b/html.c
index dbc6631..af1ffb2 100644
--- a/html.c
+++ b/html.c
@@ -40,6 +40,13 @@ enum kcgi_err htmlHead(struct khtmlreq *html, const char *title) {
 		|| khtml_closeelem(html, 1);
 }
 
+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
 htmlNav(struct khtmlreq *html, const char *network, const char *context) {
 	enum kcgi_err error = 0
@@ -82,40 +89,20 @@ htmlNav(struct khtmlreq *html, const char *network, const char *context) {
 		if (error) return error;
 	}
 
-	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];
 	snprintf(
 		label, sizeof(label), "Search%s%s",
 		(network ? " " : ""), (context ? context : network ? network : "")
 	);
 
-	enum kcgi_err error = 0
+	error = 0
+		|| khtml_closeelem(html, 1)
 		|| khtml_attr(
 			html, KELEM_FORM,
 			KATTR_METHOD, "get",
 			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",
@@ -127,7 +114,15 @@ htmlSearch(struct khtmlreq *html, const char *network, const char *context) {
 			KATTR_TYPE, "submit",
 			KATTR_VALUE, label,
 			KATTR__MAX
-		);
+		)
+		|| khtml_putc(html, ' ')
+		|| 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);
 	if (error) return error;
 
 	if (network) {
@@ -152,5 +147,5 @@ htmlSearch(struct khtmlreq *html, const char *network, const char *context) {
 		if (error) return error;
 	}
 
-	return khtml_closeelem(html, 1);
+	return khtml_closeelem(html, 2);
 }
diff --git a/networks.c b/networks.c
index ed19394..d1e292d 100644
--- a/networks.c
+++ b/networks.c
@@ -52,8 +52,7 @@ enum kcgi_err pageNetworks(struct kreq *req) {
 		|| khttp_body(req)
 		|| khtml_open(&html, req, KHTML_PRETTY)
 		|| htmlHead(&html, "Litterbox")
-		|| htmlNav(&html, NULL, NULL)
-		|| htmlSearch(&html, NULL, NULL);
+		|| htmlNav(&html, NULL, NULL);
 	if (error) return error;
 
 	enum State {
diff --git a/server.h b/server.h
index f863b75..d07631e 100644
--- a/server.h
+++ b/server.h
@@ -141,6 +141,3 @@ enum kcgi_err htmlHead(struct khtmlreq *html, const char *title);
 enum kcgi_err htmlNav(
 	struct khtmlreq *html, const char *network, const char *context
 );
-enum kcgi_err htmlSearch(
-	struct khtmlreq *html, const char *network, const char *context
-);
ll correct, but perhaps the full explanation is interesting! Reported-by: Konstantin Ryabitsev <mricon@kernel.org> 2014-06-28ui-log: ignore unhandled argumentsJohn Keeping If you search for a bogus range string here: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/ Using something like "range" and "qwerty123456", it returns an "Internal Server Error" and the following in the logs: > [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] fatal: > ambiguous argument 'qwerty123456': unknown revision or path not in the > working tree., referer: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ > [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Use '--' to > separate paths from revisions, like this:, referer: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ > [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] 'git <command> > [<revision>...] -- [<file>...]', referer: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ > [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Premature end > of script headers: cgit, referer: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ The cache will kick in, so if you search for the same string again, it'll show an empty range, so you have to change the bogus strings each time. This is because we just pass the arguments straight to Git's revision parsing machinery which die()s if it cannot parse an argument, printing the above to stderr and exiting. The patch below makes it a bit friendlier by just ignoring unhandled arguments, but I can't see an easy way to report errors when we can't parse revision arguments without losing the flexibility of supporting all of the revision specifiers supported by Git. Reported-by: Konstantin Ryabitsev <mricon@kernel.org> 2014-06-28git: update for git 2.0Christian Hesse prefixcmp() and suffixcmp() have been remove, functionality is now provided by starts_with() and ends_with(). Retrurn values have been changed, so instead of just renaming we have to fix logic. Everything else looks just fine. 2014-04-17remove trailing whitespaces from source filesChristian Hesse 2014-04-12git: update to 1.9.2Christian Hesse Everything works just bumping the version in Makefile and commit hash in submodule. No code changes required. 2014-04-05Fix cgit_parse_url when a repo url is contained in another repo urlJulian Maurice For example, if I have two repos (remove-suffix is enabled): /foo /foo/bar http://cgit/foo/bar/ is interpreted as "repository 'foo', command 'bar'" instead of "repository 'foo/bar'" 2014-03-20Makefile: use more reliable git tarball mirrorJason A. Donenfeld 2014-03-20git: update to 1.9.1Christian Hesse