aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorGravatar Jason A. Donenfeld <Jason@zx2c4.com>2012-07-13 02:13:39 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2012-07-13 03:01:46 (JST)
commit184c5655b2e350dbd0dd8be75d3f370f22aa6dee (patch)
treebcd4fef53e416f443666ec50f21adef33fc95e76 /cgit.c
parentfc9181ff3d3ebbe0159871f6a49438e60bb17f58 (diff)
downloadcgit-184c5655b2e350dbd0dd8be75d3f370f22aa6dee.zip
cgit-184c5655b2e350dbd0dd8be75d3f370f22aa6dee.tar.gz
ui-repolist: Case insensitive sorting and age sort
Add two options, one for doing the ordinary name sorts in a case-insensitive manner, and another for choosing to sort repos in each section by age instead of by name.
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 4656ed6..24ef8e0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -199,6 +199,8 @@ void config_cb(const char *name, const char *value)
199 ctx.cfg.cache_static_ttl = atoi(value); 199 ctx.cfg.cache_static_ttl = atoi(value);
200 else if (!strcmp(name, "cache-dynamic-ttl")) 200 else if (!strcmp(name, "cache-dynamic-ttl"))
201 ctx.cfg.cache_dynamic_ttl = atoi(value); 201 ctx.cfg.cache_dynamic_ttl = atoi(value);
202 else if (!strcmp(name, "case-sensitive-sort"))
203 ctx.cfg.case_sensitive_sort = atoi(value);
202 else if (!strcmp(name, "about-filter")) 204 else if (!strcmp(name, "about-filter"))
203 ctx.cfg.about_filter = new_filter(value, ABOUT); 205 ctx.cfg.about_filter = new_filter(value, ABOUT);
204 else if (!strcmp(name, "commit-filter")) 206 else if (!strcmp(name, "commit-filter"))
@@ -231,6 +233,8 @@ void config_cb(const char *name, const char *value)
231 ctx.cfg.scan_hidden_path = atoi(value); 233 ctx.cfg.scan_hidden_path = atoi(value);
232 else if (!strcmp(name, "section-from-path")) 234 else if (!strcmp(name, "section-from-path"))
233 ctx.cfg.section_from_path = atoi(value); 235 ctx.cfg.section_from_path = atoi(value);
236 else if (!strcmp(name, "section-sort"))
237 ctx.cfg.section_sort = xstrdup(value);
234 else if (!strcmp(name, "source-filter")) 238 else if (!strcmp(name, "source-filter"))
235 ctx.cfg.source_filter = new_filter(value, SOURCE); 239 ctx.cfg.source_filter = new_filter(value, SOURCE);
236 else if (!strcmp(name, "summary-log")) 240 else if (!strcmp(name, "summary-log"))
@@ -335,6 +339,7 @@ static void prepare_context(struct cgit_context *ctx)
335 ctx->cfg.cache_root_ttl = 5; 339 ctx->cfg.cache_root_ttl = 5;
336 ctx->cfg.cache_scanrc_ttl = 15; 340 ctx->cfg.cache_scanrc_ttl = 15;
337 ctx->cfg.cache_static_ttl = -1; 341 ctx->cfg.cache_static_ttl = -1;
342 ctx->cfg.case_sensitive_sort = 1;
338 ctx->cfg.css = "/cgit.css"; 343 ctx->cfg.css = "/cgit.css";
339 ctx->cfg.logo = "/cgit.png"; 344 ctx->cfg.logo = "/cgit.png";
340 ctx->cfg.local_time = 0; 345 ctx->cfg.local_time = 0;
@@ -359,6 +364,7 @@ static void prepare_context(struct cgit_context *ctx)
359 ctx->cfg.scan_hidden_path = 0; 364 ctx->cfg.scan_hidden_path = 0;
360 ctx->cfg.script_name = CGIT_SCRIPT_NAME; 365 ctx->cfg.script_name = CGIT_SCRIPT_NAME;
361 ctx->cfg.section = ""; 366 ctx->cfg.section = "";
367 ctx->cfg.section_sort = "name";
362 ctx->cfg.summary_branches = 10; 368 ctx->cfg.summary_branches = 10;
363 ctx->cfg.summary_log = 10; 369 ctx->cfg.summary_log = 10;
364 ctx->cfg.summary_tags = 10; 370 ctx->cfg.summary_tags = 10;