about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui-repolist.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index 4dea3b3..d56654d 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -136,6 +136,18 @@ static int cmp(const char *s1, const char *s2)
 	return 0;
 }
 
+static int sort_section(const void *a, const void *b)
+{
+	const struct cgit_repo *r1 = a;
+	const struct cgit_repo *r2 = b;
+	int result;
+
+	result = cmp(r1->section, r2->section);
+	if (!result)
+		result = cmp(r1->name, r2->name);
+	return result;
+}
+
 static int sort_name(const void *a, const void *b)
 {
 	const struct cgit_repo *r1 = a;
@@ -178,6 +190,7 @@ struct sortcolumn {
 };
 
 struct sortcolumn sortcolumn[] = {
+	{"section", sort_section},
 	{"name", sort_name},
 	{"desc", sort_desc},
 	{"owner", sort_owner},
@@ -219,6 +232,8 @@ void cgit_print_repolist()
 
 	if(ctx.qry.sort)
 		sorted = sort_repolist(ctx.qry.sort);
+	else
+		sort_repolist("section");
 
 	html("<table summary='repository list' class='list nowrap'>");
 	for (i=0; i<cgit_repolist.count; i++) {
15:52:04 -0500'>2018-12-03Call uiShow at init so that TermFocus gets setJune McEnroe 2018-12-03Check nick to determine if is selfJune McEnroe 2018-12-03Ignore ~ username prefixesJune McEnroe 2018-12-02Move host, port, pass, webp to selfJune McEnroe 2018-12-02Add -r option for realnameJune McEnroe 2018-12-02Send automated messages to TagStatus with UIColdJune McEnroe 2018-12-02Various man page tweaks and editsJune McEnroe 2018-12-02Fix UI resume on /urlJune McEnroe 2018-12-02Add sandman.m to READMEJune McEnroe 2018-12-01Crudely handle reconnecting after suspendJune McEnroe 2018-12-01Fix sandman hangJune McEnroe 2018-12-01Use sigaction in sandmanJune McEnroe 2018-11-30Handle signals consistently in the event loopJune McEnroe 2018-11-30Separate ircConnect and ircDisconnectJune McEnroe 2018-11-30Measure length of log timestamp more consistentlyJune McEnroe 2018-11-30Reformat sandman Objective-C codeJune McEnroe 2018-11-30Ignore sandmanJune McEnroe 2018-11-30Add sandmanJune McEnroe 2018-11-29Strip timestamps from log replayJune McEnroe 2018-11-29Add basic log replayJune McEnroe 2018-11-29Show unread count in term titleJune McEnroe 2018-11-29Handle no such nick errorJune McEnroe 2018-11-29Add /whoisJune McEnroe 2018-11-29Set LIBRESSL_PREFIX in Darwin.mkJune McEnroe 2018-11-28Add NetBSD.mkJune McEnroe 2018-11-28Make use of config.mk and add Darwin.mkJune McEnroe