author | Benjamin Close <Benjamin.Close@clearchain.com> | 2008-11-25 14:25:35 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-11-29 12:25:54 (UTC) |
commit | d71c0c725d7b5ddfc5b788d328a5fc7a27739662 (patch) (side-by-side diff) | |
tree | c7b0e71793470987c05a278dc5ed011a4903f524 /cgit.c | |
parent | 7b5cee65fd9cf31e4f19ce4ff613778cb95512a9 (diff) | |
download | cgit-d71c0c725d7b5ddfc5b788d328a5fc7a27739662.zip cgit-d71c0c725d7b5ddfc5b788d328a5fc7a27739662.tar.gz cgit-d71c0c725d7b5ddfc5b788d328a5fc7a27739662.tar.bz2 |
Add support for sorting by Age in the repolist
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -145,24 +145,26 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.has_sha1 = 1; } else if (!strcmp(name, "id2")) { ctx.qry.sha2 = xstrdup(value); ctx.qry.has_sha1 = 1; } else if (!strcmp(name, "ofs")) { ctx.qry.ofs = atoi(value); } else if (!strcmp(name, "path")) { ctx.qry.path = trim_end(value, '/'); } else if (!strcmp(name, "name")) { ctx.qry.name = xstrdup(value); } else if (!strcmp(name, "mimetype")) { ctx.qry.mimetype = xstrdup(value); + } else if (!strcmp(name, "s")){ + ctx.qry.sort = xstrdup(value); } } static void prepare_context(struct cgit_context *ctx) { memset(ctx, 0, sizeof(ctx)); ctx->cfg.agefile = "info/web/last-modified"; ctx->cfg.nocache = 0; ctx->cfg.cache_size = 0; ctx->cfg.cache_dynamic_ttl = 5; ctx->cfg.cache_max_create_time = 5; ctx->cfg.cache_repo_ttl = 5; |